I'm using STM8l052R8 MCU.
I'm trying to switch the clock from HSI to LSI but I can't.
this is my code:
CLK_DeInit(); //deinitiate clock
CLK_SYSCLKSourceSwitchCmd(ENABLE); //enable switching
CLK_LSICmd(ENABLE); //enable LSI oscillator
CLK->SWR = 0x02; // choose LSI as a clock source
the debugger doesn't work correctly. I'm using ST-Link Debugger.
Is this code Is correct or How to confirm that I switched to LSI correctly ??