As stahta01 posted:
Step 1: Learn how the Compiler and Linker works using the normal two step process (compile then link as the two steps)
Step 2: Write the compile step on the command line so it works
Step 3: Write the linker step on the command line so it works
Step 4: Write the objcopy step on the command line so it works
Step 5: Post the commands that work on the command line so you can ask how to do this using Code::Blocks.
This is the first real information to work with:
single command line command produces a single output file: arm-none-eabi-gcc -g -v -O2 -Wall -Tstm32_flash.ld -mlittle-endian -mthumb -mcpu=cortex-m4 -mthumb-interwork -mfloat-abi=hard -mfpu=fpv4-sp-d16 -Iinc -Ilib -Ilib/inc -Ilib/inc/core -Ilib/inc/peripherals src/system_stm32f4xx.c src/main.c src/stm32f4xx_it.c lib/startup_stm32f4xx.s -o main.elf -Llib -lstm32f4
Next step: compile + link:
# compile
arm-none-eabi-gcc -c -g -v -O2 -Wall -mlittle-endian -mthumb -mcpu=cortex-m4 -mthumb-interwork -mfloat-abi=hard -mfpu=fpv4-sp-d16 -Iinc -Ilib -Ilib/inc -Ilib/inc/core -Ilib/inc/peripherals src/system_stm32f4xx.c src/main.c src/stm32f4xx_it.c lib/startup_stm32f4xx.s
#link
arm-none-eabi-gcc -Tstm32_flash.ld system_stm32f4xx.o main.o stm32f4xx_it.o startup_stm32f4xx.o -o main.elf -Llib -lstm32f4
... and post the result.
Edit:
...
((link))
arm-none-eabi-ld list-of-source-objectfilesfrom above -s -Tstm32_flash.ld ....libraries
((resultingerror))
main.o uses VFP register arguments, cbjh does not
((note: in CB compiler toolchain executables settings arm-none-eabi-ld is not set (arm-none-eabi-objcopy is set for static linker) yet somehow CB invokes ld and its this part that is causing the grief))
If it is not set for the toolchain, you'll probably find it in 'Advanced compiler options->Command line macros'. Use $linker instead of 'arm-none-eabi-ld'
- osdt