This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

Flash and debug application with signed bootloader in IAR or how to flash Bootloader Settings before debugging

I have a project which needs to be built in IAR, but uses the signed bootloader. I understand, that if I want to flash and debug the application from within IAR, I need to also write the Bootloader Settings page, otherwise the application won't be loaded because the CRC check failed.

How can I do this in IAR before starting the debugger? In Keil uVision 5, there is the possibility to load the bootloader settings using an init file (in the "Utilities" tab, section "Configure Flash Menu Command"). In the init file, I can simply load the "settings.hex" generated by nrfutil. Unfortunately I fail to find an equivalent possibility in Keil.

Do you have any pointers or are there example projects where this works?

Parents
  • I managed to solve the issue using the following steps:

    1. Converted the .hex-file generated by nrfutil to a raw binary file.
    2. Created an additional IAR-project for the bootloader settings, which is configured according to the IAR Technical Note 21367, with linker addresses adjusted to match the bootloader settings page and including the binary generated in 1. This is actually configured to be done in the pre-build of this IAR-project.
    3. In the post-build of the actual application IAR-project, generate the bootloader settings .hex-file using nRF-util and then invoke the IAR build of the bootloader settings IAR-project.
    4. In the project settings of the application IAR project, go to "Debugger" > "Images" and tick "Download extra image" and select the .out-file generated in the bootloader settings IAR-project and set the offset to the location of the Bootloader-settings page.
Reply
  • I managed to solve the issue using the following steps:

    1. Converted the .hex-file generated by nrfutil to a raw binary file.
    2. Created an additional IAR-project for the bootloader settings, which is configured according to the IAR Technical Note 21367, with linker addresses adjusted to match the bootloader settings page and including the binary generated in 1. This is actually configured to be done in the pre-build of this IAR-project.
    3. In the post-build of the actual application IAR-project, generate the bootloader settings .hex-file using nRF-util and then invoke the IAR build of the bootloader settings IAR-project.
    4. In the project settings of the application IAR project, go to "Debugger" > "Images" and tick "Download extra image" and select the .out-file generated in the bootloader settings IAR-project and set the offset to the location of the Bootloader-settings page.
Children
No Data
Related