mirror of
https://github.com/apache/nuttx-apps.git
synced 2026-08-11 15:35:13 +00:00
This commit enhances the bootloader capabilities. The image's header is extended with header version, size, platform identifier and pointer to optional next header. CRC32 now includes part of the header in its calculation as well. The change also avoids having two different magics for image uploaded over programmer and update image. Both these images have the same magic and this magic is changed internally by the bootloader's logic. The change is needed because image with standard magic is automatically considered as a confirmed image (uploaded with programmer). The current implementation avoids tails at all, therefore the user application uploading the image does not have to erase the tail before new upload. The image is considered as confirmed if it has standard magic or its recovery is present. This means the bootloader has to erase the header of the update image after the update is done (to avoid update loop and to mark the image as unstable). This page is written back during the confirmation. This is a breaking change, but necessary for the future development of the bootloader. The added header version field will allow to add minor/major updates while keeping the backwards compatibility. Signed-off-by: Michal Lenc <michallenc@seznam.cz> Co-authored-by: Pavel Pisa <pisa@fel.cvut.cz> Co-authored-by: Karel Koci <cynerd@email.cz>
97 lines
3 KiB
Text
97 lines
3 KiB
Text
#
|
|
# For a description of the syntax of this configuration file,
|
|
# see the file kconfig-language.txt in the NuttX tools repository.
|
|
#
|
|
|
|
menuconfig BOOT_NXBOOT
|
|
bool "NuttX bootloader"
|
|
default n
|
|
select BCH
|
|
---help---
|
|
Enable support for the minimal NuttX based bootloader.
|
|
|
|
if BOOT_NXBOOT
|
|
|
|
config NXBOOT_PRIMARY_SLOT_PATH
|
|
string "Application firmware primary image slot path"
|
|
default "/dev/ota0"
|
|
---help---
|
|
The path to the application firmware image primary slot character
|
|
device driver. The image runs from this location.
|
|
Default: /dev/ota0
|
|
|
|
config NXBOOT_SECONDARY_SLOT_PATH
|
|
string "Application firmware secondary image slot path"
|
|
default "/dev/ota1"
|
|
---help---
|
|
The path to the application firmware image primary slot character
|
|
device driver. This is either update or recovery slot.
|
|
Default: /dev/ota1
|
|
|
|
config NXBOOT_TERTIARY_SLOT_PATH
|
|
string "Application firmware tertiary image slot path"
|
|
default "/dev/ota2"
|
|
---help---
|
|
The path to the application firmware image primary slot character
|
|
device driver. This is either update or recovery slot.
|
|
Default: /dev/ota2
|
|
|
|
config NXBOOT_HEADER_SIZE
|
|
hex "Application firmware image header size"
|
|
default 0x200
|
|
---help---
|
|
Note that this size should be aligned with the program memory write
|
|
page size!
|
|
|
|
config NXBOOT_PLATFORM_IDENTIFIER
|
|
hex "A unique platform identifier"
|
|
default 0x0
|
|
---help---
|
|
This is a unique platform identifier used by the bootloader to
|
|
verify whether the image should be run on a given platform. An update
|
|
(or even a firmware uploaded via a programmer) is rejected if the
|
|
value in image's header doesn't match this option.
|
|
|
|
config NXBOOT_BOOTLOADER
|
|
bool "Build nxboot bootloader application"
|
|
default n
|
|
select BOARDCTL
|
|
select BOARDCTL_BOOT_IMAGE
|
|
---help---
|
|
This option builds and links a bootloader application. This application
|
|
should be an entry function for NuttX. It checks for possible update/
|
|
revert operation, performs it and boot the correct image.
|
|
|
|
if NXBOOT_BOOTLOADER
|
|
|
|
config NXBOOT_SWRESET_ONLY
|
|
bool "Perform update/revert only on SW reset"
|
|
default n
|
|
select BOARDCTL_RESET_CAUSE
|
|
---help---
|
|
This option ensures the update/revert is performed only for following
|
|
reset causes:
|
|
BOARDIOC_RESETCAUSE_CPU_SOFT: software reset
|
|
BOARDIOC_RESETCAUSE_CPU_RWDT: watchdog error
|
|
BOARDIOC_RESETCAUSE_PIN: reset button
|
|
|
|
This way the board can keep its image (even if not confirmed) during
|
|
for example power shutdown and perform update/revent only if expected
|
|
based on user/maintainer input.
|
|
|
|
config NXBOOT_PREVENT_DOWNGRADE
|
|
bool "Perform update only for newer version"
|
|
default n
|
|
---help---
|
|
NXboot uses Semantic Version 2.0.0 (without build metadata). By default
|
|
the update is performed for every version that doesn't match the
|
|
currently running one. If NXBOOT_PREVENT_DOWNGRADE selected, update is
|
|
performed only for newer versions (according to Semantic Version
|
|
preference rules).
|
|
|
|
WARNING: NXboot currently implements preferences only for
|
|
MAJOR.MINOR.PATCH and ignores prerelease.
|
|
|
|
endif # NXBOOT_BOOTLOADER
|
|
|
|
endif # BOOT_NXBOOT
|