On Nuvoton's targets, features-storage-tests-kvstore-general_tests_phase_2 / SEC_set_add_data_set_key_value_five_Kbytes is failing. Looking into, the estimated storage size needed for SecureStore sees flashiap's program (page) size.
On Nuvoton targets, they are only 4-bytes, and cause underestimation.
NUMAKER_IOT_M263A
NU_PFM_M2351_NPSA_NS
n/a
af4c8a94f3913ceda9069ec79cba81a793d695fe
n/a
mbed test -m NUMAKER_IOT_M263A -t ARMC6 -n features-storage-tests-kvstore-general_tests_phase_2
cc @ARMmbed/mbed-os-storage
@ccli8 , what is the erase sector size on this device?
Are you able to tell how many pages would have been sufficient?
what is the erase sector size on this device?
Are you able to tell how many pages would have been sufficient?
@kyle-cypress These Nuvoton targets have 2KiB erase sector size and only 4-byte program page size. Not familiar with SecureStore, so I cannot give a estimation. But if I deliberately enlarge erase sector size from 2KiB to e.g. 8KiB below, the tests pass. The program_size * PAGES_ESTIMATE estimation may get unreasonable because program_size is only 4-byte on Nuvoton targets, I guess.
ul_bd_size = align_up(program_size * PAGES_ESTIMATE, 0x2000 * 2);
I'll review this shortly as I noticed the nightly has very similar failures, will update.
This should not be closed,I'l lreopen as the issue is still active (it was duplicated)
what is the erase sector size on this device?
Are you able to tell how many pages would have been sufficient?@kyle-cypress These Nuvoton targets have 2KiB erase sector size and only 4-byte program page size. Not familiar with SecureStore, so I cannot give a estimation. But if I deliberately enlarge erase sector size from 2KiB to e.g. 8KiB below, the tests pass. The
program_size * PAGES_ESTIMATEestimation may get unreasonable becauseprogram_sizeis only 4-byte on Nuvoton targets, I guess.ul_bd_size = align_up(program_size * PAGES_ESTIMATE, 0x2000 * 2);
Yes, that would be my theory as well. Perhaps the size computation should use the lower of either program_size or the minimum size needed to hold a small key. I know that it can fit into a single 512 byte page, but I'm not sure whether 512 bytes would be a reasonable baseline or if the test should pick something smaller.
Thank you for raising this detailed GitHub issue. I am now notifying our internal issue triagers.
Internal Jira reference: https://jira.arm.com/browse/IOTOSM-2209
Hi @ccli8, I fixed this issue in #13848 after I encountered the same test failure. The fix is https://github.com/ARMmbed/mbed-os/commit/13c5b64e16052a905b8eb6f6a243ad81afa1c9a3#diff-49a25f9feefaffecad0fcd30c50dc9331cff8b55ece53def6285c09e17e6f5d7. Would you please have a try?
It's already on the master branch, and will be in the upcoming mbed-os-6.5.0 release too.
@LDong-Arm #13848 can fix my failure. Thanks.
I'll close as resolved.
Most helpful comment
@LDong-Arm #13848 can fix my failure. Thanks.