mirror of
https://github.com/embassy-rs/embassy.git
synced 2024-11-22 06:42:32 +00:00
Merge pull request #2510 from tokenize-inc/ble_extended_scatter
STM32WB: Add scatter memory files for extended BLE stack
This commit is contained in:
commit
b7bc31e51a
@ -44,6 +44,8 @@ defmt = ["dep:defmt", "embassy-sync/defmt", "embassy-embedded-hal/defmt", "embas
|
||||
ble = ["dep:stm32wb-hci"]
|
||||
mac = ["dep:bitflags", "dep:embassy-net-driver" ]
|
||||
|
||||
extended = []
|
||||
|
||||
stm32wb10cc = [ "embassy-stm32/stm32wb10cc" ]
|
||||
stm32wb15cc = [ "embassy-stm32/stm32wb15cc" ]
|
||||
stm32wb30ce = [ "embassy-stm32/stm32wb30ce" ]
|
||||
|
@ -18,9 +18,22 @@ fn main() {
|
||||
// stm32wb tl_mbox link sections
|
||||
|
||||
let out_file = out_dir.join("tl_mbox.x").to_string_lossy().to_string();
|
||||
fs::write(out_file, fs::read_to_string("tl_mbox.x.in").unwrap()).unwrap();
|
||||
let in_file;
|
||||
if env::var_os("CARGO_FEATURE_EXTENDED").is_some() {
|
||||
if env::vars()
|
||||
.map(|(a, _)| a)
|
||||
.any(|x| x.starts_with("CARGO_FEATURE_STM32WB1"))
|
||||
{
|
||||
in_file = "tl_mbox_extended_wb1.x.in";
|
||||
} else {
|
||||
in_file = "tl_mbox_extended_wbx5.x.in";
|
||||
}
|
||||
} else {
|
||||
in_file = "tl_mbox.x.in";
|
||||
}
|
||||
fs::write(out_file, fs::read_to_string(in_file).unwrap()).unwrap();
|
||||
println!("cargo:rustc-link-search={}", out_dir.display());
|
||||
println!("cargo:rerun-if-changed=tl_mbox.x.in");
|
||||
println!("cargo:rerun-if-changed={}", in_file);
|
||||
}
|
||||
|
||||
enum GetOneError {
|
||||
|
16
embassy-stm32-wpan/tl_mbox_extended_wb1.x.in
Normal file
16
embassy-stm32-wpan/tl_mbox_extended_wb1.x.in
Normal file
@ -0,0 +1,16 @@
|
||||
MEMORY
|
||||
{
|
||||
RAM_SHARED (xrw) : ORIGIN = 0x20030000, LENGTH = 4K
|
||||
RAMB_SHARED (xrw) : ORIGIN = 0x20030028, LENGTH = 4K
|
||||
}
|
||||
|
||||
/*
|
||||
* Scatter the mailbox interface memory sections in shared memory
|
||||
*/
|
||||
SECTIONS
|
||||
{
|
||||
TL_REF_TABLE (NOLOAD) : { *(TL_REF_TABLE) } >RAM_SHARED
|
||||
|
||||
MB_MEM1 (NOLOAD) : { *(MB_MEM1) } >RAMB_SHARED
|
||||
MB_MEM2 (NOLOAD) : { _sMB_MEM2 = . ; *(MB_MEM2) ; _eMB_MEM2 = . ; } >RAMB_SHARED
|
||||
}
|
16
embassy-stm32-wpan/tl_mbox_extended_wbx5.x.in
Normal file
16
embassy-stm32-wpan/tl_mbox_extended_wbx5.x.in
Normal file
@ -0,0 +1,16 @@
|
||||
MEMORY
|
||||
{
|
||||
RAM_SHARED (xrw) : ORIGIN = 0x20030000, LENGTH = 2K
|
||||
RAMB_SHARED (xrw) : ORIGIN = 0x20038000, LENGTH = 10K
|
||||
}
|
||||
|
||||
/*
|
||||
* Scatter the mailbox interface memory sections in shared memory
|
||||
*/
|
||||
SECTIONS
|
||||
{
|
||||
TL_REF_TABLE (NOLOAD) : { *(TL_REF_TABLE) } >RAM_SHARED
|
||||
|
||||
MB_MEM1 (NOLOAD) : { *(MB_MEM1) } >RAMB_SHARED
|
||||
MB_MEM2 (NOLOAD) : { _sMB_MEM2 = . ; *(MB_MEM2) ; _eMB_MEM2 = . ; } >RAMB_SHARED
|
||||
}
|
Loading…
Reference in New Issue
Block a user