I do not want to edit the STM8S_StdPeriph_Driver, so I add the follow code after the function CLK_ClockSwitchConfig(), it work and my uart program also work in correct baudratio.// switch clk to HSE without div, the fclk = HSE/1
CLK_ClockSwitchConf...
I found a new bug: in auto mode, after give the SWR a new value, the SWBSY bit won't become 1 immediately, but it check this bit at once in the function CLK_ClockSwitchConfig(), so this function exit before the clock switch done, then i init the uart...