mcauser / BLACK_F407VE

MicroPython board definition for the MCUDev Black STM32F407VET6 board
MIT License
122 stars 47 forks source link

Build failure - make: *** [build-BLACK_F407VE/firmware.elf] Error 1 #1

Closed peddamat closed 5 years ago

peddamat commented 6 years ago

Hello,

First, thank you for compiling this package!

I found a minor bug in your build instructions, and the MicroPython build system is a bit too involved for me to quickly fix.

I have to run "make BOARD=BLACK_F407VE" twice to complete the build successfully. For some reason the HAL drivers are not built during the first pass.

Here is the relevant stack trace:

LINK build-BLACK_F407VE/firmware.elf arm-none-eabi-ld: cannot find build-BLACK_F407VE/lib/stm32lib/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal.o: No such file or directory arm-none-eabi-ld: cannot find build-BLACK_F407VE/lib/stm32lib/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_adc.o: No such file or directory arm-none-eabi-ld: cannot find build-BLACK_F407VE/lib/stm32lib/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_adc_ex.o: No such file or directory arm-none-eabi-ld: cannot find build-BLACK_F407VE/lib/stm32lib/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_cortex.o: No such file or directory arm-none-eabi-ld: cannot find build-BLACK_F407VE/lib/stm32lib/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_dac.o: No such file or directory arm-none-eabi-ld: cannot find build-BLACK_F407VE/lib/stm32lib/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_dac_ex.o: No such file or directory arm-none-eabi-ld: cannot find build-BLACK_F407VE/lib/stm32lib/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_dma.o: No such file or directory arm-none-eabi-ld: cannot find build-BLACK_F407VE/lib/stm32lib/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_flash.o: No such file or directory arm-none-eabi-ld: cannot find build-BLACK_F407VE/lib/stm32lib/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_flash_ex.o: No such file or directory arm-none-eabi-ld: cannot find build-BLACK_F407VE/lib/stm32lib/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_gpio.o: No such file or directory arm-none-eabi-ld: cannot find build-BLACK_F407VE/lib/stm32lib/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_i2c.o: No such file or directory arm-none-eabi-ld: cannot find build-BLACK_F407VE/lib/stm32lib/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_pcd.o: No such file or directory arm-none-eabi-ld: cannot find build-BLACK_F407VE/lib/stm32lib/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_pcd_ex.o: No such file or directory arm-none-eabi-ld: cannot find build-BLACK_F407VE/lib/stm32lib/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_pwr.o: No such file or directory arm-none-eabi-ld: cannot find build-BLACK_F407VE/lib/stm32lib/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_pwr_ex.o: No such file or directory arm-none-eabi-ld: cannot find build-BLACK_F407VE/lib/stm32lib/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_rcc.o: No such file or directory arm-none-eabi-ld: cannot find build-BLACK_F407VE/lib/stm32lib/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_rcc_ex.o: No such file or directory arm-none-eabi-ld: cannot find build-BLACK_F407VE/lib/stm32lib/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_rtc.o: No such file or directory arm-none-eabi-ld: cannot find build-BLACK_F407VE/lib/stm32lib/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_rtc_ex.o: No such file or directory arm-none-eabi-ld: cannot find build-BLACK_F407VE/lib/stm32lib/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_sd.o: No such file or directory arm-none-eabi-ld: cannot find build-BLACK_F407VE/lib/stm32lib/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_spi.o: No such file or directory arm-none-eabi-ld: cannot find build-BLACK_F407VE/lib/stm32lib/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_tim.o: No such file or directory arm-none-eabi-ld: cannot find build-BLACK_F407VE/lib/stm32lib/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_tim_ex.o: No such file or directory arm-none-eabi-ld: cannot find build-BLACK_F407VE/lib/stm32lib/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_uart.o: No such file or directory arm-none-eabi-ld: cannot find build-BLACK_F407VE/lib/stm32lib/STM32F4xx_HAL_Driver/Src/stm32f4xx_ll_sdmmc.o: No such file or directory arm-none-eabi-ld: cannot find build-BLACK_F407VE/lib/stm32lib/STM32F4xx_HAL_Driver/Src/stm32f4xx_ll_usb.o: No such file or directory arm-none-eabi-ld: cannot find build-BLACK_F407VE/lib/stm32lib/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_can.o: No such file or directory Makefile:439: recipe for target 'build-BLACK_F407VE/firmware.elf' failed make: *** [build-BLACK_F407VE/firmware.elf] Error 1 me@NONCE:~/micropython/ports/stm32$ make BOARD=BLACK_F407VE Use make V=1 or set BUILD_VERBOSE in your environment to increase build verbosity. CC ../../lib/stm32lib/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal.c CC ../../lib/stm32lib/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_adc.c CC ../../lib/stm32lib/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_adc_ex.c CC ../../lib/stm32lib/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_cortex.c CC ../../lib/stm32lib/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_dac.c CC ../../lib/stm32lib/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_dac_ex.c CC ../../lib/stm32lib/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_dma.c CC ../../lib/stm32lib/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_flash.c CC ../../lib/stm32lib/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_flash_ex.c CC ../../lib/stm32lib/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_gpio.c CC ../../lib/stm32lib/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_i2c.c CC ../../lib/stm32lib/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_pcd.c CC ../../lib/stm32lib/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_pcd_ex.c CC ../../lib/stm32lib/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_pwr.c CC ../../lib/stm32lib/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_pwr_ex.c CC ../../lib/stm32lib/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_rcc.c CC ../../lib/stm32lib/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_rcc_ex.c CC ../../lib/stm32lib/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_rtc.c CC ../../lib/stm32lib/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_rtc_ex.c CC ../../lib/stm32lib/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_sd.c CC ../../lib/stm32lib/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_spi.c CC ../../lib/stm32lib/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_tim.c CC ../../lib/stm32lib/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_tim_ex.c CC ../../lib/stm32lib/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_uart.c CC ../../lib/stm32lib/STM32F4xx_HAL_Driver/Src/stm32f4xx_ll_sdmmc.c CC ../../lib/stm32lib/STM32F4xx_HAL_Driver/Src/stm32f4xx_ll_usb.c CC ../../lib/stm32lib/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_can.c LINK build-BLACK_F407VE/firmware.elf arm-none-eabi-ld: warning: cannot find entry symbol _start; defaulting to 0000000000008000 text data bss dec hex filename 0 0 0 0 0 build-BLACK_F407VE/firmware.elf Create build-BLACK_F407VE/firmware.dfu GEN build-BLACK_F407VE/firmware.hex me@NONCE:~/micropython/ports/stm32$

peddamat commented 6 years ago

A quick update, I noticed that the firmware. files were tiny compared to the firmware. files generated by the other builds.

Recompiling with the V=1 option revealed that the linker isn't finding the "_start" symbol, so the optimizer is probably optimizing out all of the code:

BLACK_F407VE.o /usr/lib/gcc/arm-none-eabi/4.9.3/armv7e-m/fpu/libgcc.a arm-none-eabi-ld: warning: cannot find entry symbol _start; defaulting to 0000000000008000 arm-none-eabi-size build-BLACK_F407VE/firmware.elf text data bss dec hex filename 0 0 0 0 0 build-BLACK_F407VE/firmware.elf Create build-BLACK_F407VE/firmware.dfu arm-none-eabi-objcopy -O binary -j .isr_vector -j .text -j .data build-BLACK_F407VE/firmware.elf build-BLACK_F407VE/firmware.bin python ../../tools/dfu.py -b 0x08000000:build-BLACK_F407VE/firmware.bin build-BLACK_F407VE/firmware.dfu GEN build-BLACK_F407VE/firmware.hex arm-none-eabi-objcopy -O ihex build-BLACK_F407VE/firmware.elf build-BLACK_F407VE/firmware.hex

peddamat commented 6 years ago

Hello,

After a bit more poking around, here's the fix. The BLACKF407VE/mpconfigboard.mk needs to be updated to the following:

MCU_SERIES = f4 CMSIS_MCU = STM32F407xx AF_FILE = boards/stm32f405_af.csv LD_FILES = boards/stm32f405.ld boards/common_ifs.ld TEXT0_ADDR = 0x08000000 TEXT1_ADDR = 0x08020000