diff options
| -rw-r--r-- | Cargo.lock | 83 | ||||
| -rw-r--r-- | README.md | 20 | ||||
| -rw-r--r-- | imxrt1010evk/Cargo.toml | 7 | ||||
| -rw-r--r-- | imxrt1010evk/build.rs | 8 | ||||
| -rw-r--r-- | imxrt1010evk/examples/smoke.rs | 36 | ||||
| -rw-r--r-- | imxrt1040evk/Cargo.toml | 7 | ||||
| -rw-r--r-- | imxrt1040evk/build.rs | 8 | ||||
| -rw-r--r-- | imxrt1040evk/examples/smoke.rs | 36 | ||||
| -rw-r--r-- | imxrt1170evk/Cargo.toml | 7 | ||||
| -rw-r--r-- | imxrt1170evk/build.rs | 8 | ||||
| -rw-r--r-- | imxrt1170evk/examples/smoke.rs | 37 |
11 files changed, 26 insertions, 231 deletions
@@ -24,12 +24,6 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a" [[package]] -name = "cfg-if" -version = "1.0.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9330f8b2ff13f34540b44e946ef35111825727b38d33286ef986142615121801" - -[[package]] name = "cortex-m" version = "0.7.7" source = "registry+https://github.com/rust-lang/crates.io-index" @@ -43,26 +37,6 @@ dependencies = [ ] [[package]] -name = "cortex-m-rt" -version = "0.7.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ee84e813d593101b1723e13ec38b6ab6abbdbaaa4546553f5395ed274079ddb1" -dependencies = [ - "cortex-m-rt-macros", -] - -[[package]] -name = "cortex-m-rt-macros" -version = "0.7.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f0f6f3e36f203cfedbc78b357fb28730aa2c6dc1ab060ee5c2405e843988d3c7" -dependencies = [ - "proc-macro2", - "quote", - "syn 1.0.109", -] - -[[package]] name = "critical-section" version = "1.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" @@ -88,7 +62,7 @@ dependencies = [ "proc-macro-error2", "proc-macro2", "quote", - "syn 2.0.111", + "syn", ] [[package]] @@ -257,15 +231,6 @@ dependencies = [ ] [[package]] -name = "imxrt-rt" -version = "0.2.0" -source = "git+https://github.com/imxrt-rs/imxrt-rt#eb47674359ea27cc5e7824a234067491ff01ab13" -dependencies = [ - "cfg-if", - "cortex-m-rt", -] - -[[package]] name = "imxrt1010" version = "0.1.0" source = "git+https://git.mciantyre.dev/imxrt-drivers#55c6e1116800fd27f1ca447040beae6dad14e960" @@ -296,10 +261,8 @@ name = "imxrt1010evk" version = "0.1.0" dependencies = [ "cortex-m", - "defmt", "defmt-rtt", "flash-algorithm", - "imxrt-rt", "imxrt1010-flash-algos", "panic-probe", ] @@ -337,10 +300,8 @@ name = "imxrt1040evk" version = "0.1.0" dependencies = [ "cortex-m", - "defmt", "defmt-rtt", "flash-algorithm", - "imxrt-rt", "imxrt1040-flash-algos", "panic-probe", ] @@ -416,10 +377,8 @@ name = "imxrt1170evk" version = "0.1.0" dependencies = [ "cortex-m", - "defmt", "defmt-rtt", "flash-algorithm", - "imxrt-rt", "imxrt1170-flash-algos", "panic-probe", ] @@ -468,23 +427,23 @@ dependencies = [ "proc-macro-error-attr2", "proc-macro2", "quote", - "syn 2.0.111", + "syn", ] [[package]] name = "proc-macro2" -version = "1.0.103" +version = "1.0.106" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5ee95bc4ef87b8d5ba32e8b7714ccc834865276eab0aed5c9958d00ec45f49e8" +checksum = "8fd00f0bb2e90d81d1044c2b32617f68fcb9fa3bb7640c23e9c748e53fb30934" dependencies = [ "unicode-ident", ] [[package]] name = "quote" -version = "1.0.42" +version = "1.0.44" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a338cc41d27e6cc6dce6cefc13a0729dfbb81c262b1f519331575dd80ef3067f" +checksum = "21b2ebcf727b7760c461f091f9f0f539b77b8e87f2fd88131e7f1b433b3cece4" dependencies = [ "proc-macro2", ] @@ -520,20 +479,9 @@ checksum = "388a1df253eca08550bef6c72392cfe7c30914bf41df5269b68cbd6ff8f570a3" [[package]] name = "syn" -version = "1.0.109" +version = "2.0.114" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "72b64191b275b66ffe2469e8af2c1cfe3bafa67b529ead792a6d0160888b4237" -dependencies = [ - "proc-macro2", - "quote", - "unicode-ident", -] - -[[package]] -name = "syn" -version = "2.0.111" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "390cc9a294ab71bdb1aa2e99d13be9c753cd2d7bd6560c77118597410c4d2e87" +checksum = "d4d107df263a3013ef9b1879b0df87d706ff80f65a86ea879bd9c31f9b307c2a" dependencies = [ "proc-macro2", "quote", @@ -542,22 +490,22 @@ dependencies = [ [[package]] name = "thiserror" -version = "2.0.17" +version = "2.0.18" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f63587ca0f12b72a0600bcba1d40081f830876000bb46dd2337a3051618f4fc8" +checksum = "4288b5bcbc7920c07a1149a35cf9590a2aa808e0bc1eafaade0b80947865fbc4" dependencies = [ "thiserror-impl", ] [[package]] name = "thiserror-impl" -version = "2.0.17" +version = "2.0.18" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3ff15c8ecd7de3849db632e14d18d2571fa09dfc5ed93479bc4485c7a517c913" +checksum = "ebc4ee7f67670e9b64d05fa4253e753e016c6c95ff35b89b7941d6b856dec1d5" dependencies = [ "proc-macro2", "quote", - "syn 2.0.111", + "syn", ] [[package]] @@ -586,3 +534,8 @@ checksum = "de437e2a6208b014ab52972a27e59b33fa2920d3e00fe05026167a1c509d19cc" dependencies = [ "vcell", ] + +[[patch.unused]] +name = "imxrt-rt" +version = "0.2.0" +source = "git+https://github.com/imxrt-rs/imxrt-rt#eb47674359ea27cc5e7824a234067491ff01ab13" @@ -30,27 +30,23 @@ Before attempting to generate the flash programming algorithms for [probe-rs], install the `target-gen` tool. It's available in the probe-rs repository. [My fork][probe-rs-fork] has some `target-gen` patches that might be useful. -Here's how to generate the algorithm, represented as YAML, for the 1010EVK: +Use `target-gen test` to test each algorithm on its EVK. For convenience, +there are dedicated Cargo configurations you can use. For example, to test the +algorithm on a 1010EVK, run ``` -cargo --config .cargo/flash_algo.toml run --release --package=imxrt1010evk +cargo --config .cargo/1010evk.toml run --release --package=imxrt1010evk ``` -To generate the algorithm for a different EVK, change the `--package` selection. - -Some of the EVKs have a smoke test that checks read, erase, and write with its -flash part. Keep in mind that this will manipulate your board's flash, and it -might change something you care about! +To test on a different EVK, change the Cargo configuration and the package. -To run the smoke test on the 1010EVK, power on your EVK and connect it to your -host. Then, submit +Here's how to generate the algorithm, represented as YAML, for the 1010EVK: ``` -cargo --config .cargo/imxrt1010.toml run --release --package=imxrt1010evk --example=smoke +cargo --config .cargo/flash_algo.toml run --release --package=imxrt1010evk ``` -to flash the example with probe-rs. If you change the EVK, change the Cargo -configuration for your MCU as well as your package. +To generate the algorithm for a different EVK, change the `--package` selection. [fpa]: https://open-cmsis-pack.github.io/Open-CMSIS-Pack-Spec/main/html/flashAlgorithm.html [probe-rs]: https://probe.rs diff --git a/imxrt1010evk/Cargo.toml b/imxrt1010evk/Cargo.toml index 455d16d..169427e 100644 --- a/imxrt1010evk/Cargo.toml +++ b/imxrt1010evk/Cargo.toml @@ -11,10 +11,3 @@ defmt-rtt = { workspace = true } imxrt1010-flash-algos = { workspace = true } flash-algorithm = { workspace = true } panic-probe = { workspace = true } - -[build-dependencies] -imxrt-rt = { workspace = true, features = ["device"] } - -[dev-dependencies] -defmt = { workspace = true } -imxrt-rt = { workspace = true, features = ["device"] } diff --git a/imxrt1010evk/build.rs b/imxrt1010evk/build.rs deleted file mode 100644 index 2c747cc..0000000 --- a/imxrt1010evk/build.rs +++ /dev/null @@ -1,8 +0,0 @@ -use imxrt_rt::Family; - -fn main() { - imxrt_rt::RuntimeBuilder::from_ram(Family::Imxrt1010) - .device_script_name("imxrt1010.x") - .build() - .unwrap(); -} diff --git a/imxrt1010evk/examples/smoke.rs b/imxrt1010evk/examples/smoke.rs deleted file mode 100644 index 820d610..0000000 --- a/imxrt1010evk/examples/smoke.rs +++ /dev/null @@ -1,36 +0,0 @@ -#![no_main] -#![no_std] - -use defmt_rtt as _; -use imxrt1010evk::{self, Algorithm}; -use panic_probe as _; - -const LAST_SECTOR: usize = Algorithm::flash_size_bytes() - Algorithm::sector_size_bytes(); - -#[imxrt_rt::entry] -fn main() -> ! { - for _ in 0..5 { - let mut at25sf128 = Algorithm::initialize(); - - let mut sector = [0_u8; Algorithm::sector_size_bytes()]; - at25sf128.flash_read(0x400, &mut sector[..4]); - let tag = u32::from_le_bytes(sector[..4].try_into().unwrap()); - defmt::assert!(0x42464346 == tag, "{=u32:#010X}", tag); - - at25sf128.flash_erase_sector(LAST_SECTOR + 256); - - sector.fill(0); - at25sf128.flash_write(LAST_SECTOR, §or); - - sector.fill(u8::MAX); - at25sf128.flash_read(LAST_SECTOR, &mut sector); - defmt::assert!(sector.iter().all(|byte| *byte == 0)); - - at25sf128.flash_erase_sector(LAST_SECTOR + 123); - - at25sf128.flash_read(LAST_SECTOR, &mut sector); - defmt::assert!(sector.iter().all(|byte| *byte == u8::MAX)); - } - defmt::println!("Pass"); - loop {} -} diff --git a/imxrt1040evk/Cargo.toml b/imxrt1040evk/Cargo.toml index 3df3f8a..5f2348b 100644 --- a/imxrt1040evk/Cargo.toml +++ b/imxrt1040evk/Cargo.toml @@ -11,10 +11,3 @@ defmt-rtt = { workspace = true } imxrt1040-flash-algos = { workspace = true } flash-algorithm = { workspace = true } panic-probe = { workspace = true } - -[build-dependencies] -imxrt-rt = { workspace = true, features = ["device"] } - -[dev-dependencies] -defmt = { workspace = true } -imxrt-rt = { workspace = true, features = ["device"] } diff --git a/imxrt1040evk/build.rs b/imxrt1040evk/build.rs deleted file mode 100644 index a02ccc0..0000000 --- a/imxrt1040evk/build.rs +++ /dev/null @@ -1,8 +0,0 @@ -use imxrt_rt::Family; - -fn main() { - imxrt_rt::RuntimeBuilder::from_ram(Family::Imxrt1040) - .device_script_name("imxrt1040.x") - .build() - .unwrap(); -} diff --git a/imxrt1040evk/examples/smoke.rs b/imxrt1040evk/examples/smoke.rs deleted file mode 100644 index 3730125..0000000 --- a/imxrt1040evk/examples/smoke.rs +++ /dev/null @@ -1,36 +0,0 @@ -#![no_main] -#![no_std] - -use defmt_rtt as _; -use imxrt1040evk::{self, Algorithm}; -use panic_probe as _; - -const LAST_SECTOR: usize = Algorithm::flash_size_bytes() - Algorithm::sector_size_bytes(); - -#[imxrt_rt::entry] -fn main() -> ! { - for _ in 0..5 { - let mut w25q64 = Algorithm::initialize(); - - let mut sector = [0_u8; Algorithm::sector_size_bytes()]; - w25q64.flash_read(0, &mut sector[..4]); - let tag = u32::from_le_bytes(sector[..4].try_into().unwrap()); - defmt::assert!(0x42464346 == tag, "{=u32:#010X}", tag); - - w25q64.flash_erase_sector(LAST_SECTOR + 256); - - sector.fill(0); - w25q64.flash_write(LAST_SECTOR, §or); - - sector.fill(u8::MAX); - w25q64.flash_read(LAST_SECTOR, &mut sector); - defmt::assert!(sector.iter().all(|byte| *byte == 0)); - - w25q64.flash_erase_sector(LAST_SECTOR + 123); - - w25q64.flash_read(LAST_SECTOR, &mut sector); - defmt::assert!(sector.iter().all(|byte| *byte == u8::MAX)); - } - defmt::println!("Pass"); - loop {} -} diff --git a/imxrt1170evk/Cargo.toml b/imxrt1170evk/Cargo.toml index 2e65e13..02d11cc 100644 --- a/imxrt1170evk/Cargo.toml +++ b/imxrt1170evk/Cargo.toml @@ -11,10 +11,3 @@ defmt-rtt = { workspace = true } imxrt1170-flash-algos = { workspace = true } flash-algorithm = { workspace = true } panic-probe = { workspace = true } - -[build-dependencies] -imxrt-rt = { workspace = true, features = ["device"] } - -[dev-dependencies] -defmt = { workspace = true } -imxrt-rt = { workspace = true, features = ["device"] } diff --git a/imxrt1170evk/build.rs b/imxrt1170evk/build.rs deleted file mode 100644 index c4379fc..0000000 --- a/imxrt1170evk/build.rs +++ /dev/null @@ -1,8 +0,0 @@ -use imxrt_rt::Family; - -fn main() { - imxrt_rt::RuntimeBuilder::from_ram(Family::Imxrt1170) - .device_script_name("imxrt1170.x") - .build() - .unwrap(); -} diff --git a/imxrt1170evk/examples/smoke.rs b/imxrt1170evk/examples/smoke.rs deleted file mode 100644 index 7a4f1c1..0000000 --- a/imxrt1170evk/examples/smoke.rs +++ /dev/null @@ -1,37 +0,0 @@ -#![no_main] -#![no_std] - -use defmt_rtt as _; -use imxrt1170evk::{self, Algorithm}; -use panic_probe as _; - -const LAST_SECTOR: usize = (128 * 1024 * 1024 / 8) - 4096; - -#[imxrt_rt::entry] -fn main() -> ! { - for _ in 0..5 { - let mut is25wp = Algorithm::initialize(); - - let mut sector = [0_u8; 4096]; - is25wp.flash_read(0x400, &mut sector[..4]); - if 0x42464346 != u32::from_le_bytes(sector[..4].try_into().unwrap()) { - defmt::warn!("No FCB found."); - } - - is25wp.flash_erase_sector(LAST_SECTOR + 256); - - sector.fill(0); - is25wp.flash_write(LAST_SECTOR, §or); - - sector.fill(u8::MAX); - is25wp.flash_read(LAST_SECTOR, &mut sector); - defmt::assert!(sector.iter().all(|byte| *byte == 0)); - - is25wp.flash_erase_sector(LAST_SECTOR + 123); - - is25wp.flash_read(LAST_SECTOR, &mut sector); - defmt::assert!(sector.iter().all(|byte| *byte == u8::MAX)); - } - defmt::println!("Pass"); - loop {} -} |
