feat: add linker stuff properly but it does not work
This commit is contained in:
parent
d108d90cdb
commit
861ad38191
2 changed files with 19 additions and 0 deletions
|
@ -14,7 +14,9 @@ hal = { package = "stm32l0xx-hal", version = "0.10.0", features = [
|
|||
"stm32l0x3",
|
||||
"flash-192",
|
||||
"ram-20",
|
||||
"io-STM32L051",
|
||||
# "mcu-STM32L053R8", # does not exist in that crate
|
||||
"disable-linker-script",
|
||||
] }
|
||||
|
||||
[[bin]]
|
||||
|
|
17
build.rs
Executable file
17
build.rs
Executable file
|
@ -0,0 +1,17 @@
|
|||
use std::env;
|
||||
use std::fs::File;
|
||||
use std::io::Write;
|
||||
use std::path::PathBuf;
|
||||
|
||||
fn main() {
|
||||
// Put the linker script somewhere the linker can find it
|
||||
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());
|
||||
|
||||
println!("cargo:rerun-if-changed=build.rs");
|
||||
println!("cargo:rerun-if-changed=memory.x");
|
||||
}
|
Loading…
Add table
Reference in a new issue