This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

Application update with mesh sdk

HI,

I want to update the application FW in mesh sdk environment from flash memory. The new binary is in the flash memory already (I received it from a spi-ethernet interface). My plan is that I force the mesh protocol to recognize the received FW in the flash bank, then reboot board with calling the 'nrf_mesh_dfu_bank_flash(NRF_MESH_DFU_TYPE_APPLICATION)' function.

I started the mesh with 'nrf_mesh_dfu_request(..)' without problem (where I told to mesh the flash bank address), but the 'nrf_mesh_dfu_bank_flash' function returns with error message 5. It means, there is no valid flash bank.

My question is, how I tell to mesh, that the flash bank is valid?

nrf52840 with nRF5 sdk

Attila

Parents Reply Children
  • it's almost ready.

    I added a new 'dfu_packet' message struct to the application and to the bootloader, which contains (I think) all necessary data for the update. After the bootloader received the data, it loads them to the 'm_transaction' static struct, then it calls the 'dfu_mesh_finalize()' function. The result is that the bootloader erases the application memory, writes the binary into the right place, more times changes the device page area, then restarts itself. After restart the application does not start correctly, but I can see, that the new application wanted to start.

    not so easy....

  • finally, it's working.

    firstly I send a status (DFU_PACKET_TYPE_STATE) message to the bootloader with the new version number and I download binary to the flash..

    then I send a data (DFU_PACKET_TYPE_DATA) message with many informations for the DFU, This message payload data segment contains 0xffff, so the bootloader can separate this message from another data packet. Then the bootloader forwards this packet to a new function, which fills 'm_transaction' struct and starts the 'dfu_mesh_finalize()' function.

    (I could have made a new type message (e.g. DFU_PACKET_DATA_DFU) instead of the data type, but I think this is no matter.)

    simple, isn't it?

Related