diff options
| author | James Munns <[email protected]> | 2025-12-04 18:46:39 +0100 |
|---|---|---|
| committer | James Munns <[email protected]> | 2025-12-04 18:47:31 +0100 |
| commit | c3bc8fe8c0db112e5f2f66580104fc49b02890d2 (patch) | |
| tree | eea7adc15021697ea980289edd6235daaa12d6ee /examples/mcxa/build.rs | |
| parent | 5182b2ed54f991b40b45fd2de75f597358ff9c3e (diff) | |
| parent | 277ab0d2e8714edf37a0ee84cda1059d9944ecef (diff) | |
Import embassy-mcxa repo
Merge remote-tracking branch 'james-e-mcxa/james/upstream' into james/upstream-mcxa
Diffstat (limited to 'examples/mcxa/build.rs')
| -rw-r--r-- | examples/mcxa/build.rs | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/examples/mcxa/build.rs b/examples/mcxa/build.rs new file mode 100644 index 000000000..f076bba9f --- /dev/null +++ b/examples/mcxa/build.rs | |||
| @@ -0,0 +1,20 @@ | |||
| 1 | use std::env; | ||
| 2 | use std::fs::File; | ||
| 3 | use std::io::Write; | ||
| 4 | use std::path::PathBuf; | ||
| 5 | |||
| 6 | fn main() { | ||
| 7 | let out = &PathBuf::from(env::var_os("OUT_DIR").unwrap()); | ||
| 8 | |||
| 9 | // Generate memory.x - put "FLASH" at start of RAM, RAM after "FLASH" | ||
| 10 | // cortex-m-rt expects FLASH for code, RAM for data/bss/stack | ||
| 11 | // Both are in RAM, but separated to satisfy cortex-m-rt's expectations | ||
| 12 | // MCXA256 has 128KB RAM total | ||
| 13 | File::create(out.join("memory.x")) | ||
| 14 | .unwrap() | ||
| 15 | .write_all(include_bytes!("memory.x")) | ||
| 16 | .unwrap(); | ||
| 17 | |||
| 18 | println!("cargo:rustc-link-search={}", out.display()); | ||
| 19 | println!("cargo:rerun-if-changed=memory.x"); | ||
| 20 | } | ||
