Skip to main content
Geoffrey1
Associate III
September 6, 2026
Question

standby on the stm32u375 -- a cautionary tail

  • September 6, 2026
  • 0 replies
  • 9 views

I was finding non-deterministic behavior entering standby -- small code changes unrelated to the standby code or devices seemed to prevent standby.  Many hours of debugging later using a joulescope and claude automation, the following fixed the problem -- declare the standby code as noinline (by default, my builds inline small funcitons)

 

void __attribute__((noinline)) enter_standby_mode(void)

 

Also, an attribute to not optimize works as well.   It did not appear that the generated assembly for the standby code changed, but what did change, due to inlining, is the code alignment.  This suggests, but doesn’t confirm, that the fetch pipeline can impact the ability to enter standby on this part.  This was never an issue on the stm32l432.