2026-01-23 3:31 AM
Im trying to run SYSCLK from LSI on a STM32C011. But it appears as if the MCU is not running. I cant see anything in the datasheet that says the clock cant be used and it can be routed fine in the clock configurator. Am I missing something in the datasheet or does the HAL not support it?
2026-01-23 3:35 AM - edited 2026-01-23 3:44 AM
Hello,
Nothing prevents you using LSI as a clock source for the system clock. From RM0490:
CubeMx:
Are you using CubeMx for the code generation or are you coding the system clock config yourself?
" But it appears as if the MCU is not running"
-> how do you know? what are the symptoms? how you did you debug that?
How to write your question to maximize your chances to find a solution
2026-01-23 3:58 AM - edited 2026-01-23 4:29 AM
I have set the clock as shown. I have verified that I get no clock out when I use LSI. I also have a serial port configured. Again, everything works fine when using HSI as source for SYSCLK. Nothing happens when I use LSI.
2026-01-23 4:27 AM - edited 2026-01-23 4:34 AM
This was in response to posts about unmarking a solution which have since been removed.
See:
PS:
See also: Unmark Solution is too hard to find.
2026-01-23 4:43 AM
I have used the following clock setting.
I use the MCO to verify if SYSCLK is running. I also have a serial port to confirm activity.
It all works fine when using HSI. I doesnt work with LSI. It cant even run an endless loop toggling an IO.
2026-01-23 4:59 AM
"I doesnt work with LSI" does tell nothing.
1- How did you debug that?
2- Share your ioc file
2026-01-23 5:07 AM - edited 2026-01-23 5:08 AM
Sorry.
I get MCO with HSI.
I do not get MCO with LSI.
"I use the MCO to verify if SYSCLK is running." is what I said. Does that not tell anything? I would normally use it to validate if my MCU/SYSCLK is running.
2026-01-23 5:12 AM
Did you run a debug session to find what is going on in your code? is it blocking anywhere in your code?
2026-01-23 5:12 AM
Even when I do not understand why you want to do it...
What makes you believe the MCU does not run at all?
Maybe it is just really slow. LSI is ~32kHz or 0.032 MHz, while using HSI we talk about 48/n MHz.
2026-01-23 5:15 AM
I have attached the ioc file.
I add the following code:
while (1)
{
HAL_UART_Transmit(&huart2, "Hello\n\r", 7, 1000);
HAL_Delay(1000);
/* -- Sample board code for User push-button in interrupt mode ---- */
/* USER CODE END WHILE */
/* USER CODE BEGIN 3 */
}
Works fine with HSI.
Nothing happens with LSI.