Skip to content

Commit

Permalink
on bundle-apps, include trailing erase
Browse files Browse the repository at this point in the history
  • Loading branch information
bradjc committed Mar 9, 2024
1 parent e398601 commit 49f9a09
Showing 1 changed file with 10 additions and 5 deletions.
15 changes: 10 additions & 5 deletions tockloader/tockloader.py
Original file line number Diff line number Diff line change
Expand Up @@ -1534,6 +1534,11 @@ def is_valid(slices):

app_bundle += app.get_binary(app_address)
app_address += app.get_size()

# Add blank at the end to make sure we clear the end of the list of
# apps.
app_bundle += bytes([0xFF] * 8)

logging.info(
"Installing app bundle. Size: {} bytes.".format(len(app_bundle))
)
Expand Down Expand Up @@ -1570,11 +1575,11 @@ def is_valid(slices):
self.channel.flash_binary(app_address, optional_binary)
app_address = app_address + app.get_size()

# Then erase the next page if we have not already rewritten all existing
# apps. This ensures that flash is clean at the end of the installed
# apps and makes sure the kernel will find the correct end of
# applications.
self.channel.clear_bytes(app_address)
# Then erase the next page if we have not already rewritten all
# existing apps. This ensures that flash is clean at the end of the
# installed apps and makes sure the kernel will find the correct end
# of applications.
self.channel.clear_bytes(app_address)

def _replace_with_padding(self, app):
"""
Expand Down

0 comments on commit 49f9a09

Please sign in to comment.