AnsweredAssumed Answered

STM32CubeMx V1.00 Version 4.4.0 Create incorrect Code

Question asked by de_jager.gerrie on Feb 2, 2015
Latest reply on Feb 17, 2015 by Amel N
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

Attachments

Outcomes