cancel
Showing results for 
Search instead for 
Did you mean: 

STM32C011. Cant run sysclk from LSI.

SHDK2000
Associate II

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?

28 REPLIES 28

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.

 

mfgkw
Senior III

Sorry for not beeing precise enough, I wonder why you want to use LSI to feed Sysclk.

SHDK2000
Associate II

I want to use LSI to power SYSCLK to minimize current consumption.

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.

A complex system that works is invariably found to have evolved from a simple system that worked.
A complex system designed from scratch never works and cannot be patched up to make it work.
mfgkw
Senior III

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.


@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?

A complex system that works is invariably found to have evolved from a simple system that worked.
A complex system designed from scratch never works and cannot be patched up to make it work.

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.

Start by removing the UART APIs call and check what happens on MCO

To give better visibility on the answered topics, please click on "Accept as Solution" on the reply which solved your issue or answered your question.

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.

I don't have that part number to test the case.

I will do it when I have on at hands.

To give better visibility on the answered topics, please click on "Accept as Solution" on the reply which solved your issue or answered your question.