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?
Solved! Go to Solution.
2026-01-23 5:17 AM
Why I wnat to verify, that my MCU is running? Seems obvious to me, but ok. If it doesnt run, then nothing will work. Isnt that an ok reason?
I use my oscilloscope to verify MCO behaviour.
2026-01-23 5:31 AM
Sorry for not beeing precise enough, I wonder why you want to use LSI to feed Sysclk.
2026-01-23 5:34 AM
I want to use LSI to power SYSCLK to minimize current consumption.
2026-01-23 6:01 AM
Usually the best way to minimise current consumption is to maximise use of low-power modes.
So you want the CPU to run quickly - then it can finish sooner, and sleep longer.
2026-01-23 6:02 AM
Maybe you look at the wrong pin for the clock signal.
DS13867 says in 3.9:
Clock output:
– MCO and MCO2 (microcontroller clock output) provides one of the internal
clocks for external use by the application.
– LSCO (low speed clock output) provides LSI or LSE in all low-power modes.I assume LSI is not routed to MCO.
LSCO is mentioned as alternate function on Pin13 for LQFP48.
2026-01-23 6:05 AM - edited 2026-01-23 6:06 AM
@SHDK2000 wrote:Nothing happens with LSI.
You mean you don't see any UART output?
That's not the same as nothing happening !
Have you used the debugger to check that your code is actually running?
How do you check for UART output? If using a terminal, it might show nothing because the baud rate is wrong...
Have you used an oscilloscope to see if anything is coming from the UART?
Does just toggling a GPIO pin work?
2026-01-23 7:06 AM - last edited on 2026-01-26 4:17 AM by Andrew Neil
Sorry for not clarifying.
I said nothing happens because i meant NOTHING happens.
I dont get MCO out when routing SYSCLK to the output even if I ONLY use the autogenerated code with an idle while(1) main loop. It works when I use HSI, so I know its the right pin.
I dont get UART output of any kind. When I use HSI it works.
I cant toggle a pin. When I use HSI it works.
I cant use a debugger, cause I get the message "Target is not responding, retrying...". Works when I use HSI.
I tried both on the NUCLEO-C031C6 board, and a board with the STM32C011, that I made myself. I cant get any response when using LSI as SYSCLK. When I use HSI, everything works fine.
2026-01-23 7:10 AM
Start by removing the UART APIs call and check what happens on MCO
2026-01-23 7:15 AM - last edited on 2026-01-26 4:18 AM by Andrew Neil
I have mentioned already, that I cant even run an idle loop using the autogenerated code. NOTHING happens. I did also attach the ioc file.
2026-01-23 7:17 AM
I don't have that part number to test the case.
I will do it when I have on at hands.