cancel
Showing results for 
Search instead for 
Did you mean: 

LSI clock selection does not seem to work on STM8S207 Nucleo-32 board.

MJohn.12
Associate

Using the code fragment below I would expect the code to hang if it got an error during the clock switch or it actually switched to the LSI clock. But the test code keeps running and starts blinking an LED.

    CLK_LSICmd(ENABLE);

    CLK_ClockSwitchCmd(ENABLE);

    if (SUCCESS != CLK_ClockSwitchConfig(

        CLK_SWITCHMODE_AUTO,

        CLK_SOURCE_LSI,

        DISABLE,

        CLK_CURRENTCLOCKSTATE_DISABLE))

    {

        for (;;) ;

    }

    if (CLK_GetSYSCLKSource() != CLK_SOURCE_HSI) for (;;) ;

1 REPLY 1
Artur IWANICKI
ST Employee

Hello,

System clock switch to LSI can be done only if LSI is enabled within option bytes (please have a look LSI_EN_OPT_BIT on figure 20 within RM0016 reference manual), otherwise this change will be ignored.

Could you please check your settings within option bytes and try to execute your code?

Best Regards,

Artur Iwanicki,

/STMicroelectronics/