arch/Kconfig: add image option - #19831
Conversation
| Set this option to enforce using the boot memory configuration if | ||
| supported by the linker script. | ||
|
|
||
| config FLASH_HEADER_SIZE |
There was a problem hiding this comment.
but no nuttx code reference these new macro?
There was a problem hiding this comment.
Not yet, I wanted the OK to do it like that. I can add an example linker modification if wanted.
6667445 to
5eb024d
Compare
|
It might be possible to avoid any additional Kconfig: depending on the meaning of "CONFIG_FLASH_START". If this is considered to be the nuttx FLASH_START it should not care if there is a image header or not. It would be the responsability of the user to take into account a header that is added to the image. This would be logic, but it might be contradictory to the definition of @xiaoxiang781216, @raiden00pl what do you think is the correct interpretation of CONFIG_FLASH_START? |
acassis
left a comment
There was a problem hiding this comment.
@Laczen this is a new feature, so to avoid "Another Hidden Feature of NuttX", please document it, i.e. here: https://nuttx.apache.org/docs/latest/implementation/index.html
Let us first agree on what the current meaning of the properties are in NuttX, it might be that this new feature is not needed anyway. |
5eb024d to
073ce4c
Compare
I think the correct understanding of |
|
|
||
| menu "Image Options" | ||
|
|
||
| config FLASH_HEADER_SIZE |
There was a problem hiding this comment.
move the near of FLASH_START
There was a problem hiding this comment.
This was intentionally not done, it a ram load image is generated it could be stored on flash. The ram load part does not need the header, but to describe the image for a bootloader the header could contain e.g. where it needs to be placed in ram.
| */ | ||
|
|
||
| #include <nuttx/config.h> | ||
| #if defined(CONFIG_FLASH_START) && defined(CONFIG_FLASH_SIZE) && \ |
There was a problem hiding this comment.
| #if defined(CONFIG_FLASH_START) && defined(CONFIG_FLASH_SIZE) && \ | |
| #if defined(CONFIG_FLASH_START) && CONFIG_FLASH_START != 0 |
There was a problem hiding this comment.
The defined() are unnecessary, in theory flash_start could be zero, flash_size != 0 should be the only real condition.
Add image option to describe the size of an image header when a bootloader would need one. Add a sample modification for the linker script of nucleo-f411re Signed-off-by: Laczen JMS <laczenjms@gmail.com>
073ce4c to
457cc31
Compare
|
I think the definition of a header as used by mcuboot and nxboot can be avoided. If after the vector table or at the start of an image a small area is reserved for a magic and a image size a bootloader can find this. The image meta data (including signature) can than be added (and found) after the image. The small area added avoids the need of defining the image header size in NuttX. |
Summary
Add extra boot memory options to enforce the use of boot memory configuration options. This allows linker files to detect if they should prefer the specified boot memory options. This supports using boot memory config without breaking the existing defconfigs.Add image option to describe the size of an image header when a bootloader would need one.
When using the image header by a bootloader that is in nuttx-apps I would use the PREBUILD mechanism or a equivalent cmake mechanism to set the boot memory configuration and the image header size (using kconfig-tweak).
Impact
None, enabler for improving bootloader support.
Testing
tested on qemu-armv7a:nsh