CPUNET PCD firmware update over USB_CDC

Setup: nrf5340dk
Zephyr: ncs 3.1.0

Hi, 
I am trying to enable firmware update for CPUNET over Serial (USB_CDC). I enabled update for CPUAPP and it works correctly, but not so successfull with CPUNET.
I've tried different topics, but at the end I think I don't fully understand the logic of the update.

By reading DFU for the nRF5340 SoC - Nordic Developer Academy I understood that signed_by_mcuboot_and_b0_hci_ipc.bin should go to CPUAPP flash and after reboot it will automatically try the update.
I have uploaded that bin over mcumgr and I can see it in image 0, slot 1


 image=0 slot=1
    version: 0.0.0
    bootable: true
    flags:
    hash: d4eae8a856a8130bb0cedce01afb84bb0f4cb178b91e42403e6bdcb95a6ee668

After reboot, nothing happens. If I run mcumgr test image, then this slot gets erased, but there is no update

I: Image index: 0, Swap type: none
W: Cannot upgrade: slots have non-compatible sectors

Can you please give me some advice or info what I am doing wrong?
Thank you a lot

Parents Reply Children
  • Hi Hung,

    Thank you for the response. Actually I got some more inputs via different channel.
    There I got this example:
    https://github.com/droidecahedron/nrf_ble_dfu_dle

    I've used it to confirm it works, and basically exercise DFU.

    Next steps on my side were to enable logs from both cores on nrf5340 and also from mcuboot, also added some instrumentation logs there. And I've put all partitions in internal flash just to exclude erroneous scenario with external one.

    These were my findings:
    * pm_static netcpu partitions were not good (mcuboot_primary_1 shoud go to ram, mcuboot_secondary_1 should go to flash)
    * watchdog was rebooting mcu during image swapping
    * buffers not the same size on CPUAPP and CPUNET config
    CONFIG_BT_BUF_ACL_RX_SIZE
    CONFIG_BT_BUF_ACL_TX_SIZE

    Best regards and thank you

  • Hi Nemanja, 
    Thanks for letting me know. I'm glad that you found the example on github. It's actually from one of our co-workers at Nordic. 

    Nemanja Jovicic said:
    * pm_static netcpu partitions were not good (mcuboot_primary_1 shoud go to ram, mcuboot_secondary_1 should go to flash)

    mcuboot_primary_1 in RAM is a bit strange for me. Could you explain a little bit more ? 

    Nemanja Jovicic said:
    * watchdog was rebooting mcu during image swapping

    The swapping process is done by MCUBoot, modification maybe needed to add Watchdog handling there. 

    Nemanja Jovicic said:
    * buffers not the same size on CPUAPP and CPUNET config
    CONFIG_BT_BUF_ACL_RX_SIZE
    CONFIG_BT_BUF_ACL_TX_SIZE

    You will need configurations especially for CPUNet as they are not on the same core. 

  • mcuboot_primary_1 in RAM is a bit strange for me. Could you explain a little bit more ? 

    Not much to say, except it was my first pm_static and I relied a bit more than I should on the tools that have "Inteligence" in their name.
    Learned some lessons not to use it anymore in this process.

Related