-
Notifications
You must be signed in to change notification settings - Fork 3k
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
Fix direct access to device key test for small erase/program ratio #9932
Fix direct access to device key test for small erase/program ratio #9932
Conversation
@mmahadevan108 , @mikisch81 - FYI |
@davidsaada, thank you for your changes. |
@ARMmbed/mbed-os-maintainers @maclobdell @amiraloosh this is needed for #9908 and #9910 (new PSA targets) so it needs to have 5.12 label |
CI started whilst reviews are ongoing |
Shall be added to the commit msg? |
Indeed should be. Will wait to see if there are any required changes (to not duplicate CI), and if not, would kindly ask maintainers to add when merged. |
Test run: FAILEDSummary: 1 of 13 test jobs failed Failed test jobs:
|
@davidsaada Go ahead and make the change if you can. Either one of the CI sub-jobs appear to be misconfigured, or something is broken on master (betting on former). |
We will investigate. CI will be restarted |
314642b
to
d0b01ef
Compare
Commit message modified. |
@ARMmbed/mbed-os-storage Review please |
@@ -198,6 +198,13 @@ void test_direct_access_to_devicekey_tdb_last_two_sectors() | |||
uint32_t flash_bd_size = flash_bd_end_address - flash_bd_start_address; | |||
|
|||
FlashIAPBlockDevice *flash_bd = new FlashIAPBlockDevice((bd_addr_t)flash_bd_start_address, (bd_size_t)flash_bd_size); | |||
flash_bd->init(); | |||
uint32_t erase_prog_ratio = flash_bd->get_erase_size(flash_bd->size() - 1) / flash_bd->get_program_size(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This calculates and checks only the last sector erase_prog_ratio but on a very rare occasion, the second sector may have different erase_prog_ratio due to different sector size. I recommend adding a calculation and checkup also for the second sector.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good catch, fixed now. Please review.
This commit fixes the failure in the "Direct access to device key" test, when working with internal flash components, whose erase size to program size ratio is small. In such cases, the last two sectors are not large enough to store the device key.
d0b01ef
to
eb29af5
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
CI restarted |
Test run: FAILEDSummary: 1 of 13 test jobs failed Failed test jobs:
|
rebuilt exporter, error unrelated to this pr, and will be fixed elsewhere. |
Description
This PR fixes the failure in the "Direct access to device key" test when working with internal flash components, whose erase size to program size ratio is small. In such cases, the last two sectors are not large enough to store the device key.
This fixes the test failure in #9908.
Pull request type