Skip to content

Commit e983896

Browse files
committed
Added check on SAM4E that flash memory has not overflowed
1 parent 5b1d665 commit e983896

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

src/Hardware/SAM4E/sam4e8e_flash.ld

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -120,6 +120,9 @@ SECTIONS
120120
_firmware_end = _etext + (_erelocate - _srelocate); /* Embedded files start here */
121121
_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 */
122122

123+
/* check that CRC is within flash memory */
124+
ASSERT(_firmware_crc + 4 <= ORIGIN(rom) + LENGTH(rom), "region ROM overflowed")
125+
123126
/* .bss section which is used for uninitialized data */
124127
.bss ALIGN(4) (NOLOAD) :
125128
{

0 commit comments

Comments
 (0)