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
IOTSTOR-953: Fix address calculations from SlicingBlockDevice #11797
Conversation
Test results before the last commit:
|
After the last commit
|
@SeppoTakalo, thank you for your changes. |
UNITTESTS/features/storage/blockdevice/HeapBlockDevice/test.cpp
Outdated
Show resolved
Hide resolved
UNITTESTS/features/storage/blockdevice/HeapBlockDevice/test.cpp
Outdated
Show resolved
Hide resolved
UNITTESTS/moduletests/storage/blockdevice/SlicingBlockDevice/moduletest.cpp
Outdated
Show resolved
Hide resolved
5f437d6
to
ab538f5
Compare
ab538f5
to
6f126f6
Compare
Just realized that I have used wrong Jira ticket number.. This is IOTSTOR-953, not 941. |
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.
Looks good to me
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.
Mainly cosmetic changes requested around licenses
6f126f6
to
a2ffa45
Compare
@@ -874,7 +873,7 @@ int SPIFBlockDevice::_sfdp_detect_best_bus_read_mode(uint8_t *basic_param_table_ | |||
read_inst = basic_param_table_ptr[SPIF_BASIC_PARAM_TABLE_222_READ_INST_BYTE]; | |||
_read_dummy_and_mode_cycles = (basic_param_table_ptr[SPIF_BASIC_PARAM_TABLE_222_READ_INST_BYTE - 1] >> 5) | |||
+ (basic_param_table_ptr[SPIF_BASIC_PARAM_TABLE_222_READ_INST_BYTE - 1] & 0x1F); | |||
debug_if(MBED_CONF_SPIF_DRIVER_DEBUG, "\nDEBUG: Read Bus Mode set to 2-2-2, Instruction: 0x%xh", read_inst); | |||
tr_debug("\nRead Bus Mode set to 2-2-2, Instruction: 0x%xh", read_inst); |
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.
Can search-and-replace a bit harder for \n
. (Can't immediately see why this was ever at the start of line.)
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.
You are commenting a line, that has been commented out from the code..
I should probably drop the whole block of commented out code. I did a search-and-replace but only for active lines.
Test run: SUCCESSSummary: 11 of 11 test jobs passed |
"--coverage" is synonym to "-fprofile-arcs -ftest-coverage" https://gcc.gnu.org/onlinedocs/gcc/Instrumentation-Options.html This was causing extra compilation warnings on CLANG.
* Refactor some headers to use relative path from Mbed OS root. * Refactor some data types to compile on 64bit machines. * Refactor some debug traces to use mbed_trace.
This uses HeapBlockDevice for providing the underlying storage block. Check boundaries that slicingblockdevice do not overlow over to unassigned blocks.
* Change MBED_ASSERTS() to return valid error code, so that checks are not bypassed on release builds. * Fix starting address calculations so that "addr" parameter is always relative to SlicingDevice and "_start" is only added when calls to underlying storage block is made. * Bypass BlockDevice:is_valid_*() to underlying block device. Slicingblockdevice was just verifying addresses independently, without verifying those from underlying block storage.
DeviceKey was using mbedtls_ssl_safer_memcmp() to compare result against buffer of equal length, but zero content. This comparison makes no sense as the entropy function is already returning proper error, if it fails.
a734d9a
to
21987db
Compare
Rebased on top of master, should fix the conflicts. |
Ci restarted |
Test run: SUCCESSSummary: 11 of 11 test jobs passed |
Description (required)
IOTSTOR-953: Fix address calculations from SlicingBlockDevice
checks are not bypassed on release builds.
relative to SlicingDevice and "_start" is only added when calls to
underlying storage block is made.
Slicingblockdevice was just verifying addresses independently, without
verifying those from underlying block storage.
Summary of change (What the change is for and why)
Fix address calculations from SlicingBlockDevice.
This fixed #11781
Documentation (Details of any document updates required)
No documentation update.
No API changes.
Pull request type (required)
Test results (required)
Reviewers (optional)
@VeijoPesonen
Release Notes (required for feature/major PRs)
Summary of changes
Impact of changes
Migration actions required