-
Notifications
You must be signed in to change notification settings - Fork 7.5k
"ninja flash" cannot be used with DFU-capable applications #6147
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
Perhaps this can be resolved by NOT erasing the entire flash when "ninja flash" is executed, but I don't understand why we are erasing it in the first place so I can't comment on if this is the correct approach ... |
@mbolivar : FYI |
@SebastianBoe I've been out sick for a few days, but am working on these issues |
The entire flash is not erased by the application build system on the targets I use (pyOCD backend, but I've tested dfu-util in the past as well). Could this be an artifact of your runner? I assume you are using nrfjprog. |
@mbolivar : Yes, I believe this is nrfjprog-specific, I thought I saw a patch go in recently that modified the nrfjprog runner to do erase-all, but I can't see evidence of this in the git history. If pyOCD does not do erase-all then I definitely think the nrfjprog runner should align to not doing erase-all. Perhaps this would be as simple as removing this line:
from nrfjprog.py |
OK! I can send a patch to make that optional (the way it is with e.g. jlink.py) if nrfjprog will still erase the sectors needed for the image it's flashing -- can you confirm that's the case? |
Sorry, there was a miscommunication. In addition to removing "--erase-all", "--sectorerase" must be appended to the "--program" command. It will ensure just the necessary pages are erased. |
By default, use a sector erase to flash boards with nrfjprog.py. To allow getting the old behavior, add an --erase flag that works the exact same way as the corresponding jlink.py argument: if present, a full flash erase is done before programming. If absent, only a sector erase is done. Fixes zephyrproject-rtos#6147 Signed-off-by: Marti Bolivar <[email protected]> Signed-off-by: Carles Cufi <[email protected]>
By default, use a sector erase to flash boards with nrfjprog.py. To allow getting the old behavior, add an --erase flag that works the exact same way as the corresponding jlink.py argument: if present, a full flash erase is done before programming. If absent, only a sector erase is done. Fixes zephyrproject-rtos/zephyr#6147 Signed-off-by: Marti Bolivar <[email protected]> Signed-off-by: Carles Cufi <[email protected]>
Reopening since the west change is not in zephyr's copy of west yet -- it's a new feature, so not eligible for merge now. |
@mbolivar still an issue? |
Not relevant anymore (comment from @carlescufi) |
Uh oh!
There was an error while loading. Please reload this page.
Hi,
as a user, when I do
The second flash command will erase the bootloader written during the first flash command.
This makes "ninja flash" useless for applications that use a bootloader.
"ninja flash" is a useful feature that should be preserved for DFU-able applications.
The text was updated successfully, but these errors were encountered: