firmwaremodules / stm32-secure-patching-bootloader

Secure Patching Bootloader and Firmware Update System for STM32 MCUs
Other
55 stars 12 forks source link

Bootloader interface won't link with applications built with STM32CubeIDE 1.9.0 #4

Closed firmwareguru closed 1 year ago

firmwareguru commented 2 years ago

Issue appears as linker error in following form during build:

...\ld.exe: cannot use executable file '...\stm32-secure-patching-bootloader-interface-gcc_xxxxx.o' as input to a link

Present in stm32-secure-patching-bootloader versions v1.2.0 and earlier.

firmwareguru commented 2 years ago

This is not a bug in the stm32-secure-patching-bootloader, but an issue introduced with ld in binutils 2.36 included with the updated toolchain with STM32CubeIDE 1.9.0.

In detail, a check was added to the ld linker to reject input elf/object files that have the type attribute ET_EXEC. This check was added as a result of this issue. It must be noted that the standard .elf output for microcontroller/embedded systems projects (at least for ARM cortex-M) builds static "executables" with the ET_EXEC type set. This issue raises the possibility that there are use cases for linking with ET_EXEC type elf files.

firmwareguru commented 1 year ago

Fixed release v1.3.0.

Solution is not to use linker at all. The Secure Engine callgate addresses are provided directly in the bootloader application linker file rather than through an object file.