How to change base address of HCI_IPC example

board : nRF5340

sdk-nrf : v2.7.99-cs2

Zephyr version: 3.6.99
I am following https://docs.nordicsemi.com/bundle/ncs-latest/page/nrf/app_dev/bootloaders_dfu/qspi_xip_split_image.html page and able to build nRF5340 bootloader , app , boN and HCI_IPC.
SB_CONFIG_BOOTLOADER_MCUBOOT=y
SB_CONFIG_PM_EXTERNAL_FLASH_MCUBOOT_SECONDARY=y
SB_CONFIG_NETCORE_APP_UPDATE=y
SB_CONFIG_SECURE_BOOT_NETCORE=y
SB_CONFIG_QSPI_XIP_SPLIT_IMAGE=y

# This will enable the hci_ipc image for the network core, change to the desired image
SB_CONFIG_NETCORE_HCI_IPC=y
Output in build directory - (build/partitions_CPUNET.yml)
  • hci_ipc address = 0x1008800
  1. Does build/hci_ipc/zephyr/zephyr.hex is already appended with header of 512 bytes
  2. If no then I want to rearrange hci_ipc and it should start from 0x1008A00 instead of 0x1008800. I want to use initial 512 bytes for headers



Parents
  • Hello kalpeshkadam,

    Could you please elaborate what kind of 512-byte header you expect here?

    Hieu

  • We have custom header for image verification in case of OTA. 

  • I am afraid this cannot work without changing b0n. The start address of the network core image is used in b0n to both transfer the image over PCD and also to boot. This address is automatically extract from the build system.

    To do what you need, you need to not only change b0n but also dive into the build system and change it.

    Meanwhile, there are already validation mechanisms in b0n and MCUboot. Are they insufficient for you?

  • Attached build directory 'build.zip".
    CONFIG_PM_PARTITION_SIZE_PROVISION=0x1000 helps to make PM_APP_ADDRESS aligned with 0x1009800 as PM_APP_ADDRESS needs 2KB alignment.
    Thus provision is ending at #define PM_PROVISION_END_ADDRESS 0x1009800.
    Please note that, I am trying to use 0x1009000 - 0x1040000 space for HCI_IPC Net core application. There is a overlapping between PROVISION and NET_APP of 2KB (0x1009000-0x1009800). 
    This 2KB (0x1009000-0x1009800) is used for custom header of NET_APP.
     
    Thus I am able to use...
    0x1000000 - 0x1008800 :  b0N          (34 KB)
    0x1008800 - 0x1009800 :  provision  (04 KB = 02 KB + 2KB(overlap))
    0x1009000 - 0x1009800 :  Custom header of NET_APP (2KB) , Part of FOTA image
    0x1009800 - 0x1040000:  NET APP  (218 KB)
    #define PM_B0N_END_ADDRESS 0x1008800
    #define PM_APP_ADDRESS 0x1009800

    Now if I check build\b0n\zephyr\include\generated\pm_config.h, 

    #define PM_MCUBOOT_PRIMARY_1_ADDRESS 0x0
    #define PM_MCUBOOT_PRIMARY_1_END_ADDRESS 0x40000
    #define PM_MCUBOOT_PRIMARY_1_SIZE 0x40000

    #define PM_MCUBOOT_SECONDARY_1_ADDRESS 0x6e0000
    #define PM_MCUBOOT_SECONDARY_1_END_ADDRESS 0x720000
    #define PM_MCUBOOT_SECONDARY_1_SIZE 0x40000

    Observation 
    Currently command_status = PCD_STATUS_FAILED and failing NET core upgrade process.
    Questions 
    1. In PM_Static.yml file, mcuboot_primary_1 represents  flash_simulators and represents NET Core flash. As per attached diagram, Does NET_APP image presents in secondary will get copied into Net core internal flash.
    mcuboot_primary_1:
      address: 0x0
      device: flash_ctrl
      end_address: 0x40000
      region: ram_flash
      size: 0x40000
Reply
  • Attached build directory 'build.zip".
    CONFIG_PM_PARTITION_SIZE_PROVISION=0x1000 helps to make PM_APP_ADDRESS aligned with 0x1009800 as PM_APP_ADDRESS needs 2KB alignment.
    Thus provision is ending at #define PM_PROVISION_END_ADDRESS 0x1009800.
    Please note that, I am trying to use 0x1009000 - 0x1040000 space for HCI_IPC Net core application. There is a overlapping between PROVISION and NET_APP of 2KB (0x1009000-0x1009800). 
    This 2KB (0x1009000-0x1009800) is used for custom header of NET_APP.
     
    Thus I am able to use...
    0x1000000 - 0x1008800 :  b0N          (34 KB)
    0x1008800 - 0x1009800 :  provision  (04 KB = 02 KB + 2KB(overlap))
    0x1009000 - 0x1009800 :  Custom header of NET_APP (2KB) , Part of FOTA image
    0x1009800 - 0x1040000:  NET APP  (218 KB)
    #define PM_B0N_END_ADDRESS 0x1008800
    #define PM_APP_ADDRESS 0x1009800

    Now if I check build\b0n\zephyr\include\generated\pm_config.h, 

    #define PM_MCUBOOT_PRIMARY_1_ADDRESS 0x0
    #define PM_MCUBOOT_PRIMARY_1_END_ADDRESS 0x40000
    #define PM_MCUBOOT_PRIMARY_1_SIZE 0x40000

    #define PM_MCUBOOT_SECONDARY_1_ADDRESS 0x6e0000
    #define PM_MCUBOOT_SECONDARY_1_END_ADDRESS 0x720000
    #define PM_MCUBOOT_SECONDARY_1_SIZE 0x40000

    Observation 
    Currently command_status = PCD_STATUS_FAILED and failing NET core upgrade process.
    Questions 
    1. In PM_Static.yml file, mcuboot_primary_1 represents  flash_simulators and represents NET Core flash. As per attached diagram, Does NET_APP image presents in secondary will get copied into Net core internal flash.
    mcuboot_primary_1:
      address: 0x0
      device: flash_ctrl
      end_address: 0x40000
      region: ram_flash
      size: 0x40000
Children
No Data
Related