arch/Kconfig: add boot memory configuration options - #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.
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 extra boot memory 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>
6667445 to
5eb024d
Compare
| */ | ||
|
|
||
| #include <nuttx/config.h> | ||
| #ifdef CONFIG_USE_BOOT_MEMORY_CONFIG |
There was a problem hiding this comment.
why not always use CONFIG_FLASH_xxx option
There was a problem hiding this comment.
Because this would break existing defconfigs (many don't have valid CONFIG_FLASH_START).
It is possible to do some simple validity check insteads of using the CONFIG_USE_BOOT_MEMORY_CONFIG. But I am unsure if a simple check would be sufficient.
|
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. |
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 extra boot memory 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