Skip to content

Commit 66c21af

Browse files
taltenbachnordicjm
authored andcommitted
sim: Generate smallest possible oversized image
To generate oversized, the simulator needs to know the maximum image size. To obtain such size, the size of the TLV area is estimated and when using ECDSA, the actual size of the TLV area in the generated image was not always equal to the estimated size. This required to add a bit more data than what should be necessary when creating oversized images, to ensure the generated images will actually be oversized in most cases. Thanks to the previous commit, this is no more necessary and it is now possible to reliably generate oversized images with the smallest size. Signed-off-by: Thomas Altenbach <thomas.altenbach@legrand.com>
1 parent 639a1ec commit 66c21af

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

sim/src/image.rs

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1884,9 +1884,8 @@ fn install_image(flash: &mut SimMultiFlash, areadesc: &AreaDesc, slot: &SlotInfo
18841884

18851885
info!("slot: 0x{:x}, HDR: 0x{:x}, trailer: 0x{:x}",
18861886
slot_len, HDR_SIZE, trailer);
1887-
// the overflow size is rougly estimated to work for all
1888-
// configurations. It might be precise if tlv_len will be maked precise.
1889-
slot_len - HDR_SIZE - trailer - tlv_len - sector_offset + dev.align()*4
1887+
1888+
slot_len - HDR_SIZE - trailer - tlv_len - sector_offset + dev.align()
18901889
}
18911890

18921891
};

0 commit comments

Comments
 (0)