build(f722): centralize linker layout

This commit is contained in:
Onur Özkan committed 2026-08-22 18:38:06 +03:00
1 parent 387fdaad23
commit ceb2134392
8 files changed
+358 -77

No files matched your search

+6 -4
View File
@@ -1,9 +1,11 @@
fn main() {
println!("cargo:rerun-if-changed=build.rs");
println!("cargo:rerun-if-changed=memory.x");
println!("cargo:rustc-link-arg=-Tlink.x");
let layout = std::path::Path::new(&std::env::var("CARGO_MANIFEST_DIR").unwrap())
.join("../../platforms/stm32f7/link/f722");
println!(
"cargo:rustc-link-search={}",
std::env::var("CARGO_MANIFEST_DIR").expect("Cargo must set CARGO_MANIFEST_DIR")
"cargo:rerun-if-changed={}",
layout.join("memory.x").display()
);
println!("cargo:rustc-link-arg=-Tlink.x");
println!("cargo:rustc-link-search={}", layout.display());
}
@@ -1,19 +0,0 @@
MEMORY
{
FLASH : ORIGIN = 0x08000000, LENGTH = 512K
/*
* STM32F722 RAM totals 256 KiB:
* - DTCM: 64 KiB at 0x2000_0000
* - SRAM1: 176 KiB at 0x2001_0000
* - SRAM2: 16 KiB at 0x2003_C000
*
* SRAM1 and SRAM2 are contiguous and are both accessible by DMA1 and DMA2.
* They form one 192 KiB default RAM region from 0x2001_0000 through
* 0x2003_FFFF. DTCM is intentionally kept separate for a future explicit
* placement policy rather than mixing CPU-critical and general allocations.
*
* TODO: Utilize DTCM.
*
*/
RAM : ORIGIN = 0x20010000, LENGTH = 192K
}