Need help on enabling MCUBoot on a custom board based on the NRF5340 (BL5340PA) using internal flash for ncs version 2.6.2

Hello, I' needing some help on setting up the MCUBoot for the BL5340PA using the ncs 2.6.2. Currently I have the below add on for the prj.conf for the application core:

CONFIG_BOOTLOADER_MCUBOOT=y
CONFIG_NCS_SAMPLE_MCUMGR_BT_OTA_DFU=y

The built successfully went through but the problem is that I can't see the BLE device anymore and I don't really know where to start to debug the problem as the image was built with mcuboot enable. 
Would be greatly appreciated if anyone can provide a step by step walkthrough the process of setting up the MCUBoot for the nrf5340 (BL5340PA) on the ncs 2.6.2 ! 
Parents Reply Children
  • Hello thank you for the link! I was able to went through the tutorial however, I still have some problems setting up the pm_static.yml for the internal flash usage with FOTA using BLE. Any guidance or example code would be great! Below is my pm_static.yml

    app:
      address:     0x00c200
      end_address: 0x074000
      region: flash_primary
      size:        0x067e00
    
    mcuboot:
      address:     0x000000
      end_address: 0x00c000
      placement:
        before:
        - mcuboot_primary
      region: flash_primary
      size:        0x00c000
    
    mcuboot_pad:
      address:     0x00c000
      end_address: 0x00c200
      placement:
        align:
          start:   0x004000
        before:
        - mcuboot_primary_app
      region: flash_primary
      size:        0x000200
    
    mcuboot_primary:
      address:     0x00c000
      end_address: 0x074000
      orig_span: &id001
      - mcuboot_pad
      - app
      region: flash_primary
      sharers: 0x1
      size:        0x068000
      span: *id001
    
    mcuboot_primary_app:
      address:     0x00c200
      end_address: 0x074000
      orig_span: &id002
      - app
      region: flash_primary
      size:        0x067e00
      span: *id002
    
    mcuboot_secondary:
      address:     0x074000
      end_address: 0x0dc000
      placement:
        after:
        - mcuboot_primary
        align:
          start:   0x004000
      region: flash_primary
      share_size:
      - mcuboot_primary
      size:        0x068000
    
    #NetCore partitions
    # NetCore primary partition in AppCore RAM. Needed for DFU
    mcuboot_primary_1:
      address: 0x20000
      end_address: 0x40000
      device: flash_ctrl
      region: ram_flash
      size: 0x20000
    
    
    # RAM allocation for NetCore primary partition. Used by MCUBoot. Needed for DFU
    ram_flash:
      address: 0x20000
      end_address: 0x40000  # 0x20000 + 0x20000
      region: ram_flash
      size: 0x20000
    
    # NetCore secondary partition in internal flash. Needed for DFU
    mcuboot_secondary_1:
      address:     0x0dc000
      end_address: 0x0fc000
      placement:
        after:
        - mcuboot_secondary
      region: flash_primary
      size:        0x020000
    
    nvs_storage:
      address:     0x0fc000
      end_address: 0x100000
      placement:
        after:
        - mcuboot_secondary_1
      region: flash_primary
      size:        0x004000
      
    otp:
      address: 0xff8100
      end_address: 0xff83fc
      region: otp
      size: 0x2fc
    
    pcd_sram:
      address: 0x2006f000
      end_address: 0x20071000
      placement:
        before:
        - networkCore_sram
        - end
      region: sram_primary
      size: 0x2000
      
    networkCore_sram:
      address: 0x20071000
      end_address: 0x20080000
      placement:
        before:
        - end
      region: sram_primary
      size: 0xF000
      
    shared_sram:
      address: 0x20000000
      end_address: 0x20001000
      placement:
        before:
        - sram_primary
      region: sram_primary
      size: 0x1000
    
    sram_primary:
      address: 0x20010000
      end_address: 0x2006f000
      region: sram_primary
      size: 0x6e000

    I'm keep getting bellow error
    pm_sysflash.h:48:37: error: 'PM_MCUBOOT_PRIMARY_1_ID' undeclared (first use in this function); did you mean 'PM_MCUBOOT_PRIMARY_ID'?
       48 | #define FLASH_AREA_IMAGE_1_SLOTS    PM_MCUBOOT_PRIMARY_1_ID, PM_MCUBOOT_SECONDARY_1_ID
          |                                     ^~~~~~~~~~~~~~~~~~~~~~~
    C:/ncs/v2.6.2/bootloader/mcuboot/boot/zephyr/include/sysflash/pm_sysflash.h:55:29: note: in expansion of macro 'FLASH_AREA_IMAGE_1_SLOTS'
       55 |                             FLASH_AREA_IMAGE_1_SLOTS
          |                             ^~~~~~~~~~~~~~~~~~~~~~~~
    C:/ncs/v2.6.2/bootloader/mcuboot/boot/zephyr/include/sysflash/pm_sysflash.h:67:9: note: in expansion of macro 'ALL_AVAILABLE_SLOTS'
       67 |         ALL_AVAILABLE_SLOTS
          |         ^~~~~~~~~~~~~~~~~~~

Related