Skip to content
Snippets Groups Projects
Unverified Commit 7dad2e70 authored by Gaëtan Harter's avatar Gaëtan Harter Committed by cladmi
Browse files

cortexm_common/ldscript: allow defining FW_ROM_SIZE

Allow defining a specific rom length to use for linking the firmware,
_fw_rom_length, instead of the default configuration to use the whole rom from
_rom_offset to the end.

 * Add cortexm_common/Makefile.include FW_ROM_SIZE configuration
 * Add an assertion that _fw_rom_length still respects _rom_length
parent 642f5f24
No related branches found
No related tags found
No related merge requests found
......@@ -21,3 +21,5 @@ endif
# ROM_OFFSET: offset in rom to start linking, allows supporting a bootloader
LINKFLAGS += $(if $(ROM_OFFSET),$(LINKFLAGPREFIX)--defsym=_rom_offset=$(ROM_OFFSET))
# FW_ROM_LEN: rom length to use for firmware linking. Allows linking only in a section of the rom.
LINKFLAGS += $(if $(FW_ROM_LEN),$(LINKFLAGPREFIX)--defsym=_fw_rom_length=$(FW_ROM_LEN))
......@@ -21,7 +21,9 @@
*/
_rom_offset = DEFINED( _rom_offset ) ? _rom_offset : 0x0;
_fw_rom_length = _rom_length - _rom_offset;
_fw_rom_length = DEFINED( _fw_rom_length ) ? _fw_rom_length : _rom_length - _rom_offset;
ASSERT((_fw_rom_length <= _rom_length - _rom_offset), "Specified firmware size does not fit in ROM");
MEMORY
{
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment