cancel
Showing results for 
Search instead for 
Did you mean: 

STM32Cube_FW_G0_V1.4.0 bug ?

Peko
Associate III

Hello,

I work with STM32G070RBT. I upgrade FW to STM32Cube_FW_G0_V1.4.0.

These definitions have disappeared from the file stm32g070xx.h:

#define RCC_CFGR_SWS_HSI              (0UL)                                  /*!< HSI used as system clock */

#define RCC_CFGR_SWS_HSE              (0x00000008UL)                         /*!< HSE used as system clock */

#define RCC_CFGR_SWS_PLL              (0x00000010UL)                         /*!< PLL used as system clock */

#define RCC_CFGR_SWS_LSI              (0x00000018UL)                         /*!< LSI used as system clock */

#define RCC_CFGR_SWS_LSE              (0x00000020UL)                         /*!< LSE used as system clock */

My project cannot bild at this time.

Peter

13 REPLIES 13
Imen.D
ST Employee

Hello @Peko​ ,

Could you please provide more details on your case: Have you an Error message?

Are you using STM32CubeMx to generate your project ? If it is the case, please share your ioc file.

Imen

When your question is answered, please close this topic by clicking "Accept as Solution".
Thanks
Imen
Peko
Associate III
Hello,
The problem has occurred at migrate project (created with STM32Cube_FW_G0_V1.3.0) to STM32Cube_FW_G0_V1.4.0 in STM32Cube IDE V1.5.
All necessary files have been upgraded, only file system_stm32g0xx.c in my project remained unchanged.
In this file is function void SystemCoreClockUpdate(void)
{
case RCC_CFGR_SWS_HSE: /* HSE used as system clock */ !!!! this definitions are missing in new stm32g070xx.h
SystemCoreClock = HSE_VALUE;
break;
case RCC_CFGR_SWS_LSI: /* LSI used as system clock */ !!!! this definitions are missing in new stm32g070xx.h
SystemCoreClock = LSI_VALUE;
break;
case RCC_CFGR_SWS_LSE: /* LSE used as system clock */ !!!! this definitions are missing in new stm32g070xx.h
SystemCoreClock = LSE_VALUE;
break;
case RCC_CFGR_SWS_PLL: /* PLL used as system clock */ !!!! this definitions are missing in new stm32g070xx.h
}
!!! The „migrate program“ should overwrite the function void SystemCoreClockUpdate(void) !!!
switch (RCC->CFGR & RCC_CFGR_SWS)
{
case RCC_CFGR_SWS_0: /* HSE used as system clock */
SystemCoreClock = HSE_VALUE;
break;
case (RCC_CFGR_SWS_1 | RCC_CFGR_SWS_0): /* LSI used as system clock */
SystemCoreClock = LSI_VALUE;
break;
case RCC_CFGR_SWS_2: /* LSE used as system clock */
SystemCoreClock = LSE_VALUE;
break;
case RCC_CFGR_SWS_1: /* PLL used as system clock */
}
I rewrote the stm32g0xx.c file in my project with the new file stm32g0xx.c from Repository STM32Cube_FW_G0_V1.4.0 and now everything is fine.
Best Regards
Peter
Imen.D
ST Employee

Hi @Peko​ ,

Thank you for bringing this to our attention.

I have passed your feedback along to our CubeMX team for fix.

Imen

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

Thank you, I used the same solution.

The naming convention of the defines seems to be less descriptive in the new version 1.4.0, compared to 1.3.0

David

Steven1
Associate II

Hello,

Deleting the system_stm32g0xx.c file and regenerating code will generate the correct file. This seems to be a quick solution for now.

Steven

Yeah Steven, this worked! No more compilation errors. Hope will not find other issues in version 1.4

PGroe.2
Associate III

After migrating I also now get a load of this warnings besides the error above:

<command-line>:0:0: warning: "HSE_STARTUP_TIMEOUT" redefined
<command-line>:0:0: warning: "HSE_STARTUP_TIMEOUT" redefined
<command-line>:0:0: note: this is the location of the previous definition
<command-line>:0:0: note: this is the location of the previous definition
<command-line>:0:0: warning: "HSE_STARTUP_TIMEOUT" redefined
<command-line>:0:0: note: this is the location of the previous definition
<command-line>:0:0: warning: "HSE_STARTUP_TIMEOUT" redefined
<command-line>:0:0: note: this is the location of the previous definition
<command-line>:0:0: warning: "HSE_STARTUP_TIMEOUT" redefined
<command-line>:0:0: note: this is the location of the previous definition
<command-line>:0:0: warning: "HSE_STARTUP_TIMEOUT" redefined
<command-line>:0:0: note: this is the location of the previous definition
<command-line>:0:0: warning: "HSE_STARTUP_TIMEOUT" redefined
<command-line>:0:0: note: this is the location of the previous definition
arm-none-eabi-gcc "../Core/Src/stm32g0xx_it.c" -mcpu=cortex-m0plus -std=gnu11 -g3 -DSTM32G071xx '-DHSE_VALUE=16000000' '-DLSI_VALUE=32000' '-DHSI_VALUE=16000000' '-DHSE_STARTUP_TIMEOUT=5' -DDEBUG '-DLSE_STARTUP_TIMEOUT=5000' '-DLSE_VALUE=32768' '-DHSE_STARTUP_TIMEOUT=5000' '-DDATA_CACHE_ENABLE=1' '-DVDD_VALUE=3300' '-DINSTRUCTION_CACHE_ENABLE=1' '-DEXTERNAL_CLOCK_VALUE=48000' -DUSE_FULL_LL_DRIVER '-DPREFETCH_ENABLE=0' -c -I../Core/Inc -I../Drivers/STM32G0xx_HAL_Driver/Inc -I../Drivers/CMSIS/Device/ST/STM32G0xx/Include -I../Drivers/CMSIS/Include -O0 -ffunction-sections -fdata-sections -Wall -fstack-usage -MMD -MP -MF"Core/Src/stm32g0xx_it.d" -MT"Core/Src/stm32g0xx_it.o" --specs=nano.specs -mfloat-abi=soft -mthumb -o "Core/Src/stm32g0xx_it.o"
<command-line>:0:0: warning: "HSE_STARTUP_TIMEOUT" redefined
<command-line>:0:0: note: this is the location of the previous definition
arm-none-eabi-gcc "../Core/Src/syscalls.c" -mcpu=cortex-m0plus -std=gnu11 -g3 -DSTM32G071xx '-DHSE_VALUE=16000000' '-DLSI_VALUE=32000' '-DHSI_VALUE=16000000' '-DHSE_STARTUP_TIMEOUT=5' -DDEBUG '-DLSE_STARTUP_TIMEOUT=5000' '-DLSE_VALUE=32768' '-DHSE_STARTUP_TIMEOUT=5000' '-DDATA_CACHE_ENABLE=1' '-DVDD_VALUE=3300' '-DINSTRUCTION_CACHE_ENABLE=1' '-DEXTERNAL_CLOCK_VALUE=48000' -DUSE_FULL_LL_DRIVER '-DPREFETCH_ENABLE=0' -c -I../Core/Inc -I../Drivers/STM32G0xx_HAL_Driver/Inc -I../Drivers/CMSIS/Device/ST/STM32G0xx/Include -I../Drivers/CMSIS/Include -O0 -ffunction-sections -fdata-sections -Wall -fstack-usage -MMD -MP -MF"Core/Src/syscalls.d" -MT"Core/Src/syscalls.o" --specs=nano.specs -mfloat-abi=soft -mthumb -o "Core/Src/syscalls.o"
arm-none-eabi-gcc "../Core/Src/sysmem.c" -mcpu=cortex-m0plus -std=gnu11 -g3 -DSTM32G071xx '-DHSE_VALUE=16000000' '-DLSI_VALUE=32000' '-DHSI_VALUE=16000000' '-DHSE_STARTUP_TIMEOUT=5' -DDEBUG '-DLSE_STARTUP_TIMEOUT=5000' '-DLSE_VALUE=32768' '-DHSE_STARTUP_TIMEOUT=5000' '-DDATA_CACHE_ENABLE=1' '-DVDD_VALUE=3300' '-DINSTRUCTION_CACHE_ENABLE=1' '-DEXTERNAL_CLOCK_VALUE=48000' -DUSE_FULL_LL_DRIVER '-DPREFETCH_ENABLE=0' -c -I../Core/Inc -I../Drivers/STM32G0xx_HAL_Driver/Inc -I../Drivers/CMSIS/Device/ST/STM32G0xx/Include -I../Drivers/CMSIS/Include -O0 -ffunction-sections -fdata-sections -Wall -fstack-usage -MMD -MP -MF"Core/Src/sysmem.d" -MT"Core/Src/sysmem.o" --specs=nano.specs -mfloat-abi=soft -mthumb -o "Core/Src/sysmem.o"
<command-line>:0:0: warning: "HSE_STARTUP_TIMEOUT" redefined
<command-line>:0:0: note: this is the location of the previous definition
<command-line>:0:0: warning: "HSE_STARTUP_TIMEOUT" redefined
<command-line>:0:0: note: this is the location of the previous definition
arm-none-eabi-gcc "../Core/Src/system_stm32g0xx.c" -mcpu=cortex-m0plus -std=gnu11 -g3 -DSTM32G071xx '-DHSE_VALUE=16000000' '-DLSI_VALUE=32000' '-DHSI_VALUE=16000000' '-DHSE_STARTUP_TIMEOUT=5' -DDEBUG '-DLSE_STARTUP_TIMEOUT=5000' '-DLSE_VALUE=32768' '-DHSE_STARTUP_TIMEOUT=5000' '-DDATA_CACHE_ENABLE=1' '-DVDD_VALUE=3300' '-DINSTRUCTION_CACHE_ENABLE=1' '-DEXTERNAL_CLOCK_VALUE=48000' -DUSE_FULL_LL_DRIVER '-DPREFETCH_ENABLE=0' -c -I../Core/Inc -I../Drivers/STM32G0xx_HAL_Driver/Inc -I../Drivers/CMSIS/Device/ST/STM32G0xx/Include -I../Drivers/CMSIS/Include -O0 -ffunction-sections -fdata-sections -Wall -fstack-usage -MMD -MP -MF"Core/Src/system_stm32g0xx.d" -MT"Core/Src/system_stm32g0xx.o" --specs=nano.specs -mfloat-abi=soft -mthumb -o "Core/Src/system_stm32g0xx.o"
<command-line>:0:0: warning: "HSE_STARTUP_TIMEOUT" redefined
<command-line>:0:0: note: this is the location of the previous definition>

Just to add to follow up. This work around did not worked completely, the code compiles, but it does not work on the target.

Had to roll back to the previous FW version to continue development.

What problems did you encounter? So I can keep an eye out for them