cancel
Showing results for 
Search instead for 
Did you mean: 

STM32CubeMX 4.20 Clock Config Bug

Yonathan Foto
Associate II
Posted on April 03, 2017 at 18:07

Hey, 

I just updated my version of STM32CubeMX to 4.20 and now when I generate a project for the STM32F401VCTX using only the RCC-> HSE (A crystal not the internal clock) it gets stuck in SystemClock_Cofig(void). I was able to find that the issue was because for some reason the new cubeMX now uses:

    RCC_OscInitStruct.OscillatorType = RCC_OSCILLATORTYPE_HSI|RCC_OSCILLATORTYPE_HSE;

instead of:

    RCC_OscInitStruct.OscillatorType = RCC_OSCILLATORTYPE_HSE;

even though only the HSE clock is used. For this reason it gets stuck in the Error Handler. This problem was not there in the previous versions of cube. Please look into this and fix this issue.

Thank you

#stmcubemx-4.20 #hse #rcc #hsi
1 ACCEPTED SOLUTION

Accepted Solutions
Jeanne Joly
Senior III
Posted on April 28, 2017 at 09:19

Hello

Foto.Yonathan

,

I would inform you that anew patch

http://www.st.com/content/st_com/en/products/development-tools/software-development-tools/stm32-software-development-tools/stm32-configurators-and-code-generators/stm32cubemx.html

V 4.1is available to fix this issue.

Sorry for any inconvenience this may cause you.

BR. Eric

View solution in original post

4 REPLIES 4
Imen.D
ST Employee
Posted on April 03, 2017 at 18:21

Hi

Foto.Yonathan

,

This is a known bug in the CubeMx V4.20 and will be fixed soon in the new patch releases.

Sorry for the inconvenience it may bring.

Thanks

Imen

When your question is answered, please close this topic by clicking "Accept as Solution".
Thanks
Imen
Yonathan Foto
Associate II
Posted on April 03, 2017 at 19:15

Great!

I would also suggest creating a GPIO_Pin Class containing the GPIO PIN and PORT Number for all GPIO initalized on STM32CubeMX and modifying the HAL_GPIO.c functions so that they can be used by only calling the pin name for example:

   OLD PIN Read: HAL_GPIO_ReadPin(

Button_Enter_GPIO_Port

,

Button_Enter

_PIN);

   NEW PIN Read: 

HAL_GPIO_ReadPin(Button_Enter

);

And if you could add separate functions for setting a pin high or low that would be excellent. For Example:

   OLD WRITE PIN HIGH:  HAL_GPIO_WritePin(LED0_GPIO_Port,LED0_Pin,GPIO_PIN_SET);

   NEW WRITE PIN HIGH: HAL_GPIO_SetPin(LED0);

   

   OLD WRITE PIN LOW:  HAL_GPIO_WritePin(LED0_GPIO_Port,LED0_Pin,GPIO_PIN_RESET);

   NEW WRITE PIN LOQ: HAL_GPIO_ClearPin(LED0);

These changes would make programming simple things like turning on and off pins easier. 

I have all these functions in a library but if it was automatically done in STM32CubeMX and i didnt need to link my library for every project that would be great!!

Thanks for the help

Posted on April 04, 2017 at 10:35

Hi,

Thank you

Foto.Yonathan

for your suggestion.

I will raise your request internally for further investigation.

Thanks

Imen

When your question is answered, please close this topic by clicking "Accept as Solution".
Thanks
Imen
Jeanne Joly
Senior III
Posted on April 28, 2017 at 09:19

Hello

Foto.Yonathan

,

I would inform you that anew patch

http://www.st.com/content/st_com/en/products/development-tools/software-development-tools/stm32-software-development-tools/stm32-configurators-and-code-generators/stm32cubemx.html

V 4.1is available to fix this issue.

Sorry for any inconvenience this may cause you.

BR. Eric