Skip to content

Commit e31ea41

Browse files
authored
Merge pull request ARMmbed#103 from juhoeskeli/IOTUC-333
Fix for erase size calculation when header is contiguous with app.
2 parents ddf74c6 + 98f9d57 commit e31ea41

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

source/active_application.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -257,7 +257,7 @@ bool eraseActiveFirmware(uint32_t firmwareSize)
257257
else /* header contiguous with app */
258258
{
259259
/* setup erase of the header + application region */
260-
size_needed = fw_metadata_hdr_size + firmwareSize;
260+
size_needed = (MBED_CONF_APP_APPLICATION_START_ADDRESS - FIRMWARE_METADATA_HEADER_ADDRESS) + firmwareSize;
261261
erase_start_addr = FIRMWARE_METADATA_HEADER_ADDRESS;
262262
}
263263

0 commit comments

Comments
 (0)