I am trying to use the mbed_app.json file to create a bootloader .bin file. Using the mbed_app.json file to restrict the app size with target.restrict_size
makes the compilation crash at the very end every time.
When my mbed_app.json file looks like this:
{
"target_overrides": {
"MAX32630FTHR": {
"target.restrict_size": "0x4000"
}
}
}
I get the following errors and warnings at the end of compilation:
Compile [100.0%]: USBPhy_Maxim.cpp
Link: bootloader
[Warning] @0,0: L3912W: Option 'legacyalign' is deprecated.
[Warning] @0,0: L6803W: Relocation #REL:1 in BUILD/MAX32630FTHR/ARMC6/mbed-os/targets/TARGET_Maxim/TARGET_MAX32630/device/TOOLCHAIN_ARM_STD/startup_MAX3263x.o(.text) with respect to BUILD/MAX32630FTHR/ARMC6/mbed-os/platform/source/TARGET_CORTEX_M
/TOOLCHAIN_ARM/except.o. Thumb Branch is unlikely to reach target inHardFault_Handler(.text).
[Warning] @0,0: L6803W: Relocation #REL:2 in BUILD/MAX32630FTHR/ARMC6/mbed-os/targets/TARGET_Maxim/TARGET_MAX32630/device/TOOLCHAIN_ARM_STD/startup_MAX3263x.o(.text) with respect to BUILD/MAX32630FTHR/ARMC6/mbed-os/platform/source/TARGET_CORTEX_M
/TOOLCHAIN_ARM/except.o. Thumb Branch is unlikely to reach target inMemManage_Handler(.text).
[Warning] @0,0: L6803W: Relocation #REL:3 in BUILD/MAX32630FTHR/ARMC6/mbed-os/targets/TARGET_Maxim/TARGET_MAX32630/device/TOOLCHAIN_ARM_STD/startup_MAX3263x.o(.text) with respect to BUILD/MAX32630FTHR/ARMC6/mbed-os/platform/source/TARGET_CORTEX_M/TOOLCHAIN_ARM/except.o. Thumb Branch is unlikely to reach target inBusFault_Handler(.text).
[Warning] @0,0: L6803W: Relocation #REL:4 in BUILD/MAX32630FTHR/ARMC6/mbed-os/targets/TARGET_Maxim/TARGET_MAX32630/device/TOOLCHAIN_ARM_STD/startup_MAX3263x.o(.text) with respect to BUILD/MAX32630FTHR/ARMC6/mbed-os/platform/source/TARGET_CORTEX_M/TOOLCHAIN_ARM/except.o. Thumb Branch is unlikely to reach target inUsageFault_Handler(.text).
[Warning] @0,0: L6803W: Relocation #REL:5 in BUILD/MAX32630FTHR/ARMC6/mbed-os/targets/TARGET_Maxim/TARGET_MAX32630/device/TOOLCHAIN_ARM_STD/startup_MAX3263x.o(.text) with respect to BUILD/MAX32630FTHR/ARMC6/mbed-os/cmsis/CMSIS_5/CMSIS/RTOS2/RTX/Source/TOOLCHAIN_ARM/TARGET_RTOS_M4_M7/irq_cm4f.o. Thumb Branch is unlikely to reach target inSVC_Handler(.text).
[Warning] @0,0: L6803W: Relocation #REL:7 in BUILD/MAX32630FTHR/ARMC6/mbed-os/targets/TARGET_Maxim/TARGET_MAX32630/device/TOOLCHAIN_ARM_STD/startup_MAX3263x.o(.text) with respect to BUILD/MAX32630FTHR/ARMC6/mbed-os/cmsis/CMSIS_5/CMSIS/RTOS2/RTX/Source/TOOLCHAIN_ARM/TARGET_RTOS_M4_M7/irq_cm4f.o. Thumb Branch is unlikely to reach target inPendSV_Handler(.text).
[Warning] @0,0: L6803W: Relocation #REL:8 in BUILD/MAX32630FTHR/ARMC6/mbed-os/targets/TARGET_Maxim/TARGET_MAX32630/device/TOOLCHAIN_ARM_STD/startup_MAX3263x.o(.text) with respect to BUILD/MAX32630FTHR/ARMC6/mbed-os/cmsis/CMSIS_5/CMSIS/RTOS2/RTX/Source/TOOLCHAIN_ARM/TARGET_RTOS_M4_M7/irq_cm4f.o. Thumb Branch is unlikely to reach target inSysTick_Handler(.text).
Elf2Bin: bootloader
[ERROR] Bootloader not supported on this target.
So then the obvious solution would be to set bootloader_supported to true. My embed_app.json then looks like this:
{
"target_overrides": {
"MAX32630FTHR": {
"target.restrict_size": "0x4000",
"target.bootloader_supported": true
}
}
}
The error I get at the end is a little different but still about the same:
[ERROR] Bootloader not supported on this target. ROM start not found in targets.json.
Removing the mbed_app.json file fixes it, spelling the name of the device wrong also fixes it. But I need to restrict the size to build a proper bootloader.
I use MBED Studio 14.1 with MBED OS 6.14. The MCU is a MAX32630(FTHR).
What could I be doing wrong here?