From a88aaca74bd4cd9223db4563fe6c96f3ff68cae9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Alberto=20Garci=CC=81a=20Hierro?= Date: Sun, 20 Sep 2020 21:02:40 +0100 Subject: [PATCH] [CMAKE] Override .hex start address with 0x08000000 The configurator does rely on the .hex start address being set to 0x08000000. I'm not sure this is actually required and we should fix the configurator instead. However, in order to allow older versions of configurator to flash newer firmwares, we should the .hex files built with cmake compatible for at least some releases. --- cmake/stm32.cmake | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/cmake/stm32.cmake b/cmake/stm32.cmake index eed7a9dfa0..5d7db58f2e 100644 --- a/cmake/stm32.cmake +++ b/cmake/stm32.cmake @@ -189,7 +189,11 @@ endfunction() function(add_hex_target name exe hex) add_custom_target(${name} ALL cmake -E env PATH=$ENV{PATH} - ${CMAKE_OBJCOPY} -Oihex $ ${hex} + # TODO: Overriding the start address with --set-start 0x08000000 + # seems to be required due to some incorrect assumptions about .hex + # files in the configurator. Verify wether that's the case and fix + # the bug in configurator or delete this comment. + ${CMAKE_OBJCOPY} -Oihex --set-start 0x08000000 $ ${hex} BYPRODUCTS ${hex} ) endfunction()