Description
MSIK can be used as kernel clock by the MDF1 and ADF1 by configuring the MDF1SEL and ADF1SEL bitfields of RCC_CCIPRx registers.
Once selected as kernel clock source for MDF1 or ADF1 peripherals, MSIK can no longer be disabled using the MSIKON bits of the RCC_CR register. This is because MDF1 and ADF1 request their kernel clock by default after reset.
If the application requests an entry in Stop 0, Stop 1, or Stop 2 mode, the selected MSIK kernel clock remains enabled leading to an overconsumption in this mode. The Stop 3 mode is not concerned by this limitation. MDF1 is not concerned for Stop 2 mode.
Workaround
Before disabling the MSIK clocks, configure MDF1SEL and ADF1SEL to HCLK.
In case the application wants to enter Stop 0 or Stop 1 mode, and the MDF1 and ADF1 are not used during Stop mode, then configure MDF1SEL and ADF1SEL bitfields to HCLK before entering Stop mode. Upon Stop mode exit, restore the required MSIK kernel clock with the MDF1SEL and ADF1SEL bitfields. In case the application wants to enter Stop 2 mode and the ADF1 is not used during Stop mode, the same procedure is needed only for ADF1SEL.
In case the application wants to enter Stop 0, Stop 1, or Stop 2 mode and the MDF1 or ADF1 peripheral is used during Stop mode (Stop 0 and Stop 1 modes only for MDF1), then simply configure the MDF1SEL and ADF1SEL bitfields to required MSIK kernel clock. These peripherals request their kernel clock when they need it.