apache / mynewt-core

An OS to build, deploy and securely manage billions of devices
https://mynewt.apache.org/
Apache License 2.0
813 stars 365 forks source link

hw/mcu/stm32: Add option to place WFI in RAM #3237

Closed kasjer closed 3 weeks ago

kasjer commented 1 month ago

Some STM32 devices have erratas for flash related issues that recommend workaround of placing WFI instruction in RAM. This is the case for STM32F4xx devices where other solution was to put WFI instruction at specific address locations (divisible by 8).

New syscfg value STM32_WFI_FROM_RAM is introduced that adds function stm32_wfi_from_ram().

STM32_WFI is also added and can be used instead of WFI when needed

BSP for affected STM32F4xx devices now use WFI from RAM instead of placing WFI instruction at aligne address. STM32L0 devices are also updated since anomally was also observed there.