aboutsummaryrefslogtreecommitdiff
path: root/examples/stm32f7
diff options
context:
space:
mode:
author1-rafael-1 <[email protected]>2025-09-15 20:07:18 +0200
committer1-rafael-1 <[email protected]>2025-09-15 20:07:18 +0200
commit6bb3d2c0720fa082f27d3cdb70f516058497ec87 (patch)
tree5a1e255cff999b00800f203b91a759c720c973e5 /examples/stm32f7
parenteb685574601d98c44faed9a3534d056199b46e20 (diff)
parent92a6fd2946f2cbb15359290f68aa360953da2ff7 (diff)
Merge branch 'main' into rp2040-rtc-alarm
Diffstat (limited to 'examples/stm32f7')
-rw-r--r--examples/stm32f7/Cargo.toml25
-rw-r--r--examples/stm32f7/src/bin/can.rs2
-rw-r--r--examples/stm32f7/src/bin/cryp.rs4
-rw-r--r--examples/stm32f7/src/bin/eth.rs3
-rw-r--r--examples/stm32f7/src/bin/qspi.rs15
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"
3name = "embassy-stm32f7-examples" 3name = "embassy-stm32f7-examples"
4version = "0.1.0" 4version = "0.1.0"
5license = "MIT OR Apache-2.0" 5license = "MIT OR Apache-2.0"
6publish = 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.
9embassy-stm32 = { version = "0.2.0", path = "../../embassy-stm32", features = ["defmt", "stm32f777zi", "memory-x", "unstable-pac", "time-driver-any", "exti", "single-bank"] } 10embassy-stm32 = { version = "0.4.0", path = "../../embassy-stm32", features = ["defmt", "stm32f777zi", "memory-x", "unstable-pac", "time-driver-any", "exti", "single-bank"] }
10embassy-sync = { version = "0.6.2", path = "../../embassy-sync", features = ["defmt"] } 11embassy-sync = { version = "0.7.2", path = "../../embassy-sync", features = ["defmt"] }
11embassy-executor = { version = "0.7.0", path = "../../embassy-executor", features = ["arch-cortex-m", "executor-thread", "defmt"] } 12embassy-executor = { version = "0.9.0", path = "../../embassy-executor", features = ["arch-cortex-m", "executor-thread", "defmt"] }
12embassy-time = { version = "0.4.0", path = "../../embassy-time", features = ["defmt", "defmt-timestamp-uptime", "tick-hz-32_768"] } 13embassy-time = { version = "0.5.0", path = "../../embassy-time", features = ["defmt", "defmt-timestamp-uptime", "tick-hz-32_768"] }
13embassy-net = { version = "0.7.0", path = "../../embassy-net", features = ["defmt", "tcp", "dhcpv4", "medium-ethernet"] } 14embassy-net = { version = "0.7.1", path = "../../embassy-net", features = ["defmt", "tcp", "dhcpv4", "medium-ethernet"] }
14embedded-io-async = { version = "0.6.1" } 15embedded-io-async = { version = "0.6.1" }
15embassy-usb = { version = "0.4.0", path = "../../embassy-usb", features = ["defmt"] } 16embassy-usb = { version = "0.5.0", path = "../../embassy-usb", features = ["defmt"] }
16embassy-futures = { version = "0.1.0", path = "../../embassy-futures" } 17embassy-futures = { version = "0.1.0", path = "../../embassy-futures" }
17 18
18defmt = "0.3" 19defmt = "1.0.1"
19defmt-rtt = "0.4" 20defmt-rtt = "1.0.0"
20 21
21cortex-m = { version = "0.7.6", features = ["inline-asm", "critical-section-single-core"] } 22cortex-m = { version = "0.7.6", features = ["inline-asm", "critical-section-single-core"] }
22cortex-m-rt = "0.7.0" 23cortex-m-rt = "0.7.0"
23embedded-hal = "0.2.6" 24embedded-hal = "0.2.6"
24panic-probe = { version = "0.3", features = ["print-defmt"] } 25panic-probe = { version = "1.0.0", features = ["print-defmt"] }
25heapless = { version = "0.8", default-features = false } 26heapless = { version = "0.8", default-features = false }
26nb = "1.0.0" 27nb = "1.0.0"
27rand_core = "0.6.3"
28critical-section = "1.1" 28critical-section = "1.1"
29embedded-storage = "0.3.1" 29embedded-storage = "0.3.1"
30static_cell = "2" 30static_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]
36debug = 2 36debug = 2
37
38[package.metadata.embassy]
39build = [
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;
12use embassy_stm32::{bind_interrupts, eth, peripherals, rng, Config}; 12use embassy_stm32::{bind_interrupts, eth, peripherals, rng, Config};
13use embassy_time::Timer; 13use embassy_time::Timer;
14use embedded_io_async::Write; 14use embedded_io_async::Write;
15use rand_core::RngCore;
16use static_cell::StaticCell; 15use static_cell::StaticCell;
17use {defmt_rtt as _, panic_probe as _}; 16use {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 );