Skip to content

Conversation

@nordicjm
Copy link
Contributor

@nordicjm nordicjm commented Dec 4, 2023

Prevents the user from potentially bricking a device by erasing
the MCUboot or currently running application flash areas with the
mcuboot erase command

Fixes #60443

@zephyrbot zephyrbot added Release Notes To be mentioned in the release notes area: DFU Device Firmware Upgrade labels Dec 4, 2023
@nordicjm nordicjm force-pushed the fixmcubootshellbrick branch 2 times, most recently from 7ed066d to 127b674 Compare December 4, 2023 15:55
@nordicjm nordicjm assigned de-nordic and unassigned MaureenHelm Dec 4, 2023
de-nordic
de-nordic previously approved these changes Dec 4, 2023
Prevents the user from potentially bricking a device by erasing
the MCUboot or currently running application flash areas with the
mcuboot erase command

Signed-off-by: Jamie McCrae <[email protected]>
Adds a note that the shell mcuboot erase command can no
longer erase the MCUboot or application slots

Signed-off-by: Jamie McCrae <[email protected]>
@fabiobaltieri fabiobaltieri merged commit 227905a into zephyrproject-rtos:main Dec 7, 2023
@nordicjm nordicjm deleted the fixmcubootshellbrick branch December 12, 2023 14:43
@TirelessDev
Copy link

Hey @nordicjm, sorry to dig up an old PR, but this appears to break in situations when partition manager is in play because the dts specified partitions do not match those in the flash map which is used to perform the erase. As it occurs in my own project the external flash area turns out to be area 1 while the internal active partition is actually area 3. This clashes with the defines generated from the device tree which place the active partition as area 1 and thus the erase is blocked.

Are there any tricks I am missing that might address this mismatch?

@nordicjm
Copy link
Contributor Author

Hey @nordicjm, sorry to dig up an old PR, but this appears to break in situations when partition manager is in play because the dts specified partitions do not match those in the flash map which is used to perform the erase. As it occurs in my own project the external flash area turns out to be area 1 while the internal active partition is actually area 3. This clashes with the defines generated from the device tree which place the active partition as area 1 and thus the erase is blocked.

Are there any tricks I am missing that might address this mismatch?

nrfconnect/sdk-zephyr#2114 should fix the issues you are seeing

@TirelessDev
Copy link

Legend, cheers!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area: DFU Device Firmware Upgrade Release Notes To be mentioned in the release notes

Projects

None yet

Development

Successfully merging this pull request may close these issues.

mcuboot: shell: erase: Allows deleting current image and breaking device

6 participants