SOLVED: STM32F407IG Build Error
Posted: Thu Mar 27, 2025 3:31 pm
I'm committed to a project using the STM32F407IG MCU, though the project wouldn't build to Hex file and I don't think I'm doing anything stupidly obvious (don't quote me on that
). I haven't encountered such issues before for other/smaller MCUs of the STM32F407... family.
I then stripped out all macros and components and merely stuck a basic loop at the start of a barebones project, but it still doesn't build.
Initialisation parameters in build options are taken directly from CubeMX (without clock issues), leading me to suspect an issue elsewhere.
I provide the basic source project and compiler report for investigation, hoping this is something simple and can be resolved quite soon.
Thanks and regards,
Brendan
Using FCD settings for compiler
Launching the compiler...
C:\ProgramData\MatrixTSL\FlowcodeV10\FCD\ARM\batch\stm32comp.bat "BUILD_ERROR_DEBUG_STM32F407IG" "C:\PROJECTS\Futura\Flowcode\" "32F407xx" "F4" "stm32f_ccm64.ld" "16000000" "1024K" "128K" "C:\Program Files (x86)\Flowcode\Common\Compilers\starm\\"
C:\PROJECTS\Futura\Flowcode>REM CRC: 1CECFE3DB3A1BD5169AEA98AD43ADE631EF0A88FFA736FBD84BE44176323F463C8515F4CD0D20BEBDFE06A9E70103FA105C640EF477B79E0C7881D2E5EEC9BD69A0D46BD3B6AACB92DE4D84759EBB5079CA9DA2D2BBCDAE2A4D1C56CD1580BF532505B4DECBAEAC96954F191918D76F05058F85C62E78168DB2117B7F66DFFAB9D4CD39D9819A47B593E224EEC6BA2B1CF18B22880D87C51B667E8BA6E12E6B26FA06B6F4F108199331CCC4A9A2DADF899B5E4011DBDD5202C3050DA273BE4EEBA213254BC0AD6E15FDF8E24F7A49525E37122B659B22A01CA71203F3D907500295E1D946A835C79
C:\PROJECTS\Flowcode>REM REVISION: 1.0
C:\PROJECTS\Flowcode>REM GUID: E810EE73-4726-4718-B23E-B579C5ADBC40
C:\PROJECTS\Flowcode>REM DATE: 08\08\2022
C:\PROJECTS\Flowcode>REM DIR: FCD\ARM\batch\stm32comp.bat
Project BUILD_ERROR_DEBUG_STM32F407IG
Device STM32F407xx
C:\PROJECTS\Flowcode>arm-none-eabi-gcc -mcpu=cortex-m4 -mthumb -mfloat-abi=hard -mfpu=fpv4-sp-d16 -Os -DSTM32 -DSTM32F4 -DSTM32F407xx -DUSE_HAL_DRIVER -DHSE_VALUE=16000000 -I"C:\Program Files (x86)\Flowcode\Common\Compilers\starm\\stm32cubeF4\Drivers\CMSIS\Include" -I"C:\Program Files (x86)\Flowcode\Common\Compilers\starm\\stm32cubeF4\Drivers\CMSIS\Device\ST\STM32F4xx\Include" -I"C:\Program Files (x86)\Flowcode\Common\Compilers\starm\\stm32cubeF4\Drivers\STM32F4xx_HAL_Driver\Inc" -I"C:\Program Files (x86)\Flowcode\Common\Compilers\starm\\stm32cubeF4\Drivers\STM32F4xx_HAL_Driver\Inc\Legacy" -I"C:\Program Files (x86)\Flowcode\Common\Compilers\starm\\inc" -fmessage-length=0 -fdata-sections -ffunction-sections -w -c "BUILD_ERROR_DEBUG_STM32F407IG.c" -o "BUILD_ERROR_DEBUG_STM32F407IG_STM32F407xx_16000000\BUILD_ERROR_DEBUG_STM32F407IG.o"
BUILD_ERROR_DEBUG_STM32F407IG.c:74:80: error: invalid initializer
MX_GLOBAL MX_UINT32 FCV_GAUGE_MEASVALSRAW_PREV[FCVsz_GAUGE_MEASVALSRAW_PREV] = 0; // Records the previous gauge measurement values for compare to new
Error(s) in build
C:\ProgramData\MatrixTSL\FlowcodeV10\FCD\ARM\batch\stm32comp.bat reported error code 0x1
Autoclose turned off
FINISHED

I then stripped out all macros and components and merely stuck a basic loop at the start of a barebones project, but it still doesn't build.
Initialisation parameters in build options are taken directly from CubeMX (without clock issues), leading me to suspect an issue elsewhere.
I provide the basic source project and compiler report for investigation, hoping this is something simple and can be resolved quite soon.
Thanks and regards,
Brendan
Using FCD settings for compiler
Launching the compiler...
C:\ProgramData\MatrixTSL\FlowcodeV10\FCD\ARM\batch\stm32comp.bat "BUILD_ERROR_DEBUG_STM32F407IG" "C:\PROJECTS\Futura\Flowcode\" "32F407xx" "F4" "stm32f_ccm64.ld" "16000000" "1024K" "128K" "C:\Program Files (x86)\Flowcode\Common\Compilers\starm\\"
C:\PROJECTS\Futura\Flowcode>REM CRC: 1CECFE3DB3A1BD5169AEA98AD43ADE631EF0A88FFA736FBD84BE44176323F463C8515F4CD0D20BEBDFE06A9E70103FA105C640EF477B79E0C7881D2E5EEC9BD69A0D46BD3B6AACB92DE4D84759EBB5079CA9DA2D2BBCDAE2A4D1C56CD1580BF532505B4DECBAEAC96954F191918D76F05058F85C62E78168DB2117B7F66DFFAB9D4CD39D9819A47B593E224EEC6BA2B1CF18B22880D87C51B667E8BA6E12E6B26FA06B6F4F108199331CCC4A9A2DADF899B5E4011DBDD5202C3050DA273BE4EEBA213254BC0AD6E15FDF8E24F7A49525E37122B659B22A01CA71203F3D907500295E1D946A835C79
C:\PROJECTS\Flowcode>REM REVISION: 1.0
C:\PROJECTS\Flowcode>REM GUID: E810EE73-4726-4718-B23E-B579C5ADBC40
C:\PROJECTS\Flowcode>REM DATE: 08\08\2022
C:\PROJECTS\Flowcode>REM DIR: FCD\ARM\batch\stm32comp.bat
Project BUILD_ERROR_DEBUG_STM32F407IG
Device STM32F407xx
C:\PROJECTS\Flowcode>arm-none-eabi-gcc -mcpu=cortex-m4 -mthumb -mfloat-abi=hard -mfpu=fpv4-sp-d16 -Os -DSTM32 -DSTM32F4 -DSTM32F407xx -DUSE_HAL_DRIVER -DHSE_VALUE=16000000 -I"C:\Program Files (x86)\Flowcode\Common\Compilers\starm\\stm32cubeF4\Drivers\CMSIS\Include" -I"C:\Program Files (x86)\Flowcode\Common\Compilers\starm\\stm32cubeF4\Drivers\CMSIS\Device\ST\STM32F4xx\Include" -I"C:\Program Files (x86)\Flowcode\Common\Compilers\starm\\stm32cubeF4\Drivers\STM32F4xx_HAL_Driver\Inc" -I"C:\Program Files (x86)\Flowcode\Common\Compilers\starm\\stm32cubeF4\Drivers\STM32F4xx_HAL_Driver\Inc\Legacy" -I"C:\Program Files (x86)\Flowcode\Common\Compilers\starm\\inc" -fmessage-length=0 -fdata-sections -ffunction-sections -w -c "BUILD_ERROR_DEBUG_STM32F407IG.c" -o "BUILD_ERROR_DEBUG_STM32F407IG_STM32F407xx_16000000\BUILD_ERROR_DEBUG_STM32F407IG.o"
BUILD_ERROR_DEBUG_STM32F407IG.c:74:80: error: invalid initializer
MX_GLOBAL MX_UINT32 FCV_GAUGE_MEASVALSRAW_PREV[FCVsz_GAUGE_MEASVALSRAW_PREV] = 0; // Records the previous gauge measurement values for compare to new
Error(s) in build
C:\ProgramData\MatrixTSL\FlowcodeV10\FCD\ARM\batch\stm32comp.bat reported error code 0x1
Autoclose turned off
FINISHED