Skip to main content
Visitor II
April 4, 2017
Question

ST-link utility v. 4.0 and STM32CubeMX v.4.20 Bug

  • April 4, 2017
  • 3 replies
  • 1122 views
Posted on April 04, 2017 at 09:54

hi to all, i update the firmware of my  the my stm nucleo L152RE with st-link to the version

'ST-link firmware update V2.J27.M15 STM32 Debug+Mass storage'  and

later i update STM32CubeMX to 4.20 version

i use the cube mx to configure the gpio, when i configure RCC and RTC i see that the system crashes

i see the compiler crashes when arrived in this point

 if (HAL_RCC_OscConfig(&RCC_OscInitStruct) != HAL_OK)

  {

    Error_Handler();

  }

the system go in Error_Handler();

I use old example, i created it one month ago, i don't open CubeMX i use only IAR for open the project but

now this example don't work and i see the compiler crashes when arrived in this point:

 if (HAL_RTC_Init(&hrtc) != HAL_OK)

  {

    Error_Handler();

  }

the system go in Error_Handler();

if i use old firmware, ST-link firmware update V2.J20.M4 STM32 Debug+Mass storage my old example work well.

excuse me for my bad english

best regards

Antonio

#bug #stm32cube #st-lik-utility #stm32l152re
    This topic has been closed for replies.

    3 replies

    Technical Moderator
    April 4, 2017
    Posted on April 04, 2017 at 10:27

    Hi

    Buonanno.Antonio

    ,

    This is confirmed bug in RCC clock configuration with

    CubeMx 4.20 and will be fixed soon

    in the new patch release.

    The issue occurred due to this error line:

    RCC_OscInitStruct.OscillatorType = RCC_OSCILLATORTYPE_HSI|RCC_OSCILLATORTYPE_HSE;

    and y

    ou should replace it

    with the following line that will resolve your problem:

    RCC_OscInitStruct.OscillatorType = RCC_OSCILLATORTYPE_HSE;

    Please try this update then let me if this resolve your problem.

    We apologize for any inconvenience this may cause.

    Imen

    antonioBAuthor
    Visitor II
    April 4, 2017
    Posted on April 04, 2017 at 11:28

    Hi Imen thanks for your answer but i have this configuretion code from CubeMX:

    RCC_OscInitStruct.OscillatorType = RCC_OSCILLATORTYPE_HSI|RCC_OSCILLATORTYPE_LSE;

    when i use the  code that you posted it , i see the equal problem

    Technical Moderator
    April 4, 2017
    Posted on April 04, 2017 at 12:00

    Hi

    Buonanno.Antonio

    ,

    In your case, you should removethe oscillator that you don't need

    RCC_OscInitStruct.OscillatorType = RCC_OSCILLATORTYPE_***;

    Imen

    antonioBAuthor
    Visitor II
    April 4, 2017
    Posted on April 04, 2017 at 16:07

    thanks, now work only if you select, in  cubemx, the CSS ENABLED in RTC/LCD Source Mux  and  in SYSTEM clock Mux 

    ST Employee
    April 28, 2017
    Posted on April 28, 2017 at 17:49

    Hello Antonio,

    Great thanks for your inputs.

    CubeMX4.20 has a regression in the clock generation code, that pass through all validation tests.

    The behave is exactly what you have reported.

    This has been corrected in CubeMXv4.20.1.

    I advise you to upgrade to that version, and create a new project.

    Kind regards

    Sirma