diff options
| author | 1-rafael-1 <[email protected]> | 2025-09-15 20:07:18 +0200 |
|---|---|---|
| committer | 1-rafael-1 <[email protected]> | 2025-09-15 20:07:18 +0200 |
| commit | 6bb3d2c0720fa082f27d3cdb70f516058497ec87 (patch) | |
| tree | 5a1e255cff999b00800f203b91a759c720c973e5 /examples/stm32f7 | |
| parent | eb685574601d98c44faed9a3534d056199b46e20 (diff) | |
| parent | 92a6fd2946f2cbb15359290f68aa360953da2ff7 (diff) | |
Merge branch 'main' into rp2040-rtc-alarm
Diffstat (limited to 'examples/stm32f7')
| -rw-r--r-- | examples/stm32f7/Cargo.toml | 25 | ||||
| -rw-r--r-- | examples/stm32f7/src/bin/can.rs | 2 | ||||
| -rw-r--r-- | examples/stm32f7/src/bin/cryp.rs | 4 | ||||
| -rw-r--r-- | examples/stm32f7/src/bin/eth.rs | 3 | ||||
| -rw-r--r-- | examples/stm32f7/src/bin/qspi.rs | 15 |
5 files changed, 28 insertions, 21 deletions
diff --git a/examples/stm32f7/Cargo.toml b/examples/stm32f7/Cargo.toml index 1a46931d9..5d7763334 100644 --- a/examples/stm32f7/Cargo.toml +++ b/examples/stm32f7/Cargo.toml | |||
| @@ -3,28 +3,28 @@ edition = "2021" | |||
| 3 | name = "embassy-stm32f7-examples" | 3 | name = "embassy-stm32f7-examples" |
| 4 | version = "0.1.0" | 4 | version = "0.1.0" |
| 5 | license = "MIT OR Apache-2.0" | 5 | license = "MIT OR Apache-2.0" |
| 6 | publish = false | ||
| 6 | 7 | ||
| 7 | [dependencies] | 8 | [dependencies] |
| 8 | # Change stm32f777zi to your chip name, if necessary. | 9 | # Change stm32f777zi to your chip name, if necessary. |
| 9 | embassy-stm32 = { version = "0.2.0", path = "../../embassy-stm32", features = ["defmt", "stm32f777zi", "memory-x", "unstable-pac", "time-driver-any", "exti", "single-bank"] } | 10 | embassy-stm32 = { version = "0.4.0", path = "../../embassy-stm32", features = ["defmt", "stm32f777zi", "memory-x", "unstable-pac", "time-driver-any", "exti", "single-bank"] } |
| 10 | embassy-sync = { version = "0.6.2", path = "../../embassy-sync", features = ["defmt"] } | 11 | embassy-sync = { version = "0.7.2", path = "../../embassy-sync", features = ["defmt"] } |
| 11 | embassy-executor = { version = "0.7.0", path = "../../embassy-executor", features = ["arch-cortex-m", "executor-thread", "defmt"] } | 12 | embassy-executor = { version = "0.9.0", path = "../../embassy-executor", features = ["arch-cortex-m", "executor-thread", "defmt"] } |
| 12 | embassy-time = { version = "0.4.0", path = "../../embassy-time", features = ["defmt", "defmt-timestamp-uptime", "tick-hz-32_768"] } | 13 | embassy-time = { version = "0.5.0", path = "../../embassy-time", features = ["defmt", "defmt-timestamp-uptime", "tick-hz-32_768"] } |
| 13 | embassy-net = { version = "0.7.0", path = "../../embassy-net", features = ["defmt", "tcp", "dhcpv4", "medium-ethernet"] } | 14 | embassy-net = { version = "0.7.1", path = "../../embassy-net", features = ["defmt", "tcp", "dhcpv4", "medium-ethernet"] } |
| 14 | embedded-io-async = { version = "0.6.1" } | 15 | embedded-io-async = { version = "0.6.1" } |
| 15 | embassy-usb = { version = "0.4.0", path = "../../embassy-usb", features = ["defmt"] } | 16 | embassy-usb = { version = "0.5.0", path = "../../embassy-usb", features = ["defmt"] } |
| 16 | embassy-futures = { version = "0.1.0", path = "../../embassy-futures" } | 17 | embassy-futures = { version = "0.1.0", path = "../../embassy-futures" } |
| 17 | 18 | ||
| 18 | defmt = "0.3" | 19 | defmt = "1.0.1" |
| 19 | defmt-rtt = "0.4" | 20 | defmt-rtt = "1.0.0" |
| 20 | 21 | ||
| 21 | cortex-m = { version = "0.7.6", features = ["inline-asm", "critical-section-single-core"] } | 22 | cortex-m = { version = "0.7.6", features = ["inline-asm", "critical-section-single-core"] } |
| 22 | cortex-m-rt = "0.7.0" | 23 | cortex-m-rt = "0.7.0" |
| 23 | embedded-hal = "0.2.6" | 24 | embedded-hal = "0.2.6" |
| 24 | panic-probe = { version = "0.3", features = ["print-defmt"] } | 25 | panic-probe = { version = "1.0.0", features = ["print-defmt"] } |
| 25 | heapless = { version = "0.8", default-features = false } | 26 | heapless = { version = "0.8", default-features = false } |
| 26 | nb = "1.0.0" | 27 | nb = "1.0.0" |
| 27 | rand_core = "0.6.3" | ||
| 28 | critical-section = "1.1" | 28 | critical-section = "1.1" |
| 29 | embedded-storage = "0.3.1" | 29 | embedded-storage = "0.3.1" |
| 30 | static_cell = "2" | 30 | static_cell = "2" |
| @@ -34,3 +34,8 @@ aes-gcm = { version = "0.10.3", default-features = false, features = ["aes", "he | |||
| 34 | 34 | ||
| 35 | [profile.release] | 35 | [profile.release] |
| 36 | debug = 2 | 36 | debug = 2 |
| 37 | |||
| 38 | [package.metadata.embassy] | ||
| 39 | build = [ | ||
| 40 | { target = "thumbv7em-none-eabi", artifact-dir = "out/examples/stm32f7" } | ||
| 41 | ] | ||
diff --git a/examples/stm32f7/src/bin/can.rs b/examples/stm32f7/src/bin/can.rs index 58ba940a8..9a91ac814 100644 --- a/examples/stm32f7/src/bin/can.rs +++ b/examples/stm32f7/src/bin/can.rs | |||
| @@ -64,7 +64,7 @@ async fn main(spawner: Spawner) { | |||
| 64 | 64 | ||
| 65 | static CAN_TX: StaticCell<CanTx<'static>> = StaticCell::new(); | 65 | static CAN_TX: StaticCell<CanTx<'static>> = StaticCell::new(); |
| 66 | let tx = CAN_TX.init(tx); | 66 | let tx = CAN_TX.init(tx); |
| 67 | spawner.spawn(send_can_message(tx)).unwrap(); | 67 | spawner.spawn(send_can_message(tx).unwrap()); |
| 68 | 68 | ||
| 69 | loop { | 69 | loop { |
| 70 | let envelope = rx.read().await.unwrap(); | 70 | let envelope = rx.read().await.unwrap(); |
diff --git a/examples/stm32f7/src/bin/cryp.rs b/examples/stm32f7/src/bin/cryp.rs index 235853cb9..a31e9b4f2 100644 --- a/examples/stm32f7/src/bin/cryp.rs +++ b/examples/stm32f7/src/bin/cryp.rs | |||
| @@ -68,7 +68,9 @@ async fn main(_spawner: Spawner) -> ! { | |||
| 68 | ); | 68 | ); |
| 69 | 69 | ||
| 70 | // Decrypt in software using AES-GCM 128-bit | 70 | // Decrypt in software using AES-GCM 128-bit |
| 71 | let _ = cipher.decrypt_in_place(&iv.into(), aad.into(), &mut payload_vec); | 71 | cipher |
| 72 | .decrypt_in_place(&iv.into(), aad.into(), &mut payload_vec) | ||
| 73 | .unwrap(); | ||
| 72 | 74 | ||
| 73 | let sw_end_time = Instant::now(); | 75 | let sw_end_time = Instant::now(); |
| 74 | let sw_execution_time = sw_end_time - sw_start_time; | 76 | let sw_execution_time = sw_end_time - sw_start_time; |
diff --git a/examples/stm32f7/src/bin/eth.rs b/examples/stm32f7/src/bin/eth.rs index 17ab7fc00..b13b7bdda 100644 --- a/examples/stm32f7/src/bin/eth.rs +++ b/examples/stm32f7/src/bin/eth.rs | |||
| @@ -12,7 +12,6 @@ use embassy_stm32::time::Hertz; | |||
| 12 | use embassy_stm32::{bind_interrupts, eth, peripherals, rng, Config}; | 12 | use embassy_stm32::{bind_interrupts, eth, peripherals, rng, Config}; |
| 13 | use embassy_time::Timer; | 13 | use embassy_time::Timer; |
| 14 | use embedded_io_async::Write; | 14 | use embedded_io_async::Write; |
| 15 | use rand_core::RngCore; | ||
| 16 | use static_cell::StaticCell; | 15 | use static_cell::StaticCell; |
| 17 | use {defmt_rtt as _, panic_probe as _}; | 16 | use {defmt_rtt as _, panic_probe as _}; |
| 18 | 17 | ||
| @@ -92,7 +91,7 @@ async fn main(spawner: Spawner) -> ! { | |||
| 92 | let (stack, runner) = embassy_net::new(device, config, RESOURCES.init(StackResources::new()), seed); | 91 | let (stack, runner) = embassy_net::new(device, config, RESOURCES.init(StackResources::new()), seed); |
| 93 | 92 | ||
| 94 | // Launch network task | 93 | // Launch network task |
| 95 | unwrap!(spawner.spawn(net_task(runner))); | 94 | spawner.spawn(unwrap!(net_task(runner))); |
| 96 | 95 | ||
| 97 | // Ensure DHCP configuration is up before trying connect | 96 | // Ensure DHCP configuration is up before trying connect |
| 98 | stack.wait_config_up().await; | 97 | stack.wait_config_up().await; |
diff --git a/examples/stm32f7/src/bin/qspi.rs b/examples/stm32f7/src/bin/qspi.rs index bd3287964..80652b865 100644 --- a/examples/stm32f7/src/bin/qspi.rs +++ b/examples/stm32f7/src/bin/qspi.rs | |||
| @@ -273,13 +273,14 @@ async fn main(_spawner: Spawner) -> ! { | |||
| 273 | let p = embassy_stm32::init(config); | 273 | let p = embassy_stm32::init(config); |
| 274 | info!("Embassy initialized"); | 274 | info!("Embassy initialized"); |
| 275 | 275 | ||
| 276 | let config = QspiCfg { | 276 | let mut config = QspiCfg::default(); |
| 277 | memory_size: MemorySize::_8MiB, | 277 | config.memory_size = MemorySize::_8MiB; |
| 278 | address_size: AddressSize::_24bit, | 278 | config.address_size = AddressSize::_24bit; |
| 279 | prescaler: 16, | 279 | config.prescaler = 16; |
| 280 | cs_high_time: ChipSelectHighTime::_1Cycle, | 280 | config.cs_high_time = ChipSelectHighTime::_1Cycle; |
| 281 | fifo_threshold: FIFOThresholdLevel::_16Bytes, | 281 | config.fifo_threshold = FIFOThresholdLevel::_16Bytes; |
| 282 | }; | 282 | config.sample_shifting = SampleShifting::None; |
| 283 | |||
| 283 | let driver = Qspi::new_bank1( | 284 | let driver = Qspi::new_bank1( |
| 284 | p.QUADSPI, p.PF8, p.PF9, p.PE2, p.PF6, p.PF10, p.PB10, p.DMA2_CH7, config, | 285 | p.QUADSPI, p.PF8, p.PF9, p.PE2, p.PF6, p.PF10, p.PB10, p.DMA2_CH7, config, |
| 285 | ); | 286 | ); |
