Skip to content
This repository has been archived by the owner on Mar 24, 2024. It is now read-only.

extflash_erase target #143

Merged
merged 4 commits into from
Sep 6, 2021
Merged

extflash_erase target #143

merged 4 commits into from
Sep 6, 2021

Conversation

BrianPugh
Copy link
Contributor

No description provided.

fi

# Create dummy file with 0xFF of the size extflash
/usr/bin/env python3 -c "with open('${DUMMY_FILE}', 'wb') as f: f.write(b'\xFF'*${EXTFLASH_SIZE})"
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It'll be enough with 256 bytes because when you invoke flashapp like you do below, you will perform a Chip Erase. I guess the help text can be improved :).

flashapp.sh <binary to flash> [address in flash] [size] [erase=1] [erase_bytes=0] [chunk_idx] [chunk_count]
'erase_bytes': Number of bytes to erase, all if '0'. Default '0'.

It felt like a good idea to have it like so when starting out but maybe that might change in the future, so it could be a good idea to make it explicit:

# Create dummy file with one page of 0xFF.
SIZE = 256
/usr/bin/env python3 -c "with open('${DUMMY_FILE}', 'wb') as f: f.write(b'\xFF'*${SIZE})"

# Flash it to start of the extflash and perform a Chip Erase
${FLASHAPP} "${DUMMY_FILE}"  0 ${SIZE} 1 0

@kbeckmann kbeckmann merged commit 2ac8ff2 into kbeckmann:main Sep 6, 2021
@BrianPugh BrianPugh deleted the extflash_erase branch October 8, 2021 23:03
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants