-
Notifications
You must be signed in to change notification settings - Fork 3k
Add FlashIAP block device as default block device for WISE 1570 #8317
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
Conversation
* | ||
* @address Physical address where the block device start | ||
* @size The block device size | ||
*/ | ||
FlashIAPBlockDevice(uint32_t address, uint32_t size = 0); |
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.
Why ? can you add details to the commit message why this is not deprecated anymore? And also changes in FlashIAPBlockDevice ctor - part of the revert or?
This will need to get into release notes if that is the case
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.
We originally deprecated this constructor in the external repo, as this would have required the user to either keep a list of absolute addresses or to use FlashIAP
driver to query the flash parameters (which would have been "ugly" if we already use FlashIAPBlockDevice
). However, it turned out that this had actually broke those who used this block device and finally reverted that change in the external repo. In addition, there was no escape from using FlashIAP
to query flash parameters before instantiating FlashIAPBlockDevice
, as we needed to query sector sizes in order to calculate the partial file system location in flash.
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 you add some of these details to the commit msg?
2d6d256
to
bb79a63
Compare
size_t area_size; | ||
FlashIAP flash; | ||
NVStore &nvstore = NVStore::get_instance(); | ||
nvstore.get_area_params(0, top_address, area_size); //Find where nvstore begins |
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.
Does this work if NVStore is not present?
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.
No. However, if there is flash so there is also NVStroe.
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.
Is that true? I thought you need to call NVStore::init to create NVStore on disk.
Actually looking at get_area_params, by calling this function we are indirectly formatting the disk with NVStore. Which means we also have to pull in the NVStore logic.
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.
With call to nvstore.get_area_params():
Module | .text | .data | .bss |
---|---|---|---|
[fill] | 131(+0) | 4(+0) | 17(+0) |
[lib] | 20671(+0) | 2488(+0) | 117(+0) |
components | 902(+0) | 0(+0) | 0(+0) |
drivers | 764(+0) | 4(+0) | 140(+0) |
features | 2530(+0) | 0(+0) | 128(+0) |
hal | 1460(+0) | 4(+0) | 68(+0) |
main.o | 10(+0) | 0(+0) | 0(+0) |
platform | 1624(+0) | 256(+0) | 133(+0) |
rtos | 8293(+0) | 168(+0) | 6053(+0) |
targets | 11687(+0) | 8(+0) | 912(+0) |
Subtotals | 48072(+0) | 2932(+0) | 7568(+0) |
Without call to nvstore.get_area_params():
Module | .text | .data | .bss |
---|---|---|---|
[fill] | 123(-8) | 4(+0) | 21(+4) |
[lib] | 20671(+0) | 2488(+0) | 117(+0) |
components | 902(+0) | 0(+0) | 0(+0) |
drivers | 764(+0) | 4(+0) | 140(+0) |
features | 140(-2390) | 0(+0) | 44(-84) |
hal | 1460(+0) | 4(+0) | 68(+0) |
main.o | 10(+0) | 0(+0) | 0(+0) |
platform | 1620(-4) | 256(+0) | 133(+0) |
rtos | 8055(-238) | 168(+0) | 6053(+0) |
targets | 11687(+0) | 8(+0) | 912(+0) |
Subtotals | 45432(-2640) | 2932(+0) | 7488(-80) |
That's an extra 2.6KiB on platforms that just want internal flash not NVStore. Could we instead use config options specify the flash region? That's what we're currently doing for SPIF and SD pins.
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.
I have removed nvstore and added back the configuration option.
If no configuration supplied and still FlashIAP block device is enabled the block device will take the address of the first sector after code section till the end of the flash.
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.
Thanks for that 👍
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.
See above comment, this shouldn't be pulling in the NVStore codebase
Revert deprecation of FlashIAPBlockDevice 2 argument constructor has this was a breaking change. This follows a similar change in the external flashiap-driver repo.
bb79a63
to
b84f377
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.
Thanks for the fix 👍
Looks good to me. Though the use of the ROM_END makes me wonder what applications should do if they want to update (and grow in size) in the future. Should they be expected to specify a flash region with the config?
This is a known limitation for now and I guess if they want to be able to update they should specify the config parameters. |
/morph build |
Build : FAILUREBuild number : 3322 |
Huh. Gonna see if this is was just a glitch. |
Build : FAILUREBuild number : 3342 |
/morph build |
Build : SUCCESSBuild number : 3350 Triggering tests/morph test |
Exporter Build : SUCCESSBuild number : 2983 |
Test : SUCCESSBuild number : 3155 |
…AP as default block device for wise 1570
Description
This PR is adding FlashIAP block device component as the default block device for Wise 1570 board.
To accomplish this the deprecated constructor was reverted and used by calculating the start address at the first sector after the code address zone and the end address at the last sector before nvstore address zone.
This way the FlashIAP default block device does not overwrite any code or nvstore data.
Fix both issues MBEDOSTEST-209 and MBEDOSTEST-208 as they have been found to be related.
Pull request type