-
Notifications
You must be signed in to change notification settings - Fork 606
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
base: master
Are you sure you want to change the base?
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
@@ -64,6 +64,17 @@ config NXBOOT_BOOTLOADER | |||
|
|||
if NXBOOT_BOOTLOADER | |||
|
|||
config NXBOOT_COPY_TO_RAM | |||
bool "Copy bootable image to RAM before calling board boot-image function" | |||
default n |
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.
Please include a ---help--- explaining when and why to use it, etc
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.
Sure!
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.
Added
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 |
…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]>
7d96e90
to
43bf41b
Compare
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