v01d commented on pull request #2177: URL: https://github.com/apache/incubator-nuttx/pull/2177#issuecomment-724744623
> Can you please provide me an example of this, to better understand it? Choose the MCU that you like, and please explain me how `stm32_clockenable()` is called from IDLE. I think that on stm32 arch, this is not done directly at the arch level, but maybe some boards make the call in custom IDLE loop implementation. You can see an example on stm32l4_idle.c (different arch, but same situation) when returning from STOP mode. There's not much more to explain, the point is that you need to wait for oscillator to be stable again and reconfigure clock source as what it was before sleep mode. > No, I am talking about the actual voltage applied on the chip itself. > See the following table (taken from the reference manual of STM32F4xx, page 80): >  > > As you see, there should also be a way to define how the board is powering the chip. What is the voltage provided. > Never saw such a table for chips I worked with, maybe this is only for this chip line? On STM32L4 at least the table of wait states is dependant on core voltage (not supply voltage), which is selected in two possible ranges (range 1 or 2) depending on the frequency of the system clock:  So in this case it is easier since you already have information to apply the correct number of wait states depending on sys clk frequency. Which manual are you using? When I worked with STM32F405, I used RM0090 which only applies to:  So as you see, to provide a general solution you would need to account for other chips not included in that list, that is why it is so difficult to provide a really general solution. But your suggestion makes sense, you could have a config value that lets you select the expected working voltage range and apply configurations based on that. ---------------------------------------------------------------- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org