Code: Select all
/* Makes sure that HSI is stable before proceeding.*/
CLK->ICKR |= CLK_ICKR_HSIRDY;
while ((CLK->ICKR & CLK_ICKR_HSIRDY) == 0)
;
The ICKR should be set to CLK_ICKR_HSIEN. However, the code might not be needed at all (?), because the HSI is enabled by default at startup and the HSI RC output clock is not released until this bit is set by hardware (and there has been code already executed - stack init etc.)