nuttx
nuttx copied to clipboard
nucleo-h743zi: add board files to support mcuboot
Signed-off-by: Andres Sanchez [email protected]
Summary
This pull request add support of mcuboot secure booting for nucleo h743zi board.
The implementation copies the work done by @pkarashchenko for the samv7 board in #4880
Impact
Two new configurations has been added,
-
mcuboot-loader: app-based bootloader that implements mcuboot functionality
-
mcuboot-app: simple app with mcuboot-confirm as main entry application
It needs to be configured in the toolchain the mcuboot image signer applcation "imgtool.py" to automatically sign the images before flashing
Testing
Hi @tito97sp please fix these small issues:
Error: /home/runner/work/incubator-nuttx/incubator-nuttx/nuttx/boards/arm/stm32h7/nucleo-h743zi/src/stm32_boot_image.c:2:1: error: Relative file path does not match actual file
Error: /home/runner/work/incubator-nuttx/incubator-nuttx/nuttx/boards/arm/stm32h7/nucleo-h743zi/src/stm32_boot_image.c:106:2: error: C++ style comment
Error: /home/runner/work/incubator-nuttx/incubator-nuttx/nuttx/boards/arm/stm32h7/nucleo-h743zi/src/stm32_boot_image.c:110:2: error: C++ style comment
Error: /home/runner/work/incubator-nuttx/incubator-nuttx/nuttx/boards/arm/stm32h7/nucleo-h743zi/src/stm32_boot_image.c:111:0: error: TABs found. First detected
Error: /home/runner/work/incubator-nuttx/incubator-nuttx/nuttx/boards/arm/stm32h7/nucleo-h743zi/src/stm32_boot_image.c:112:1: error: Right brace must be followed by a blank line
Error: /home/runner/work/incubator-nuttx/incubator-nuttx/nuttx/boards/arm/stm32h7/nucleo-h743zi/src/stm32_boot_image.c:168:0: error: Garbage follows right bracket
Error: /home/runner/work/incubator-nuttx/incubator-nuttx/nuttx/boards/arm/stm32h7/nucleo-h743zi/src/stm32_bringup.c:329:4: error: Bad alignment
Error: /home/runner/work/incubator-nuttx/incubator-nuttx/nuttx/boards/arm/stm32h7/nucleo-h743zi/src/stm32_bringup.c:330:6: error: Bad left brace alignment
Error: /home/runner/work/incubator-nuttx/incubator-nuttx/nuttx/boards/arm/stm32h7/nucleo-h743zi/src/stm32_bringup.c:331:79: error: Long line found
Error: /home/runner/work/incubator-nuttx/incubator-nuttx/nuttx/boards/arm/stm32h7/nucleo-h743zi/src/stm32_bringup.c:333:6: error: Bad right brace alignment
Error: /home/runner/work/incubator-nuttx/incubator-nuttx/nuttx/boards/arm/stm32h7/nucleo-h743zi/src/stm32_progmem.c:2:1: error: Relative file path does not match actual file
Error: /home/runner/work/incubator-nuttx/incubator-nuttx/nuttx/boards/arm/stm32h7/nucleo-h743zi/src/stm32_progmem.c:119:1: error: Too many blank lines
Error: /home/runner/work/incubator-nuttx/incubator-nuttx/nuttx/boards/arm/stm32h7/nucleo-h743zi/src/stm32_progmem.c:147:2: error: C++ style comment
Error: /home/runner/work/incubator-nuttx/incubator-nuttx/nuttx/boards/arm/stm32h7/nucleo-h743zi/src/stm32_progmem.c:148:2: error: C++ style comment
Error: /home/runner/work/incubator-nuttx/incubator-nuttx/nuttx/boards/arm/stm32h7/nucleo-h743zi/src/stm32_progmem.c:157:2: error: Bad left brace alignment
Error: /home/runner/work/incubator-nuttx/incubator-nuttx/nuttx/boards/arm/stm32h7/nucleo-h743zi/src/stm32_progmem.c:159:2: error: Bad right brace alignment
Error: /home/runner/work/incubator-nuttx/incubator-nuttx/nuttx/boards/arm/stm32h7/nucleo-h743zi/src/stm32_progmem.c:189:2: error: Bad left brace alignment
Error: /home/runner/work/incubator-nuttx/incubator-nuttx/nuttx/boards/arm/stm32h7/nucleo-h743zi/src/stm32_progmem.c:195:6: error: Bad left brace alignment
Error: /home/runner/work/incubator-nuttx/incubator-nuttx/nuttx/boards/arm/stm32h7/nucleo-h743zi/src/stm32_progmem.c:198:6: error: Bad right brace alignment
Error: /home/runner/work/incubator-nuttx/incubator-nuttx/nuttx/boards/arm/stm32h7/nucleo-h743zi/src/stm32_progmem.c:205:6: error: Bad left brace alignment
Error: /home/runner/work/incubator-nuttx/incubator-nuttx/nuttx/boards/arm/stm32h7/nucleo-h743zi/src/stm32_progmem.c:208:6: error: Bad right brace alignment
Error: /home/runner/work/incubator-nuttx/incubator-nuttx/nuttx/boards/arm/stm32h7/nucleo-h743zi/src/stm32_progmem.c:210:2: error: Bad right brace alignment
Error: /home/runner/work/incubator-nuttx/incubator-nuttx/nuttx/boards/arm/stm32h7/nucleo-h743zi/src/stm32_progmem.c:216:1: error: Too many blank lines
Error: /home/runner/work/incubator-nuttx/incubator-nuttx/nuttx/boards/arm/stm32h7/nucleo-h743zi/src/stm32_progmem.c:232:1: error: Too many blank lines
Error: /home/runner/work/incubator-nuttx/incubator-nuttx/nuttx/boards/arm/stm32h7/nucleo-h743zi/src/stm32_progmem.c:233:27: error: C++ style comment
Error: /home/runner/work/incubator-nuttx/incubator-nuttx/nuttx/boards/arm/stm32h7/nucleo-h743zi/src/stm32_progmem.c:233:35: error: Mixed case identifier found
Error: /home/runner/work/incubator-nuttx/incubator-nuttx/nuttx/boards/arm/stm32h7/nucleo-h743zi/src/stm32_progmem.c:233:43: error: Mixed case identifier found
Error: /home/runner/work/incubator-nuttx/incubator-nuttx/nuttx/boards/arm/stm32h7/nucleo-h743zi/src/stm32_progmem.c:233:80: error: Long line found
Error: /home/runner/work/incubator-nuttx/incubator-nuttx/nuttx/boards/arm/stm32h7/nucleo-h743zi/src/stm32_progmem.c:239:2: error: Bad left brace alignment
Error: /home/runner/work/incubator-nuttx/incubator-nuttx/nuttx/boards/arm/stm32h7/nucleo-h743zi/src/stm32_progmem.c:240:4: error: Bad alignment
Error: /home/runner/work/incubator-nuttx/incubator-nuttx/nuttx/boards/arm/stm32h7/nucleo-h743zi/src/stm32_progmem.c:241:2: error: Bad right brace alignment
Error: /home/runner/work/incubator-nuttx/incubator-nuttx/nuttx/boards/arm/stm32h7/nucleo-h743zi/src/stm32_progmem.c:246:2: error: Bad left brace alignment
Error: /home/runner/work/incubator-nuttx/incubator-nuttx/nuttx/boards/arm/stm32h7/nucleo-h743zi/src/stm32_progmem.c:247:4: error: Bad alignment
Error: /home/runner/work/incubator-nuttx/incubator-nuttx/nuttx/boards/arm/stm32h7/nucleo-h743zi/src/stm32_progmem.c:248:2: error: Bad right brace alignment
Error: /home/runner/work/incubator-nuttx/incubator-nuttx/nuttx/boards/arm/stm32h7/nucleo-h743zi/src/stm32_progmem.c:254:2: error: Bad left brace alignment
Error: /home/runner/work/incubator-nuttx/incubator-nuttx/nuttx/boards/arm/stm32h7/nucleo-h743zi/src/stm32_progmem.c:257:4: error: Bad alignment
Error: /home/runner/work/incubator-nuttx/incubator-nuttx/nuttx/boards/arm/stm32h7/nucleo-h743zi/src/stm32_progmem.c:258:2: error: Bad right brace alignment
Error: /home/runner/work/incubator-nuttx/incubator-nuttx/nuttx/boards/arm/stm32h7/nucleo-h743zi/src/stm32_progmem.c:273:2: error: Bad left brace alignment
Error: /home/runner/work/incubator-nuttx/incubator-nuttx/nuttx/boards/arm/stm32h7/nucleo-h743zi/src/stm32_progmem.c:277:2: error: Bad right brace alignment
You can run nxstyle/checkpatch to confirm everything is fine
When selected PROGMEM_OTA_PARTITION by STM32_FORMAT_MCUBOOT it inverts the values of the next FLAGS: MTD MTD_BYTE_WRITE MTD_PARTITION MTD_PROGMEM MTD_PROGMEM_ERASESTATE
If my configuration already had activated the MTD functionalit, when using the PROGMEM_OTA_PARTITION it becomes false and opossite if it was not activated.
Do you know why it is this happening?? I have it selected as default = n as suggested previously
When selected PROGMEM_OTA_PARTITION by STM32_FORMAT_MCUBOOT it inverts the values of the next FLAGS: MTD MTD_BYTE_WRITE MTD_PARTITION MTD_PROGMEM MTD_PROGMEM_ERASESTATE
If my configuration already had activated the MTD functionalit, when using the PROGMEM_OTA_PARTITION it becomes false and opossite if it was not activated.
Do you know why it is this happening?? I have it selected as default = n as suggested previously
I do not fully understand what do you mean. Enabling PROGMEM_OTA_PARTITION
should enable MTD
, MTD_BYTE_WRITE
, MTD_PARTITION
, MTD_PROGMEM
and MTD_PROGMEM_ERASESTATE
. Because enabling is implicit it those will no longer reside in defconfig
file, but will be generated correctly into .config
and that is ok. If this does not answer your question you can email me to [email protected] with make menuconfig
screenshots and defconfig file, so I can make a further look.
Hi @tito97sp ,
I add #4939 with the intention to clean a little bit the MCUboot support for samv7. I think that change may help to avoid duplicate code between boards and have only one linker script based in a template model.
@acassis @pkarashchenko is this patch ready for merge?
@tito97sp could you squash the intermediate change into one patch?
Hi @tito97sp ,
I strong recommend you organize code like #4981. That way almost enable to use MCUboot on any STM32H7 board, in a easy way. Otherwise people will start to duplicate your code, which is complete unnecessary.
My concerns around MCUboot is that starting thinking support only one board seems to be the easy way but is hard to maintain. I would like encourage you to create the common folder and put all necessary things there. Then, only enable support in your board.
@acassis @pkarashchenko is this patch ready for merge?
It seams he fixed all the suggestions, but the CI is failing. Maybe @tito97sp needs to rebase it to the HEAD to fix these issues.
@tito97sp do you have any plans when you can update this PR?
something really strange with this PR. I see "merge" and the force-push CC: @xiaoxiang781216 @acassis @btashton
look like the patch become to empty and confuse the github
Yes, I was confused with a message "tito97sp merged commit d940d55 into apache:master 2 days ago"
@tito97sp will you submit a new PR?