Skip to content

Commit 807ed53

Browse files
fredlee12001adbridge
authored andcommitted
Size should be calculate after confirm the start address
1 parent 63f1bd7 commit 807ed53

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

tools/config/__init__.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -980,10 +980,6 @@ 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
987983

988984
if self.target.app_offset:
989985
start = self._assign_new_offset(
@@ -992,6 +988,10 @@ def _generate_bootloader_build(self, rom_memories):
992988
"application",
993989
regions
994990
)
991+
new_size = int(self.target.restrict_size, 0)
992+
new_size = Config._align_floor(
993+
start + new_size, self.sectors
994+
) - start
995995

996996
yield Region("application", start, new_size, True, None)
997997
start += new_size

0 commit comments

Comments
 (0)