STM32WB Errata "CPU2 hard fault when changing C2HPRE clock divider in RCC_EXTCFGR on CPU1"
Hello!
The errata states this as a workaround for this errata:
Description
When CPU1 switches the system clock frequency, the C2HPRE divider may need to be updated according to
CPU2 frequency requirements. Changing the C2HPRE divider by CPU1 when CPU2 is running can cause a
wrong instruction fetch on CPU2, which may lead to a hard fault.
Workaround
To avoid this situation, once CPU2 is started, the C2HPRE divider must not be updated by CPU1. CPU1 must call
the SHCI_C2_SetSystemClock system command to request CPU2 to manage the switch of the system clock. The
C2HPRE divider is then set in a specific procedure to avoid wrong instruction fetching by CPU2
Does this apply if C2BOOT is cleared after the BLE stack had been running for some time and PWR_EXTSCR.C2DS is cleared? Normally C2BOOT is set once at startup, but if it was more dynamically managed and CPU2 isn't currently running via the following checks:
- PWR_CR4.C2BOOT is 0
- CPU2 cannot start autonomously with this set to 0, but will continue to run (if running at the time) when this is cleared as far as I understand.
- PWR_EXTSCR.C2DS is 0
- This proves that CPU2 is currently not running.
Would it be okay to touch C2HPRE while those two bits are 0, even if the BLE stack had been active in the current bootup previously (but isn't currently active with any scheduled RADIO events)?
Thanks,
Tim
