SOLVED: STM32F407IG Build Error

Any bugs you encounter with Flowcode should be discussed here.
Post Reply
Brendan
Posts: 54
http://meble-kuchenne.info.pl
Joined: Tue Dec 08, 2020 2:12 pm
Has thanked: 42 times
Been thanked: 11 times

SOLVED: STM32F407IG Build Error

Post by Brendan »

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 :lol: ). 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
Flowcode_Build_Issue_STM32F407IG_27-03-25-A.png
Flowcode_Build_Issue_STM32F407IG_27-03-25-A.png (151.7 KiB) Viewed 1755 times
BUILD_ERROR_DEBUG_STM32F407IG.fcfx
(14.37 KiB) Downloaded 6 times
Last edited by Brendan on Thu Mar 27, 2025 4:57 pm, edited 1 time in total.

stefan.erni
Valued Contributor
Posts: 997
Joined: Wed Dec 02, 2020 10:53 am
Has thanked: 190 times
Been thanked: 217 times

Re: STM32F407IG - Build Error

Post by stefan.erni »

Hi Brendan

I also get an error
There is a problem with these variables. I have deleted these, then I can compile it

2025-03-27_17-03-37.PNG
2025-03-27_17-03-37.PNG (47.52 KiB) Viewed 1743 times

Brendan
Posts: 54
Joined: Tue Dec 08, 2020 2:12 pm
Has thanked: 42 times
Been thanked: 11 times

Re: STM32F407IG - Build Error

Post by Brendan »

Many thanks Stefan!

I'll revisit the vars to see if there's anything obvious with them, and a successful duplication and rebuild of the same barebones project and settings confirm what you say.

I suspect something had a hiccup somewhere along the way (e.g. accepted illegal initialiser, or something like that), and thank you again. Entirely appreciated, and a great relief!

Best regards,
Brendan

stefan.erni
Valued Contributor
Posts: 997
Joined: Wed Dec 02, 2020 10:53 am
Has thanked: 190 times
Been thanked: 217 times

Re: STM32F407IG - Build Error

Post by stefan.erni »

Hi Brendan

Any time again.

I think it's just this initial value of the array. Do not use a value
Attachments
2025-03-27_17-16-12.PNG
2025-03-27_17-16-12.PNG (32.29 KiB) Viewed 1730 times

Brendan
Posts: 54
Joined: Tue Dec 08, 2020 2:12 pm
Has thanked: 42 times
Been thanked: 11 times

Re: STM32F407IG - Build Error

Post by Brendan »

Thanks Stefan.

Indeed, your finding is ahead of me, and aware that arrays can only be initialised using (e.g.) syntax { 0,0,0,0 }, I'm not sure where the single '0' came from, or how that got past the gatekeeper if my own fault.

Anyway, thank you again, and lesson learned for future reference :)

Best regards,
Brendan

Post Reply