1489: stm32/ipcc: make IPCC methods static r=xoviat a=OueslatiGhaith 1500: stm32/tests: disable sdmmc test for now r=xoviat a=xoviat Co-authored-by: goueslati <ghaith.oueslati@habemus.com> Co-authored-by: Ghaith Oueslati <73850124+OueslatiGhaith@users.noreply.github.com> Co-authored-by: xoviat <xoviat@users.noreply.github.com>
This commit is contained in:
@ -8,7 +8,7 @@ license = "MIT OR Apache-2.0"
|
||||
embassy-sync = { version = "0.2.0", path = "../../embassy-sync", features = ["defmt"] }
|
||||
embassy-executor = { version = "0.2.0", path = "../../embassy-executor", features = ["arch-cortex-m", "executor-thread", "defmt", "integrated-timers"] }
|
||||
embassy-time = { version = "0.1.0", path = "../../embassy-time", features = ["defmt", "defmt-timestamp-uptime", "tick-hz-32_768"] }
|
||||
embassy-stm32 = { version = "0.1.0", path = "../../embassy-stm32", features = ["nightly", "defmt", "stm32wb55rg", "time-driver-any", "exti"] }
|
||||
embassy-stm32 = { version = "0.1.0", path = "../../embassy-stm32", features = ["nightly", "defmt", "stm32wb55rg", "time-driver-any", "memory-x", "exti"] }
|
||||
|
||||
defmt = "0.3"
|
||||
defmt-rtt = "0.4"
|
||||
|
@ -1,35 +1,11 @@
|
||||
//! This build script copies the `memory.x` file from the crate root into
|
||||
//! a directory where the linker can always find it at build time.
|
||||
//! For many projects this is optional, as the linker always searches the
|
||||
//! project root directory -- wherever `Cargo.toml` is. However, if you
|
||||
//! are using a workspace or have a more complicated build setup, this
|
||||
//! build script becomes required. Additionally, by requesting that
|
||||
//! Cargo re-run the build script whenever `memory.x` is changed,
|
||||
//! updating `memory.x` ensures a rebuild of the application with the
|
||||
//! new memory settings.
|
||||
|
||||
use std::env;
|
||||
use std::fs::File;
|
||||
use std::io::Write;
|
||||
use std::path::PathBuf;
|
||||
|
||||
fn main() {
|
||||
// Put `memory.x` in our output directory and ensure it's
|
||||
// on the linker search path.
|
||||
let out = &PathBuf::from(env::var_os("OUT_DIR").unwrap());
|
||||
File::create(out.join("memory.x"))
|
||||
.unwrap()
|
||||
.write_all(include_bytes!("memory.x"))
|
||||
.unwrap();
|
||||
println!("cargo:rustc-link-search={}", out.display());
|
||||
|
||||
// By default, Cargo will re-run a build script whenever
|
||||
// any file in the project changes. By specifying `memory.x`
|
||||
// here, we ensure the build script is only re-run when
|
||||
// `memory.x` is changed.
|
||||
println!("cargo:rerun-if-changed=memory.x");
|
||||
use std::error::Error;
|
||||
|
||||
fn main() -> Result<(), Box<dyn Error>> {
|
||||
println!("cargo:rustc-link-arg-bins=--nmagic");
|
||||
println!("cargo:rustc-link-arg-bins=-Tlink.x");
|
||||
println!("cargo:rerun-if-changed=link.x");
|
||||
println!("cargo:rustc-link-arg-bins=-Ttl_mbox.x");
|
||||
println!("cargo:rustc-link-arg-bins=-Tdefmt.x");
|
||||
|
||||
Ok(())
|
||||
}
|
||||
|
@ -1,35 +0,0 @@
|
||||
/*
|
||||
The size of this file must be exactly the same as in other memory_xx.x files.
|
||||
Memory size for STM32WB55xC with 256K FLASH
|
||||
*/
|
||||
|
||||
MEMORY
|
||||
{
|
||||
FLASH (rx) : ORIGIN = 0x08000000, LENGTH = 256K
|
||||
RAM (xrw) : ORIGIN = 0x20000000, LENGTH = 192K
|
||||
RAM_SHARED (xrw) : ORIGIN = 0x20030000, LENGTH = 10K
|
||||
}
|
||||
|
||||
/*
|
||||
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
|
||||
}
|
@ -4,8 +4,7 @@
|
||||
|
||||
use defmt::*;
|
||||
use embassy_executor::Spawner;
|
||||
use embassy_stm32::ipcc::{Config, Ipcc};
|
||||
use embassy_stm32::tl_mbox::TlMbox;
|
||||
use embassy_stm32::tl_mbox::{Config, TlMbox};
|
||||
use embassy_stm32::{bind_interrupts, tl_mbox};
|
||||
use embassy_time::{Duration, Timer};
|
||||
use {defmt_rtt as _, panic_probe as _};
|
||||
@ -45,14 +44,12 @@ async fn main(_spawner: Spawner) {
|
||||
info!("Hello World!");
|
||||
|
||||
let config = Config::default();
|
||||
let mut ipcc = Ipcc::new(p.IPCC, config);
|
||||
|
||||
let mbox = TlMbox::init(&mut ipcc, Irqs);
|
||||
let mbox = TlMbox::new(p.IPCC, Irqs, config);
|
||||
|
||||
loop {
|
||||
let wireless_fw_info = mbox.wireless_fw_info();
|
||||
match wireless_fw_info {
|
||||
None => error!("not yet initialized"),
|
||||
None => info!("not yet initialized"),
|
||||
Some(fw_info) => {
|
||||
let version_major = fw_info.version_major();
|
||||
let version_minor = fw_info.version_minor();
|
||||
@ -70,6 +67,9 @@ async fn main(_spawner: Spawner) {
|
||||
}
|
||||
}
|
||||
|
||||
Timer::after(Duration::from_millis(500)).await;
|
||||
Timer::after(Duration::from_millis(50)).await;
|
||||
}
|
||||
|
||||
info!("Test OK");
|
||||
cortex_m::asm::bkpt();
|
||||
}
|
||||
|
@ -4,8 +4,7 @@
|
||||
|
||||
use defmt::*;
|
||||
use embassy_executor::Spawner;
|
||||
use embassy_stm32::ipcc::{Config, Ipcc};
|
||||
use embassy_stm32::tl_mbox::TlMbox;
|
||||
use embassy_stm32::tl_mbox::{Config, TlMbox};
|
||||
use embassy_stm32::{bind_interrupts, tl_mbox};
|
||||
use {defmt_rtt as _, panic_probe as _};
|
||||
|
||||
@ -44,12 +43,7 @@ async fn main(_spawner: Spawner) {
|
||||
info!("Hello World!");
|
||||
|
||||
let config = Config::default();
|
||||
let mut ipcc = Ipcc::new(p.IPCC, config);
|
||||
|
||||
let mbox = TlMbox::init(&mut ipcc, Irqs);
|
||||
|
||||
// initialize ble stack, does not return a response
|
||||
mbox.shci_ble_init(&mut ipcc, Default::default());
|
||||
let mbox = TlMbox::new(p.IPCC, Irqs, config);
|
||||
|
||||
info!("waiting for coprocessor to boot");
|
||||
let event_box = mbox.read().await;
|
||||
@ -74,10 +68,11 @@ async fn main(_spawner: Spawner) {
|
||||
);
|
||||
}
|
||||
|
||||
mbox.shci_ble_init(&mut ipcc, Default::default());
|
||||
// initialize ble stack, does not return a response
|
||||
mbox.shci_ble_init(Default::default());
|
||||
|
||||
info!("resetting BLE");
|
||||
mbox.send_ble_cmd(&mut ipcc, &[0x01, 0x03, 0x0c, 0x00, 0x00]);
|
||||
mbox.send_ble_cmd(&[0x01, 0x03, 0x0c, 0x00, 0x00]);
|
||||
|
||||
let event_box = mbox.read().await;
|
||||
|
||||
@ -92,8 +87,12 @@ async fn main(_spawner: Spawner) {
|
||||
|
||||
info!(
|
||||
"==> kind: {:#04x}, code: {:#04x}, payload_length: {}, payload: {:#04x}",
|
||||
kind, code, payload_len, payload
|
||||
kind,
|
||||
code,
|
||||
payload_len,
|
||||
payload[3..]
|
||||
);
|
||||
|
||||
loop {}
|
||||
info!("Test OK");
|
||||
cortex_m::asm::bkpt();
|
||||
}
|
||||
|
Reference in New Issue
Block a user