cancel
Showing results for 
Search instead for 
Did you mean: 

STM32CubeMX H743ZIT Makefile problems

David Bathurst
Associate III
Posted on July 03, 2018 at 00:08

I'm trying to build a simple 'hello world' program on the STM32H743 using the Makefile option and the standard Ubuntu arm-none-eabi-gcc V 4.9.3.  At this stage my program doesn't even do floating point, but it will eventually, so I'd like to get the h/w floating point working.    The link fails with:

/usr/lib/gcc/arm-none-eabi/4.9.3/../../../arm-none-eabi/bin/ld: failed to merge target specific data of file build/stm32h7xx_hal_i2c.o

/usr/lib/gcc/arm-none-eabi/4.9.3/../../../arm-none-eabi/bin/ld: error: build/stm32h7xx_hal_rcc_ex.o uses VFP register arguments, build/test_H7.elf does not

Every object gets listed with the above error, I've just used stm32h7xx_hal_rcc_ex.o as an example.  All objects get compiled with:  -mcpu=cortex-m7 -mthumb -mfpu=fpv5-d16 -mfloat-abi=hard  as per the switches in the Makefile generated by CubeMX (V 4.25.1)  The STM32Cube MCU Package for STM32H7 is version 1.2.0.

2 REPLIES 2
Posted on July 03, 2018 at 00:21

So sounds like the compiler builds the objects properly. Focus the settings the linker is using.

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..
Posted on July 03, 2018 at 01:10

Using 4.9.3 under Windows to build for the STM32H743I-EVAL, something based on the HAL UART demo rather than CubeMX stuff.

Assembling file: startup_stm32h743xx.s

arm-none-eabi-gcc -x assembler-with-cpp -c -mcpu=cortex-m7 -mthumb -mfpu=fpv5-d16 -mfloat-abi=hard -g -ggdb3 -Wa,-amhls=out/startup_stm32h743xx.lst  -DUSE_HAL_DRIVER  -DSTM32H743xx  -DUSE_STM32H743I_EVAL  -MD -MP -MF out/startup_stm32h743xx.d -I.  -Iinc startup_stm32h743xx.s -o out/startup_stm32h743xx.o

Linking target: out/demo.elf

arm-none-eabi-g++ -mcpu=cortex-m7 -mthumb -mfpu=fpv5-d16 -mfloat-abi=hard -TSTM32H743XIHx_FLASH.ld -g -Wl,-Map=out/demo.map,--cref,--no-warn-mismatch -Wl,--gc-sections -nostartfiles  out/startup_stm32h743xx.o out/main.o out/stm32h743i_eval.o out/stm32h7xx_hal.o out/stm32h7xx_hal_cortex.o out/stm32h7xx_hal_gpio.o out/stm32h7xx_hal_msp.o out/stm32h7xx_hal_rcc.o out/stm32h7xx_hal_rcc_ex.o out/stm32h7xx_hal_uart.o out/stm32h7xx_it.o out/syscalls.o out/system_stm32h7xx.o    -o out/demo.elf

Creating extended listing: out/demo.lss

arm-none-eabi-objdump -S out/demo.elf > out/demo.lss

Creating memory dump: out/demo.dmp

arm-none-eabi-objdump -x --syms out/demo.elf > out/demo.dmp

Creating IHEX image: out/demo.hex

arm-none-eabi-objcopy -O ihex out/demo.elf out/demo.hex

Creating binary image: out/demo.bin

arm-none-eabi-objcopy -O binary out/demo.elf out/demo.bin

Size of modules:

arm-none-eabi-size -B -t --common out/startup_stm32h743xx.o out/main.o out/stm32h743i_eval.o out/stm32h7xx_hal.o out/stm32h7xx_hal_cortex.o out/stm32h7xx_hal_gpio.o out/stm32h7xx_hal_msp.o out/stm32h7xx_hal_rcc.o out/stm32h7xx_hal_rcc_ex.o out/stm32h7xx_hal_uart.o out/stm32h7xx_it.o out/syscalls.o out/system_stm32h7xx.o

   text    data     bss     dec     hex filename

    786       0       0     786     312 out/startup_stm32h743xx.o

   2516       0     128    2644     a54 out/main.o

   1676      24     176    1876     754 out/stm32h743i_eval.o

   1250       5       4    1259     4eb out/stm32h7xx_hal.o

    646       0       0     646     286 out/stm32h7xx_hal_cortex.o

    902       0       0     902     386 out/stm32h7xx_hal_gpio.o

    212       0       0     212      d4 out/stm32h7xx_hal_msp.o

   2734       0       0    2734     aae out/stm32h7xx_hal_rcc.o

   5288       0       0    5288    14a8 out/stm32h7xx_hal_rcc_ex.o

   5448       0       0    5448    1548 out/stm32h7xx_hal_uart.o

     18       0       0      18      12 out/stm32h7xx_it.o

    272       4       8     284     11c out/syscalls.o

    424       8       0     432     1b0 out/system_stm32h7xx.o

  22172      41     316   22529    5801 (TOTALS)

Size of target .elf file:

arm-none-eabi-size -B out/demo.elf

   text    data     bss     dec     hex filename

  34760    2228    1732   38720    9740 out/demo.elf
Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..