-
Notifications
You must be signed in to change notification settings - Fork 3k
Fix: Allow target size restriction for LPC55S69 #10792
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
The build tool uses the sector size found in the CMSIS Pack to determine if the size that can be specified by `target.restrict_size` is enough to fit all the parts of a given binary. See `target.restrict_size` documentation in the Mbed OS manual for more information. The sector size found in the CMSIS Pack is overriden to allow the build tool to accurately make the decision. The target's sectors in the CMSIS Pack are defined in 32KB pages. However, you can erase pages at the 512 byte level. This commit changes defined sector erase size to 512 bytes instead of 32 Kilobytes.
@hugueskamba, thank you for your changes. |
@@ -2058,7 +2058,8 @@ | |||
"detect_code": ["0236"], | |||
"device_name": "LPC55S69JBD100", | |||
"release_versions": ["5"], | |||
"program_cycle_s": 10 | |||
"program_cycle_s": 10, | |||
"sectors": [[0,512]] |
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.
Page erase is defined at 256 byte in
https://www.nxp.com/docs/en/user-guide/UM11126.pdf (page 3)
So 512 will work but we could optimise further.
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 agree with you. However, @offirko left the following comment on the internal ticket:
Jimmy Brisson - please note that while LPC55S69 has 32KB sector size, it supports 512-bytes Page Erase command (subsectors).
When target's erase sector size is queried it returns Page Erase size of 512-bytes. (this is the value eventually used by FlashIAP block device,..etc)
uint32_t flash_get_sector_size(const flash_t *obj, uint32_t address) Line 229 in 0e532ba
#define FSL_FEATURE_SYSCON_FLASH_PAGE_SIZE_BYTES (512) Could we change the sector size defined at index.json to 512-bytes ?
I would prefer to leave it as 512 bytes to avoid introducing potential bugs. This is unless we also want to change the define for the flash page size. @evedon Please advise.
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.
Let's not do this change now.
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.
Page erase is defined at 256 byte in
https://www.nxp.com/docs/en/user-guide/UM11126.pdf (page 3)
So 512 will work but we could optimise further.
This is a documentation error. Program and erase size is 512, thank you for finding this. We have raised an issue with the documentation team to correct this.
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.
Change looks fine to me, nice work!
CI started. |
Test run: SUCCESSSummary: 11 of 11 test jobs passed |
Postponing this fix to 5.13.2 as it is causing 5.13.1 RC not building for client. This fix needs further investigation - implications are bigger than it seems ( as I understood there's connection to bootloader in the internal ticket IOTSTOR-880 and we cant' get anyone from storage to help us this week). |
Can you share the error(s)/warning(s) displayed when it fails to build? Is there a ticket? |
@hugueskamba will investigate why this is causing build error for client |
As we were told, this has dependency on bootloader + client update, moving to 5.14 |
Description
The build tool uses the sector size found in the CMSIS Pack to determine if
the size that can be specified by
target.restrict_size
is enough to fitall the parts of a given binary. See
target.restrict_size
documentationin the Mbed OS manual for more information.
The sector size found in the CMSIS Pack is overriden to allow the build
tool to accurately make the decision.
The target's sectors in the CMSIS Pack are defined in 32KB pages.
However, you can erase pages at the 512 byte level.
This commit changes defined sector erase size to 512 bytes instead of
32 kilobytes.
Pull request type
Reviewers
@bridadan @theotherjimmy
Fixes internal issue IOTCORE-1149