Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Run button_exti example on STM32H5 but a panic occurs #3784

Open
joshuajylin opened this issue Jan 20, 2025 · 1 comment
Open

Run button_exti example on STM32H5 but a panic occurs #3784

joshuajylin opened this issue Jan 20, 2025 · 1 comment

Comments

@joshuajylin
Copy link

I guess there's something wrong when MCU wakes up from the low-power mode.
I added button_exti into the stop example and everything worked fine.

cargo run --bin button_exti
Finisheddevprofile [optimized + debuginfo] target(s) in 0.39s Runningprobe-rs run --chip STM32H563ZITx target/thumbv8m.main-none-eabihf/debug/button_extiErasing ✔ [00:00:00] [####################################################################################################################################################################################] 32.00 KiB/32.00 KiB @ 411.40 KiB/s (eta 0s ) Programming ✔ [00:00:00] [#####################################################################################################################################################################################] 32.00 KiB/32.00 KiB @ 65.86 KiB/s (eta 0s ) Finished in 0.578s DEBUG flash: latency=1 wrhighfreq=0 └─ embassy_stm32::rcc::_version::flash_setup @ /Users/joshua/Workspace/github/embassy/embassy-stm32/src/rcc/h.rs:1000 TRACE BDCR ok: 0c008200 └─ embassy_stm32::rcc::bd::{impl#3}::init @ /Users/joshua/Workspace/github/embassy/embassy-stm32/src/rcc/bd.rs:216 DEBUG rcc: Clocks { audioclk: MaybeHertz(0), csi: MaybeHertz(0), csi_div_122: MaybeHertz(0), hclk1: MaybeHertz(64000000), hclk2: MaybeHertz(64000000), hclk4: MaybeHertz(64000000), hse: MaybeHertz(0), hsi: MaybeHertz(64000000), hsi48: MaybeHertz(48000000), lse: MaybeHertz(0), lsi: MaybeHertz(0), pclk1: MaybeHertz(64000000), pclk1_tim: MaybeHertz(64000000), pclk2: MaybeHertz(64000000), pclk2_tim: MaybeHertz(64000000), pclk3: MaybeHertz(64000000), pll1_q: MaybeHertz(0), pll2_p: MaybeHertz(0), pll2_q: MaybeHertz(0), pll2_r: MaybeHertz(0), pll3_p: MaybeHertz(0), pll3_q: MaybeHertz(0), pll3_r: MaybeHertz(0), rtc: MaybeHertz(32000), sys: MaybeHertz(64000000) } └─ embassy_stm32::rcc::set_freqs @ /Users/joshua/Workspace/github/embassy/embassy-stm32/src/rcc/mod.rs:71 INFO Hello World! └─ button_exti::____embassy_main_task::{async_fn#0} @ src/bin/button_exti.rs:13 INFO Press the USER button... └─ button_exti::____embassy_main_task::{async_fn#0} @ src/bin/button_exti.rs:17 ERROR panicked at /Users/joshua/Workspace/github/embassy/embassy-stm32/src/low_power.rs:97:23: calledOption::unwrap()on aNone value └─ panic_probe::print_defmt::print @ /Users/joshua/.cargo/registry/src/index.crates.io-6f17d22bba15001f/panic-probe-0.3.2/src/lib.rs:104

@joshuajylin
Copy link
Author

I found that low_power::on_wakeup_irq() will be called if the low-power feature is enabled.
So I removed the low-power feature from embassy-stm32 in Cargo.toml and the button_exti example worked.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant