Skip to content

Commit 8a92271

Browse files
authored
Merge pull request #10448 from fredlee12001/master
Size should be calculate after confirm the final start address
2 parents 56086d0 + 38e088e commit 8a92271

File tree

1 file changed

+4
-5
lines changed

1 file changed

+4
-5
lines changed

tools/config/__init__.py

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -980,18 +980,17 @@ def _generate_bootloader_build(self, rom_memories):
980980
yield region._replace(filename=self.target.header_format)
981981

982982
if self.target.restrict_size is not None:
983-
new_size = int(self.target.restrict_size, 0)
984-
new_size = Config._align_floor(
985-
start + new_size, self.sectors
986-
) - start
987-
988983
if self.target.app_offset:
989984
start = self._assign_new_offset(
990985
rom_start,
991986
self.target.app_offset,
992987
"application",
993988
regions
994989
)
990+
new_size = int(self.target.restrict_size, 0)
991+
new_size = Config._align_floor(
992+
start + new_size, self.sectors
993+
) - start
995994

996995
yield Region("application", start, new_size, True, None)
997996
start += new_size

0 commit comments

Comments
 (0)