cancel
Showing results for 
Search instead for 
Did you mean: 

STM32 cube mx generated code issue

vadim2
Associate II
Posted on April 01, 2017 at 19:00

Sup, engineers. 

I found some interesting issue in code, generated with STM32 cube MX. If I choose HSE as source for my PLL, it gives me following line of code in the RCC initialization function:

RCC_OscInitStruct.OscillatorType = RCC_OSCILLATORTYPE_HSI|RCC_OSCILLATORTYPE_HSE;

That causes MCU stuck during RCC initialization. Replacing it with following line helps me to boot properly:

RCC_OscInitStruct.OscillatorType = RCC_OSCILLATORTYPE_HSE;

Can anyone tell me, is that cube issue, or I am missing something.

3 REPLIES 3
glooom
Associate
Posted on April 02, 2017 at 00:40

When I set HSI48 Cube generates

RCC_OscInitStruct.OscillatorType = RCC_OSCILLATORTYPE_HSI|RCC_OSCILLATORTYPE_HSI48;

but

RCC_OscInitStruct.OscillatorType = RCC_OSCILLATORTYPE_HSI48;

only works for me.

Imen.D
ST Employee
Posted on April 02, 2017 at 18:32

Hello

Mischuk.Vadim

,

Zagorodnikov.Aleksey

,

This is aconfirmed bug in CubeMx 4.20 and will be fixed soon in the new patch releases.

Sorry for any inconvenience it may bring you.

Imen

When your question is answered, please close this topic by clicking "Accept as Solution".
Thanks
Imen
Posted on April 09, 2017 at 22:57

Hi,

This issue is resolved with the new patch of STM32CubeMx v4.20.1

As you are using an old .ioc project, you should first EDIT the .ioc file and REMOVE the RCC.OscillatorType that you don't need, then re-generate the project.

Imen

When your question is answered, please close this topic by clicking "Accept as Solution".
Thanks
Imen