-
Notifications
You must be signed in to change notification settings - Fork 6.8k
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
drivers: flash: sam: fix flash erase last page #80800
base: main
Are you sure you want to change the base?
drivers: flash: sam: fix flash erase last page #80800
Conversation
The implementation for erasing pages in the flash_sam.c driver indicated a successful erase after exceeding the last page to be erased successfully. Since the last page has no proceeding page, the succeeded status was not set. This fix switches around the status to be set as succeeded before erase begins, to have the succeeded status cleared if page unlock or erase fails. Signed-off-by: Bjarki Arge Andreasen <[email protected]>
|
Hardware tests on sam_v71_xult/samv71q21.
|
The current tests with the samv71 partition cover the last page? If yes, I'm ready to approve. |
To erase the last page for that board, change this line
DT_NODELABEL(scratch_partition) and run the suite again :) we are looking for:
the board has a scratch partition at the end of the flash area :) |
I can do that and provide feedback, yes. But in this case, it will be nice if we extend the test to run over these two partitions. I want to avoid regressions here. I'm fine if you want to do on another PR too to not switch your tasks at moment. |
Running test using the scratch_partition
|
well that sucks :) |
Hi @bjarki-andreasen , I was wondering if you had time to look on it again. |
friendly ping : ) |
I'm getting a dev kit in the coming days, then I will fix it properly |
Add default partition table used with common apps like test suites and the bootloader. Signed-off-by: Bjarki Arge Andreasen <[email protected]>
To fully test the flash controllers, the test suite should erase the very first pages, and the very last page to find bugs in the extremes. Using an overlay to update the partition layout to extend slot1 to the end makes this possible. Signed-off-by: Bjarki Arge Andreasen <[email protected]>
I extended the test suite to include board overlays so we can adjust the slot1 partition to extend to the very end of the flash area. With this, and running the test suite both with and without MCU boot on an sam4e_xpro, it runs without error, erasing the last page successfully:
I did not need to change the driver, from what I can tell the bug was indeed fixed :) |
The implementation for erasing pages in the flash_sam.c driver indicated a successful erase after exceeding the last page to be erased successfully. Since the last page has no proceeding page, the succeeded status was not set.
This fix switches around the status to be set as succeeded before erase begins, to have the succeeded status cleared if page unlock or erase fails.
fixes: #70344