cancel
Showing results for 
Search instead for 
Did you mean: 

Should LL_RCC_DeInit be clearing the reset cause flags?

CTapp.1
Senior II

I'm using LL_RCC_DeInit within a boot loader so that the clocks are in the reset state when the application is launched. However, LL_RCC_DeInit also clears the reset cause flags as its last action:

  /* Clear reset flags */
  LL_RCC_ClearResetFlags();

The application needs to use the reset cause, so I will need to either:

  1. Modify the LL_RCC_DeInit routine (not ideal, as there are no user code sections to retain the changes); or
  2. Clone LL_RCC_DeInit and remove this part (also not ideal as I would need to keep on top of any LL HAL changes); or
  3. Find some other way of passing the reset cause into the application. I would rather not do this, as I want to keep the boot loader and application completely decoupled.

Resetting the flags within LL_RCC_DeInit does not seem to be compatible with its stated behaviour ("Reset the RCC clock configuration to the default reset state"), as the flags could be seen as being part of that state.

For now, I will use one of the TAMP->BKP?R registers to capture and forward the state.

0 REPLIES 0