Skip to content

mgmt: mcumgr: grp: img_mgmt: Skip erased sectors when erasing #87555

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

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

nordicjm
Copy link
Collaborator

Skips erasing sectors that are already erased in a slot erase or image upload command

@zephyrbot zephyrbot requested a review from de-nordic March 24, 2025 11:10
@nordicjm nordicjm force-pushed the mcumgrimgmgmtslimerase branch 2 times, most recently from 2e02052 to 127ed09 Compare March 24, 2025 11:19
Skips erasing sectors that are already erased in a slot erase or
image upload command

Signed-off-by: Jamie McCrae <[email protected]>
@nordicjm nordicjm force-pushed the mcumgrimgmgmtslimerase branch from 127ed09 to 514cbbf Compare April 14, 2025 11:39
if (action.erase) {
#if defined(CONFIG_MCUMGR_GRP_IMG_IMAGE_SKIP_ERASED_SECTORS)
rc = img_mgmt_erase_pending_upload_slot();
Copy link
Collaborator

Choose a reason for hiding this comment

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

I am not sure this is correct. The erase here happens because img_mgmt_flash_check_empty(action->area_id); figured out that there is something in the slot, the problem is that this function will return true even for devices that do not require erase, but erase here is not to remove data (as image erase command does) but to prepare for write, in case of no-erase devices here we have actual opposite action - slowdown due to write operation that "erases" previous image.

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

Successfully merging this pull request may close these issues.

3 participants