Add DFU support to custom HCI_RPMSG netcore image

I have separate app core enabled with DFU and secure boot. I added all that support with help from this ticket  nRF5340 Firmware Update from external NOR QSPI flash 

DFU for net core works fine.But it only works with an hci_rpmsg included automatically. How can I include the netcore DFU support in modified hci_rpmsg project. We compile this project but no "net_core_app_update.bin" is generated. How can I generate this DFU binary?

On app core image I have following configs enabled?

prj.conf

CONFIG_NRF53_UPGRADE_NETWORK_CORE=y
CONFIG_BOOT_IMAGE_ACCESS_HOOKS=y
CONFIG_PM_EXTERNAL_FLASH_MCUBOOT_SECONDARY=y
CONFIG_ADD_MCUBOOT_MEDIATE_SIM_FLASH_DTS=y

/child_image/mcuboot/prj.conf

CONFIG_PM_PARTITION_SIZE_MCUBOOT=0x10000
CONFIG_NORDIC_QSPI_NOR=y
CONFIG_NORDIC_QSPI_NOR_FLASH_LAYOUT_PAGE_SIZE=4096
CONFIG_NORDIC_QSPI_NOR_STACK_WRITE_BUFFER_SIZE=16

CONFIG_PCD_APP=y
CONFIG_UPDATEABLE_IMAGE_NUMBER=2
CONFIG_FLASH_SIMULATOR=y
CONFIG_FLASH_SIMULATOR_DOUBLE_WRITES=y
CONFIG_FLASH_SIMULATOR_STATS=n
CONFIG_BOOT_UPGRADE_ONLY=y


# Enable flash operations.
# CONFIG_SPI=y
CONFIG_FLASH=y
# This must be increased to accommodate the bigger images.
CONFIG_BOOT_MAX_IMG_SECTORS=256

# Disable netcore image OTA udpate
CONFIG_BOOT_IMAGE_ACCESS_HOOKS=n

Parents
  • Hi,

    modified hci_rpmsg project.

    The answer here depends on how you include the modified hci_rpmsg project into your application.

    What is your method for having a custom image on the network core?

    Regards,
    Sigurd Hellesvik

  • We treat it as separate project. we compile it separate and flash the netcore bin file via Jflash.
    Can we include the modified hci_rpmsg as a child image? It will be best case scenario.

  • Dilawar Ali said:
    One option is I can compile app core and modified hci_rpmsg separately and then use imagetool to generate the images.

    Yep

    Dilawar Ali said:
    Other way is to do multicore compilation using sysbuild, as described in the sampe "/multicore/Hello_World".

    Also correct.

    Dilawar Ali said:
    The project "hrdfu" I shared I tried to use sysbuild for multicore compilation. But it failed to compile app core image.

    But you can build and flash it using nrfjprog no? Or do you miss the hex file as well?

    Dilawar Ali said:
    My aim is to keep both app and netcore in a same project. If the build system can generate dfu packages for me, that will be awesome. 

    I asked our developers, and as far as I heard, we do not support automatic generating of DFU images for sysbuild yet. I would imagine that this is on a todo list somewhere.

  • Using the method "Other way is to do multicore compilation using sysbuild, as described in the sampe "/multicore/Hello_World"

    Only two images are generated "merged.hex" and "merged_CPUNET.hex". Putting them in programmer it looks like images are not correct.

    In file "build/hrdfu/zephyr/.config" the MCUBOOT bootloader config is not set. Whereas it is defined in prj.conf. Also the partition table generated in build folder donot contain mcuboot_primary or mcuboot_primary_1.

  • Dilawar Ali said:
    Putting them in programmer it looks like images are not correct.

    How so?

    Dilawar Ali said:
    In file "build/hrdfu/zephyr/.config" the MCUBOOT bootloader config is not set. Whereas it is defined in prj.conf. Also the partition table generated in build folder donot contain mcuboot_primary or mcuboot_primary_1.

    To enable mcuboot for a sysbuild project, you must set SB_CONFIG_BOOTLOADER_MCUBOOT in sysbuild.conf.
    You should not set mcuboot for the other images, I don't think.

  • Thanks for the suggestion.

    adding following configurations in sysbuild.conf I haven enabled the MCUboot, b0 and s1_image for app core.

    SB_CONFIG_BOOTLOADER_MCUBOOT=y
    SB_CONFIG_SECURE_BOOT=y
    SB_CONFIG_SECURE_BOOT_APPCORE=y


    I need to enable the bon and enable the netcore DFU update as well. But I can not add the following configuration in sysbuild.conf. 
    Where should I place these configuration?

    SB_CONFIG_SECURE_BOOT_NETCORE=y
    SB_CONFIG_NETCORE_APP_UPDATE=y
    




    Also looking at the Kconfig.dfu of sysbuild , If I need a DFU package for netcore I need to include the hci_rpmsg. Which will include the sample hci_rpmsg project. How can I enable this feature and use the custom hci_rpmsg?

    config DFU_MULTI_IMAGE_PACKAGE_NET
    	bool "Network core update"
    	depends on SUPPORT_NETCORE
    	depends on !NETCORE_NONE
    	depends on !NETCORE_EMPTY
    	depends on SECURE_BOOT_NETCORE

  • I am still looking into this, but it is taking some time, as sysbuild is new for us in technical support as well.

Reply Children
Related