From e7437560c23f15611b3404a09ae1ddc489099a4a Mon Sep 17 00:00:00 2001 From: Guangzong Chen Date: Tue, 2 Apr 2024 19:10:58 -0400 Subject: [PATCH] update build --- Cargo.lock | 22 +++++++++++----------- Cargo.toml | 2 ++ build.rs | 35 ++++++++++++++++++----------------- memory.x | 6 ++++++ 4 files changed, 37 insertions(+), 28 deletions(-) create mode 100644 memory.x diff --git a/Cargo.lock b/Cargo.lock index 2ad66c3..4cfa37e 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -95,7 +95,7 @@ dependencies = [ "proc-macro2", "quote", "strsim", - "syn 2.0.53", + "syn 2.0.57", ] [[package]] @@ -106,7 +106,7 @@ checksum = "a668eda54683121533a393014d8692171709ff57a7d61f187b6e782719f8933f" dependencies = [ "darling_core", "quote", - "syn 2.0.53", + "syn 2.0.57", ] [[package]] @@ -139,7 +139,7 @@ dependencies = [ "proc-macro-error", "proc-macro2", "quote", - "syn 2.0.53", + "syn 2.0.57", ] [[package]] @@ -194,7 +194,7 @@ dependencies = [ "darling", "proc-macro2", "quote", - "syn 2.0.53", + "syn 2.0.57", ] [[package]] @@ -397,9 +397,9 @@ checksum = "8d5439c4ad607c3c23abf66de8c8bf57ba8adcd1f129e699851a6e43935d339d" [[package]] name = "pin-project-lite" -version = "0.2.13" +version = "0.2.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8afb450f006bf6385ca15ef45d71d2288452bc3683ce2e2cacc0d18e4be60b58" +checksum = "bda66fc9667c18cb2758a2ac84d1167245054bcf85d5d1aaa6923f45801bdd02" [[package]] name = "pin-utils" @@ -502,7 +502,7 @@ checksum = "7eb0b34b42edc17f6b7cac84a52a1c5f0e1bb2227e997ca9011ea3dd34e8610b" dependencies = [ "proc-macro2", "quote", - "syn 2.0.53", + "syn 2.0.57", ] [[package]] @@ -549,9 +549,9 @@ dependencies = [ [[package]] name = "syn" -version = "2.0.53" +version = "2.0.57" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7383cd0e49fff4b6b90ca5670bfd3e9d6a733b3f90c686605aa7eec8c4996032" +checksum = "11a6ae1e52eb25aab8f3fb9fca13be982a373b8f1157ca14b897a825ba4a2d35" dependencies = [ "proc-macro2", "quote", @@ -575,13 +575,13 @@ checksum = "c61f3ba182994efc43764a46c018c347bc492c79f024e705f46567b418f6d4f7" dependencies = [ "proc-macro2", "quote", - "syn 2.0.53", + "syn 2.0.57", ] [[package]] name = "u5-lib" version = "0.1.0" -source = "git+ssh://gitea@git.ggeta.com:2002/guangzong/u5_new.git?branch=dev#85f674f6dbd42e04f34f4f51bbf557a35d87c183" +source = "git+ssh://gitea@git.ggeta.com:2002/guangzong/u5_new.git?branch=dev#bc8db5f8e5b3119434beec539902ad507bfb61b6" dependencies = [ "cortex-m", "cortex-m-rt", diff --git a/Cargo.toml b/Cargo.toml index c9bf518..a597c16 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -20,10 +20,12 @@ cortex-m = { version = "0.7.7", features = [ ]} u5-lib = { git = "ssh://gitea@git.ggeta.com:2002/guangzong/u5_new.git",features = [ "stm32u5a5qj", +# "memory-x", # "stm32u575zi" ], default-features = false, branch = "dev" } eb_cmds = { git = "ssh://gitea@git.ggeta.com:2002/guangzong/eb_cmds.git"} critical-section = "1.1.2" + defmt = "0.3.6" defmt-rtt = { version = "0.4.0" } defmt-itm = { version = "0.3.0" } diff --git a/build.rs b/build.rs index db86e62..047f5cb 100644 --- a/build.rs +++ b/build.rs @@ -1,20 +1,21 @@ 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"); + println!("cargo:rustc-link-arg-bins=-Tmemory.x"); + // println!("cargo:rustc-link-arg-bins=--nmagic"); + // println!("cargo:rustc-link-arg-bins=-Tlink.x"); + // println!("cargo:rustc-link-arg-bins=-Tdefmt.x"); // enable cfg sdmmc - println!("cargo:rustc-cfg=sdmmc"); - for (key, _value) in std::env::vars() { - // Check if the current environment variable is a feature that starts with "STM32U5" - if key.starts_with("CARGO_FEATURE_STM32U575") { - // If found, print the cargo directive to set the `stm32u5` cfg flag - println!("cargo:rustc-cfg=stm32u575"); - break; // Exit the loop once the first matching feature is found - } - if key.starts_with("CARGO_FEATURE_STM32U5A5") { - // If found, print the cargo directive to set the `stm32u5` cfg flag - println!("cargo:rustc-cfg=stm32u5a5"); - break; // Exit the loop once the first matching feature is found - } - } + // println!("cargo:rustc-cfg=sdmmc"); + // for (key, _value) in std::env::vars() { + // // Check if the current environment variable is a feature that starts with "STM32U5" + // if key.starts_with("CARGO_FEATURE_STM32U575") { + // // If found, print the cargo directive to set the `stm32u5` cfg flag + // println!("cargo:rustc-cfg=stm32u575"); + // break; // Exit the loop once the first matching feature is found + // } + // if key.starts_with("CARGO_FEATURE_STM32U5A5") { + // // If found, print the cargo directive to set the `stm32u5` cfg flag + // println!("cargo:rustc-cfg=stm32u5a5"); + // break; // Exit the loop once the first matching feature is found + // } + // } } diff --git a/memory.x b/memory.x new file mode 100644 index 0000000..e30b286 --- /dev/null +++ b/memory.x @@ -0,0 +1,6 @@ +MEMORY +{ + FLASH : ORIGIN = 0x08000000, LENGTH = 4096K /* BANK_1 */ + RAM : ORIGIN = 0x20000000, LENGTH = 2514K + OTP : ORIGIN = 0x0bfa0000, LENGTH = 512 +} \ No newline at end of file