Hi Ricardo, sorry if my original posts were scattered.
I just started completely from scratch with the TF-M + MCUBoot guide so I could list what I had issues with. I do use MCUXpresso for VSCode for normal development, but since the guide is using the west command line tools, that's what I've used here.
Issues with the TF-M + MCUBoot guide (on nxp_zephyr tag nxp-v4.3.0)
- Under "Build and Flash TF-M from Downstream" in step 6 of "Modify secure image", it says that M_BOOT_FLASH_CONF_START should be the same as BOOT_FLASH_ACT_APP. I couldn't find BOOT_FLASH_ACT_APP anywhere in the repo, I'm not sure how to find what it is set to. I used #define M_BOOT_FLASH_CONF_START (0x18020000)
- In step 8 of "Modify secure image", the guide instructs to add a VTOR configuration to SystemInitHook in hardware_init.c, but it looks like that code already exists. I left it alone.
- In the "Modify non-secure image" section, the guide instructs to edit files in the folder nxp_zephyr\zephyr\build\tfm\api_ns\platform\partition, but nxp_zephyr\zephyr\build does not exist by default. The guide hasn't instructed to build anything by this point. After I had (later) built the app, the files in steps 2-6 were already modified to the correct values.
- In step 7 of "Modify non-secure image", there is no nxp_zephyr/zsdk/boards directory. I am assuming it's supposed to be nxp_zephyr/zephyr/boards, so I followed step 8 with that path.
- After making the edit to nxp_zephyr/zephyr/boards/nxp/frdm_rw612/frdm_rw612_rw612_ns.dts like the guide says, I get the following build error: required nodelabel not found: slot0_partition. If instead of making that edit, I build with the default device tree file, the sample builds almost all the way but at the last step I get the error:
Traceback (most recent call last):
...
intelhex.AddressOverlapError: Data overlapped at address 0x18020000
During handling of the above exception, another exception occurred:
...
intelhex.AddressOverlapError: /nxp_zephyr/zephyr/build/zephyr/tfm_s_signed.hex has merge issues
I just ignored this error and continued with the guide.
- The last problem I had was in the "Merge Binaries" section on step 3, I get the error Error: No such command 'merge'. I used the command "export" instead of merge since it looked to have a similar function to me.
After making these adjustments and flashing like the guide instructs, I still get the following terminal output:
*** Booting MCUboot v2.2.0-192-g96576b341ee1 ***
*** Using Zephyr OS build nxp-v4.3.0 ***
I: Starting bootloader
I: Image index: 0, Swap type: perm
I: Image index: 0, Swap type: perm
I: Primary image: magic=bad, swap_type=0x0, copy_done=0x2, image_ok=0x2
I: Secondary image: magic=good, swap_type=0x1, copy_done=0x3, image_ok=0x1
I: Boot source: none
I: Image index: 0, Swap type: perm
I: Image index: 0, Swap type: perm
I: Image index: 0, Swap type: perm
I: Image index: 0, Swap type: perm
E: Image in the primary slot is not valid!
E: Unable to find bootable image
I don't know if any of the adjustments I've made to the guide's instructions are what cause my problems, or if it's some other difference in the updated zephyr repo. Thank you for responding.