diff options
author | David Crocker <dcrocker@eschertech.com> | 2022-10-01 13:08:17 +0300 |
---|---|---|
committer | David Crocker <dcrocker@eschertech.com> | 2022-10-01 13:08:17 +0300 |
commit | e983896d5d1e8f3b27fec56cc671eab4d36f5351 (patch) | |
tree | 80fddd994a05b7566842190d14ecd618c65516dd | |
parent | 5b1d665c7ad05bc14cda6d6ef7eaa3c33e35c82c (diff) |
Added check on SAM4E that flash memory has not overflowed
-rw-r--r-- | src/Hardware/SAM4E/sam4e8e_flash.ld | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/src/Hardware/SAM4E/sam4e8e_flash.ld b/src/Hardware/SAM4E/sam4e8e_flash.ld index e7fc0113..fa10bf24 100644 --- a/src/Hardware/SAM4E/sam4e8e_flash.ld +++ b/src/Hardware/SAM4E/sam4e8e_flash.ld @@ -120,6 +120,9 @@ SECTIONS _firmware_end = _etext + (_erelocate - _srelocate); /* Embedded files start here */ _firmware_crc = _firmware_end; /* We append the CRC32 to the binary file. This is its offset in memory if we don't append embedded files */ + /* check that CRC is within flash memory */ + ASSERT(_firmware_crc + 4 <= ORIGIN(rom) + LENGTH(rom), "region ROM overflowed") + /* .bss section which is used for uninitialized data */ .bss ALIGN(4) (NOLOAD) : { |