Description
Hi!
We have a few STM32H745XI discovery boards used throughout smaller projects. After updating from an older version of embassy
to the latest version, we ran into a curious issue that is probably related to a change in the default supply config:
The issue happens when we flash a board with the latest version of embassy
.
- While the board remains connected via USB, every example still works.
- Once disconnected (powered down) and reconnected, none of the examples work (even after reflashing).
- After flashing an example with an old version of
embassy
and reconnecting USB (power cycle), everything works again.
My colleague @KloolK debugged it a while back and ran into the same issue and solution as described in #2430. So when setting the SupplyConfig
to DirectSMPS
, we prevent the board from getting stuck after the next power cycle:
let mut config = embassy_stm32::Config::default();
{
use embassy_stm32::rcc::*;
config.rcc.supply_config = SupplyConfig::DirectSMPS;
}
let p = embassy_stm32::init(config);
Right now, if anyone uses a STM32H745XI discovery board or similar with any of the examples, they may run into the tricky situation of everything working seemingly fine one day, but after a power cycle not being able to run any example. My suggestion is to switch the default SupplyConfig
to DirectSMPS
at least for the feature stm32h745xi-cm7
, maybe also stm32h745xi-cm4
.
I'd be happy to create a PR but I wanted to make sure that there is no other reason for having the default as it is.
@badrbouslikhin could you comment since you were the last one to edit SupplyConfig
?