Skip to content

nxboot: enhance the access to flash device #3136

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

Draft
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

michallenc
Copy link
Contributor

Summary

619ea01 boot/nxboot/loader/flash.c: open partition with O_DIRECT flag

There is no need to use buffers in a bootloader. We expect a sequential
access, therefore we just need to erase the erase page before writing
to it for the first time, which is something FTL layer already takes
care of.

95e4b0c boot/nxboot/loader/boot.c: copy partition with blocksize large writes

The previous logic MAX(info_from.blocksize, info_where.blocksize) was
incorrect. The most effective access with by writing the entire
size of the block, therefore just decide the size based on the
target page size.

Impact

Nxboot now utilizes changes presented in apache/nuttx#16642. Should not have impact on current implementation as the additional flags are ignored if changes in apache/nuttx#16642 are not applied.

Testing

Tested with apache/nuttx#16642 patch applied. Nxboot successfully updates and reverts new image. All works as before, but additional buffering is skipped.

There is no need to use buffers in a bootloader. We expect a sequential
access, therefore we just need to erase the erase page before writing
to it for the first time, which is something FTL layer already takes
care of.

Signed-off-by: Michal Lenc <[email protected]>
The previous logic MAX(info_from.blocksize, info_where.blocksize) was
incorrect. The most effective access with by writing the entire
size of the block, therefore just decide the size based on the
target page size.

Signed-off-by: Michal Lenc <[email protected]>
@michallenc
Copy link
Contributor Author

@TimJTi adding this as a draft now, could you test it with your environment when you have time? Thanks!

@michallenc michallenc changed the title Nxboot direct access nxboot: enhance the access to flash device Jul 17, 2025
@TimJTi
Copy link
Contributor

TimJTi commented Jul 17, 2025

@TimJTi adding this as a draft now, could you test it with your environment when you have time? Thanks!

@michallenc Of course - probably not until next week though: hope that's OK.

@michallenc
Copy link
Contributor Author

michallenc commented Jul 17, 2025

@TimJTi adding this as a draft now, could you test it with your environment when you have time? Thanks!

@michallenc Of course - probably not until next week though: hope that's OK.

Absolutely, this is just a quiality of life change, no need for a quick merge.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants