Skip to content
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

Merged

Conversation

Projects
None yet
10 participants
@davidsaada
Copy link
Contributor

commented Mar 4, 2019

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

[ ] Fix
[ ] Refactor
[ ] Target update
[ ] Functionality change
[ ] Docs update
[x] Test update
[ ] Breaking change

@davidsaada davidsaada referenced this pull request Mar 4, 2019

Merged

Pr/cy mbed os 5.12.0 #9908

@offirko

This comment has been minimized.

Copy link
Contributor

commented Mar 4, 2019

@ciarmcom ciarmcom requested review from ARMmbed/mbed-os-maintainers Mar 4, 2019

@ciarmcom

This comment has been minimized.

Copy link
Member

commented Mar 4, 2019

@davidsaada, thank you for your changes.
@ARMmbed/mbed-os-storage @ARMmbed/mbed-os-maintainers please review.

@mikisch81

This comment has been minimized.

Copy link
Contributor

commented Mar 4, 2019

@ARMmbed/mbed-os-maintainers @maclobdell @amiraloosh this is needed for #9908 and #9910 (new PSA targets) so it needs to have 5.12 label

@cmonr

This comment has been minimized.

Copy link
Contributor

commented Mar 4, 2019

CI started whilst reviews are ongoing

@0xc0170

This comment has been minimized.

Copy link
Member

commented Mar 4, 2019

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.

Shall be added to the commit msg?

@davidsaada

This comment has been minimized.

Copy link
Contributor Author

commented Mar 4, 2019

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.

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.

@mbed-ci

This comment has been minimized.

Copy link

commented Mar 4, 2019

Test run: FAILED

Summary: 1 of 13 test jobs failed
Build number : 1
Build artifacts

Failed test jobs:

  • jenkins-ci/mbed-os-ci_exporter
@cmonr

This comment has been minimized.

Copy link
Contributor

commented Mar 5, 2019

@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).

@0xc0170

This comment has been minimized.

Copy link
Member

commented Mar 5, 2019

@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

@davidsaada davidsaada force-pushed the davidsaada:david_devkey_direct_test_large_page branch Mar 5, 2019

@davidsaada

This comment has been minimized.

Copy link
Contributor Author

commented Mar 5, 2019

Commit message modified.

@0xc0170

0xc0170 approved these changes Mar 5, 2019

@0xc0170

This comment has been minimized.

Copy link
Member

commented Mar 5, 2019

@ARMmbed/mbed-os-storage Review please

features/storage/TESTS/kvstore/direct_access_devicekey_test/main.cpp Outdated
@@ -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();

This comment has been minimized.

Copy link
@yossi2le

yossi2le Mar 5, 2019

Contributor

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.

This comment has been minimized.

Copy link
@davidsaada

davidsaada Mar 5, 2019

Author Contributor

Good catch, fixed now. Please review.

Fix direct access to device key test for small erase/program ratio
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.

@0xc0170 0xc0170 added needs: work and removed needs: review labels Mar 5, 2019

@davidsaada davidsaada force-pushed the davidsaada:david_devkey_direct_test_large_page branch to eb29af5 Mar 5, 2019

@yossi2le
Copy link
Contributor

left a comment

LGTM

@0xc0170 0xc0170 added needs: CI and removed needs: work labels Mar 5, 2019

@0xc0170

This comment has been minimized.

Copy link
Member

commented Mar 5, 2019

CI restarted

@mbed-ci

This comment has been minimized.

Copy link

commented Mar 5, 2019

Test run: FAILED

Summary: 1 of 13 test jobs failed
Build number : 2
Build artifacts

Failed test jobs:

  • jenkins-ci/mbed-os-ci_exporter
@alekla01

This comment has been minimized.

Copy link
Contributor

commented Mar 5, 2019

rebuilt exporter, error unrelated to this pr, and will be fixed elsewhere.

@0xc0170 0xc0170 added ready for merge and removed needs: CI labels Mar 5, 2019

@0xc0170 0xc0170 merged commit 03bb615 into ARMmbed:master Mar 5, 2019

28 checks passed

continuous-integration/jenkins/pr-head This commit looks good
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details
jenkins-ci/build-ARMC5 Success
Details
jenkins-ci/build-ARMC6 Success
Details
jenkins-ci/build-GCC_ARM Success
Details
jenkins-ci/build-IAR8 Success
Details
jenkins-ci/cloud-client-test Success
Details
jenkins-ci/dynamic-memory-usage RTOS ROM(+0 bytes) RAM(+0 bytes)
Details
jenkins-ci/exporter Success
Details
jenkins-ci/greentea-test Success
Details
jenkins-ci/mbed2-build-ARMC5 Success
Details
jenkins-ci/mbed2-build-ARMC6 Success
Details
jenkins-ci/mbed2-build-GCC_ARM Success
Details
jenkins-ci/mbed2-build-IAR8 Success
Details
jenkins-ci/unittests Success
Details
travis-ci/astyle Local astyle testing has passed
Details
travis-ci/docs Local docs testing has passed
Details
travis-ci/doxy-spellcheck Local doxy-spellcheck testing has passed
Details
travis-ci/events Passed, runtime is 10347 cycles (-184 cycles)
Details
travis-ci/gitattributestest Local gitattributestest testing has passed
Details
travis-ci/include_check Local include_check testing has passed
Details
travis-ci/licence_check Local licence_check testing has passed
Details
travis-ci/littlefs Passed, code size is 8408B (+0.00%)
Details
travis-ci/psa-autogen Local psa-autogen testing has passed
Details
travis-ci/tools-py2.7 Local tools-py2.7 testing has passed
Details
travis-ci/tools-py3.5 Local tools-py3.5 testing has passed
Details
travis-ci/tools-py3.6 Local tools-py3.6 testing has passed
Details
travis-ci/tools-py3.7 Local tools-py3.7 testing has passed
Details

@0xc0170 0xc0170 removed the ready for merge label Mar 5, 2019

@davidsaada davidsaada deleted the davidsaada:david_devkey_direct_test_large_page branch Mar 16, 2019

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.