remove memory.x files for other stm32 examples
This commit is contained in:
@ -6,7 +6,7 @@ license = "MIT OR Apache-2.0"
|
||||
|
||||
[dependencies]
|
||||
# Change stm32f767zi to your chip name, if necessary.
|
||||
embassy-stm32 = { version = "0.1.0", path = "../../embassy-stm32", features = ["nightly", "defmt", "stm32f767zi", "unstable-pac", "time-driver-any", "exti"] }
|
||||
embassy-stm32 = { version = "0.1.0", path = "../../embassy-stm32", features = ["nightly", "defmt", "stm32f767zi", "memory-x", "unstable-pac", "time-driver-any", "exti"] }
|
||||
embassy-sync = { version = "0.2.0", path = "../../embassy-sync", features = ["defmt"] }
|
||||
embassy-executor = { version = "0.2.0", path = "../../embassy-executor", features = ["nightly", "arch-cortex-m", "executor-thread", "defmt", "integrated-timers"] }
|
||||
embassy-time = { version = "0.1.2", path = "../../embassy-time", features = ["defmt", "defmt-timestamp-uptime", "tick-hz-32_768"] }
|
||||
|
@ -1,43 +1,5 @@
|
||||
//! adapted from https://github.com/stm32-rs/stm32f7xx-hal/blob/master/build.rs
|
||||
use std::fs::File;
|
||||
use std::io::prelude::*;
|
||||
use std::path::PathBuf;
|
||||
use std::{env, io};
|
||||
|
||||
#[derive(Debug)]
|
||||
enum Error {
|
||||
Env(env::VarError),
|
||||
Io(io::Error),
|
||||
}
|
||||
|
||||
impl From<env::VarError> for Error {
|
||||
fn from(error: env::VarError) -> Self {
|
||||
Self::Env(error)
|
||||
}
|
||||
}
|
||||
|
||||
impl From<io::Error> for Error {
|
||||
fn from(error: io::Error) -> Self {
|
||||
Self::Io(error)
|
||||
}
|
||||
}
|
||||
|
||||
fn main() -> Result<(), Error> {
|
||||
println!("cargo:rerun-if-changed=build.rs");
|
||||
println!("cargo:rerun-if-changed=memory.x");
|
||||
|
||||
let out_dir = env::var("OUT_DIR")?;
|
||||
let out_dir = PathBuf::from(out_dir);
|
||||
|
||||
let memory_x = include_bytes!("memory.x").as_ref();
|
||||
File::create(out_dir.join("memory.x"))?.write_all(memory_x)?;
|
||||
|
||||
// Tell Cargo where to find the file.
|
||||
println!("cargo:rustc-link-search={}", out_dir.display());
|
||||
|
||||
fn main() {
|
||||
println!("cargo:rustc-link-arg-bins=--nmagic");
|
||||
println!("cargo:rustc-link-arg-bins=-Tlink.x");
|
||||
println!("cargo:rustc-link-arg-bins=-Tdefmt.x");
|
||||
|
||||
Ok(())
|
||||
}
|
||||
|
@ -1,12 +0,0 @@
|
||||
/* For STM32F765,767,768,769,777,778,779 devices */
|
||||
MEMORY
|
||||
{
|
||||
/* NOTE K = KiBi = 1024 bytes */
|
||||
FLASH : ORIGIN = 0x08000000, LENGTH = 2M
|
||||
RAM : ORIGIN = 0x20000000, LENGTH = 368K + 16K
|
||||
}
|
||||
|
||||
/* This is where the call stack will be allocated. */
|
||||
/* The stack is of the full descending type. */
|
||||
/* NOTE Do NOT modify `_stack_start` unless you know what you are doing */
|
||||
_stack_start = ORIGIN(RAM) + LENGTH(RAM);
|
Reference in New Issue
Block a user