cancel
Showing results for 
Search instead for 
Did you mean: 

STM32CubeMx V1.00 Version 4.4.0 Create incorrect Code

gerrie
Associate
Posted on February 02, 2015 at 22:05

I am using an STM32F051K6Txm device.

with STM32Cube FW_F0 V1.0.0.

Setting the Sysclk to use HSE, but code generated is HSI.

Attached is my ioc file.

To make this work I had to edit the

 

SystemClock_Config ()function and changed

{

  RCC_OscInitTypeDef RCC_OscInitStruct;

  RCC_ClkInitTypeDef RCC_ClkInitStruct;

  RCC_PeriphCLKInitTypeDef PeriphClkInit;

  RCC_OscInitStruct.HSICalibrationValue = 16;

  RCC_OscInitStruct.OscillatorType = RCC_OSCILLATORTYPE_HSI 

=> must be  RCC_OSCILLATORTYPE_HSE;

  RCC_OscInitStruct.HSEState = RCC_HSE_ON;

without this mod, the system is using the RC osc, and I have drifs so large that the Uarts stops working.

Changing this line and the xtal osc can clearly be seen on the MCO port pin, and an frequency counter shows a 10-4 change.

Thanks

#hse-config #cubemx
1 REPLY 1
Amel NASRI
ST Employee
Posted on February 17, 2015 at 11:35

Hi,

By default, clock source is HSI. You have to update it in the pinout tab & select HSE as clock source.

Please note that current CubeMX version is 4.6.

-Mayla-

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.