stm32/ipcc: fix hil test

This commit is contained in:
xoviat 2023-05-21 20:18:26 -05:00
parent 1f65a4eb6f
commit d1dfaa1905
4 changed files with 30 additions and 6 deletions

View file

@ -11,7 +11,7 @@ MEMORY
} }
/* /*
Memory size for STM32WB55xC with 512K FLASH Memory size for STM32WB55xG with 512K FLASH
MEMORY MEMORY
{ {

View file

@ -12,6 +12,9 @@ fn main() -> Result<(), Box<dyn Error>> {
if cfg!(any(feature = "stm32f103c8", feature = "stm32c031c6")) { if cfg!(any(feature = "stm32f103c8", feature = "stm32c031c6")) {
println!("cargo:rustc-link-arg-bins=-Tlink.x"); println!("cargo:rustc-link-arg-bins=-Tlink.x");
println!("cargo:rerun-if-changed=link.x"); println!("cargo:rerun-if-changed=link.x");
} else if cfg!(feature = "stm32wb55rg") {
println!("cargo:rustc-link-arg-bins=-Tlink.x");
fs::write(out.join("memory.x"), include_bytes!("memory_ble.x")).unwrap();
} else { } else {
println!("cargo:rustc-link-arg-bins=-Tlink_ram.x"); println!("cargo:rustc-link-arg-bins=-Tlink_ram.x");
println!("cargo:rerun-if-changed=link_ram.x"); println!("cargo:rerun-if-changed=link_ram.x");

23
tests/stm32/memory_ble.x Normal file
View file

@ -0,0 +1,23 @@
/*
Memory size for STM32WB55xG with 512K FLASH
*/
MEMORY
{
FLASH (rx) : ORIGIN = 0x08000000, LENGTH = 512K
RAM (xrw) : ORIGIN = 0x20000008, LENGTH = 0x2FFF8
RAM_SHARED (xrw) : ORIGIN = 0x20030000, LENGTH = 10K
}
/* Place stack at the end of SRAM1 */
_stack_start = ORIGIN(RAM) + LENGTH(RAM);
/*
* Scatter the mailbox interface memory sections in shared memory
*/
SECTIONS {
TL_REF_TABLE (NOLOAD) : { *(TL_REF_TABLE) } >RAM_SHARED
MB_MEM1 (NOLOAD) : { *(MB_MEM1) } >RAM_SHARED
MB_MEM2 (NOLOAD) : { _sMB_MEM2 = . ; *(MB_MEM2) ; _eMB_MEM2 = . ; } >RAM_SHARED
}

View file

@ -7,6 +7,7 @@
#[path = "../example_common.rs"] #[path = "../example_common.rs"]
mod example_common; mod example_common;
use embassy_executor::Spawner; use embassy_executor::Spawner;
use embassy_stm32::interrupt;
use embassy_stm32::ipcc::{Config, Ipcc}; use embassy_stm32::ipcc::{Config, Ipcc};
use embassy_stm32::tl_mbox::TlMbox; use embassy_stm32::tl_mbox::TlMbox;
use embassy_time::{Duration, Timer}; use embassy_time::{Duration, Timer};
@ -20,9 +21,6 @@ async fn main(_spawner: Spawner) {
let config = Config::default(); let config = Config::default();
let mut ipcc = Ipcc::new(p.IPCC, config); let mut ipcc = Ipcc::new(p.IPCC, config);
let config = Config::default();
let mut ipcc = Ipcc::new(p.IPCC, config);
let rx_irq = interrupt::take!(IPCC_C1_RX); let rx_irq = interrupt::take!(IPCC_C1_RX);
let tx_irq = interrupt::take!(IPCC_C1_TX); let tx_irq = interrupt::take!(IPCC_C1_TX);
@ -31,7 +29,7 @@ async fn main(_spawner: Spawner) {
loop { loop {
let wireless_fw_info = mbox.wireless_fw_info(); let wireless_fw_info = mbox.wireless_fw_info();
match wireless_fw_info { match wireless_fw_info {
None => error!("not yet initialized"), None => {}
Some(fw_info) => { Some(fw_info) => {
let version_major = fw_info.version_major(); let version_major = fw_info.version_major();
let version_minor = fw_info.version_minor(); let version_minor = fw_info.version_minor();
@ -49,7 +47,7 @@ async fn main(_spawner: Spawner) {
} }
} }
Timer::after(Duration::from_millis(500)).await; Timer::after(Duration::from_millis(50)).await;
} }
info!("Test OK"); info!("Test OK");