Skip to content

Commit 28c5088

Browse files
committed
bl_update: ensure flash is padded to 32 bytes
on some MCUs the bootloader will refuse to load when not multiple of 8 or larger
1 parent 9ad7f3b commit 28c5088

2 files changed

Lines changed: 14 additions & 0 deletions

File tree

bl_update/ldscript_bl.ld

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -123,6 +123,13 @@ SECTIONS
123123
. = ALIGN(8);
124124
} >RAM
125125

126+
/* Ensure flash content is padded to 32 bytes with 0xFF */
127+
.padding :
128+
{
129+
. = ALIGN(32);
130+
BYTE(0xFF); . = ALIGN(32);
131+
} >FLASH
132+
126133
/* Remove information from the standard libraries */
127134
/DISCARD/ :
128135
{

bl_update/ldscript_bl_CAN.ld

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -125,6 +125,13 @@ SECTIONS
125125
. = ALIGN(8);
126126
} >RAM
127127

128+
/* Ensure flash content is padded to 32 bytes with 0xFF */
129+
.padding :
130+
{
131+
. = ALIGN(32);
132+
BYTE(0xFF); . = ALIGN(32);
133+
} >FLASH
134+
128135
/* Remove information from the standard libraries */
129136
/DISCARD/ :
130137
{

0 commit comments

Comments
 (0)