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?

9 REPLIES 9
mƎALLEm
ST Employee

Hello,

Nothing prevents you using LSI as a clock source for the system clock. From RM0490:

mALLEm_1-1769168310014.png

CubeMx:

mALLEm_0-1769167990988.png

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

 

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.

SHDK2000_0-1769169241447.png

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.

 

 

Andrew Neil
Super User

This was in response to posts about unmarking a solution which have since been removed.


See:

https://community.st.com/t5/community-guidelines/help-others-to-solve-their-issues/ta-p/575256#:~:text=If%20you%20accidentally%20choose%20the%20wrong%20post%20as%20the%20solution%2C%20you%20can%20revert%20this%20action%20by%20clicking%C2%A0Not%20the%20Solution

 

PS:

See also: Unmark Solution is too hard to find.

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.

I have used the following clock setting.

SHDK2000_0-1769172117087.png

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.

 

 

"I doesnt work with LSI" does tell nothing. 

1- How did you debug that? 

2- Share your ioc file

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.

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.

 

Did you run a debug session to find what is going on in your code? is it blocking anywhere in your code?

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.
mfgkw
Senior II

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.

SHDK2000
Associate II

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.