-
Notifications
You must be signed in to change notification settings - Fork 610
boot/nxboot: Enhancements to add progress messages and copy-to-RAM #3068
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
boot/nxboot: Enhancements to add progress messages and copy-to-RAM #3068
Conversation
d23e18a
to
76a5818
Compare
[Experimental Bot, please feedback here] This PR description is a good start but could be improved to better meet the NuttX requirements. Here's a breakdown of what's good and what needs improvement: Strengths:
Weaknesses and Suggested Improvements:
Revised Example (Partial - focusing on improvements): SummaryThis PR adds progress reporting and a RAM copy feature to NXboot. The Impact
TestingBuild Host: Linux, x86_64, GCC 9.4.0 Testing logs before change (QEMU-riscv32):
Testing logs after change (QEMU-riscv32,
(Add similar before/after logs for your custom board, highlighting progress reporting on the display) By addressing these points, your PR will be clearer, easier to review, and more likely to be accepted. Remember to fill out all sections completely and accurately. |
0750b52
to
4d613e4
Compare
4d613e4
to
66572be
Compare
66572be
to
02dde6f
Compare
02dde6f
to
f263c7c
Compare
Found a couple message enum inconsistencies so I'm sorting those out and put back to draft while I do so |
7d96e90
to
43bf41b
Compare
I will put back to draft so it doesn't get accepted until the couple of issues raised by @Cynerd are resolved. |
@Cynerd @michallenc I have pushed a new commit with the suggested changes - and an enhancement to show percentage progress not just dots I have deliberately not squashed the commits so I can back the changes out if they're not what was wanted! Would appreciate your feedback and I will amend/fix, then squash/commit and change back to ready for review. |
cb60545
to
b7f5fda
Compare
Now squashed and await any further reviews! |
…AM feature This adds Kconfig-enabled progress messages that are output to stdout. It also adds Kconfig-enabled option to copy the validated and bootable image to RAM Signed-off by: Tim Hardisty <[email protected]>
b7f5fda
to
cf653a7
Compare
@michallenc Thank you for your input - I always appreciate constructive criticism and advice that improve my coding skills 👍 |
@xiaoxiang781216 @acassis |
Summary
This PR has been created after email-list discussions mainly with with @Cynerd and @michallenc
Details
Progress Reporting
This was driven as a result of the inevitable time that firmware upgrades can take. The progress is reported via syslog, but not all embedded systems use this and, in the case (such as mine) where a user LCD is available, it is beneficial to allow progress to be displayed duringh booting and upgrades - especially should things go wrong.
To achieve this there is a new Kconfig choice -
NXBOOT_PRINTF_PROGRESS
which is disabled by defailt - to allow messages to be printed to stdout.Since other users may wish to treat NXboot as a library, and perhaps handle the messages differently, the feature is implemented by calls to a specific
nxboot_progress
function using new enums to indicate the type of message: info, error, or that a potentially lengthy procedure has started, stopped or is in progress using the "." character printed periodically.A user wishing to implement this in another way would use the existing top-level public function
nxboot_main
and would only need to modify this to report errors in a different way.Enabling this feature adds approximately 1.5KiB to the size of the binary, in my case.
RAM copy
In my case, the ultimate boot_image function needs to copy the validated and bootable image to SDRAM. Although this could be handled by the board-specific logic, the NXboot header does not conatin the size of the actual image to be copied meaning an image copy can only be of the entire NXboot "slot" size. This means it is a little slower then it could be and it made sense to have that implemented by a new function
nxboot_ramcopy
before calling the board boot function viaBOARDIOC_BOOT_IMAGE
This is enabled by a new Kconfig choice -
NXBOOT_COPY_TO_RAM
- that is disabled by defaultThe address to copy the image to is also configured via Kconfig - BUT there is no way that I can see for NXboot to determine the validity or otherwise of the configured address.
Impact
Since the new features are selected via Kconfig, defaulting to off, the is no intended impact to existing implementations. Lower level functions have been edited carefully, and I can confirm that NXboot still behaves for me as it did before the changes, with the added benefit of progress messages if required.
The copy-to-ram function also works, for me, as required.
Testing
This has been tested on my custom board using a SAMA5D27C-D1G processor, equipped with a partitioned 256Mbyte NOR flash that for the NXboot slots, and an 800x40 TFT for stdout courtesy of the FBCON example application