Conditioanl compilation.

I am using mcuboot with the child image functionality.
my app should work for nrf52840dk and nrf5340dk.
I want to set up the configurations so that for each board, the right configurations would be chosen.
For the main image, I know this is pretty simple, I can just add the specific board configurations I want for nrf5340dk to nrf5340dk_nrf5340_cpuapp.conf for example.

How do I do the equivalent for the child image? 

I need to add:

CONFIG_BOOT_IMAGE_ACCESS_HOOK_NRF5340=y
CONFIG_BOOT_IMAGE_ACCESS_HOOKS=y

CONFIG_NRF53_MULTI_IMAGE_UPDATE=y
CONFIG_UPDATEABLE_IMAGE_NUMBER=2
CONFIG_PCD_APP=y

to the mcuboot child image on lt when it is flashed to the nrf5340dk.


thanks in advance, 
shlomo
Parents
  • Hello Sholomo,

    Setting separate configurations for the specific board (for the child image in a multi-board project), you have to use child_image/mcuboot/boards directory in the project. For each board, 

     

    • child_image/mcuboot/boards/nrf5340dk_nrf5340_cpuapp.conf (for nrf5340dk)
    • child_image/mcuboot/boards/nrf52840dk_nrf52840.conf (for nrf52840dk)

    For example, in your case you can place the configuration files in child_image/mcuboot/boards/nrf5340dk_nrf5340_cpuapp.conf file

    CONFIG_BOOT_IMAGE_ACCESS_HOOK_NRF5340=y
    CONFIG_BOOT_IMAGE_ACCESS_HOOKS=y
    
    CONFIG_NRF53_MULTI_IMAGE_UPDATE=y
    CONFIG_UPDATEABLE_IMAGE_NUMBER=2
    CONFIG_PCD_APP=y

    There is a previous case (+) Support for separate mcuboot configurations for nrf52840 and nrf5340 - Nordic Q&A - Nordic DevZone - Nordic DevZone, you can look at.

    Thanks.

    BR

    Kazi

  • thanks, few followups,
    1. I actually found out I can do that few moments ago, but the problem is once I create this mcuboot folder, it doesn't take the base prj.conf of the mcuboot imagae, forcing me to write one myself and putting it inside the mcuboot folder. If I create this folder, it means I have to override the entire prj.conf?
    2. I am also trying to take diffrent pm_static files for each board. I am trying to use the pm_static_<board name>.yaml convetntion but for some reason the build system doesnt pick it up, why is that?
    I am using ncs 2.7.0.

  • 1. Yes. You have to add the configurations of mcuboot from the default MCUboot prj.conf of the SDK. In addition to the change, you want to make you have to add this default one as well. 

    If you only want to add or override a few settings, you should instead use mcuboot.conf at the appropriate level, which overlays the default configuration rather than replacing it entirely.

    2. . I am also trying to take diffrent pm_static files for each board. I am trying to use the pm_static_<board name>.yaml convetntion but for some reason the build system doesnt pick it up, why is that?

    Can you show me the inside picture of your application folder?

Reply
  • 1. Yes. You have to add the configurations of mcuboot from the default MCUboot prj.conf of the SDK. In addition to the change, you want to make you have to add this default one as well. 

    If you only want to add or override a few settings, you should instead use mcuboot.conf at the appropriate level, which overlays the default configuration rather than replacing it entirely.

    2. . I am also trying to take diffrent pm_static files for each board. I am trying to use the pm_static_<board name>.yaml convetntion but for some reason the build system doesnt pick it up, why is that?

    Can you show me the inside picture of your application folder?

Children
No Data
Related