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

DFU project

I try to create coap server project and it should by  updateable by DFU. I merge project simple coap server and thread dfu client, and I keep  instructions in documentation to build it and run DFU. But Server doesnt response to coap requests and when I start multicast DFU process server is not updated. and when I try to start unicast DFU it waiting to promote a router. 

Parents
  • I am folowing this instructions:

    first version

    D:
    cd IS\nRF5_SDK_for_Thread_and_Zigbee_v3.1.0_c7c4730\examples\thread\dfu_client
    make -C dfu_client_coap_server\pca10056\blank\armgcc
    nrfutil settings generate --family NRF52840 --application dfu_client_coap_server\pca10056\blank\armgcc\_build\nrf52840_xxaa.hex --application-version 1 --bootloader-version 1 --bl-settings-version 1 settings.hex
    mergehex -m dfu_client_coap_server\pca10056\blank\armgcc\_build\nrf52840_xxaa.hex settings.hex -o dfu_client.hex
    nrfjprog -f nrf52 --eraseall
    nrfjprog -f nrf52 -r --program ..\..\..\components\softdevice\mbr\nrf52840\hex\mbr_nrf52_2.4.1_mbr.hex --chiperase
    nrfjprog -f nrf52 -r --program bootloader\pca10056\blank\armgcc\_build\nrf52840_xxaa_mbr.hex
    nrfjprog -f nrf52 -r --program dfu_client.hex --sectorerase


    code change

    next version
    make -C dfu_client_coap_server\pca10056\blank\armgcc
    nrfutil pkg generate --hw-version 52 --sd-req 0x00 --application-version 2 --application dfu_client_coap_server\pca10056\blank\armgcc\_build\nrf52840_xxaa.hex --key-file key.pem app_dfu_package.zip


    DFU multicast
    nrfutil dfu thread -f -pkg app_dfu_package.zip -p COM14 --channel 11 --panid 43981 -r 4 -rs 5000 -a FF03::1

    DFU unicast
    nrfutil dfu thread -f -pkg app_dfu_package.zip -p COM14 --channel 11 --panid 43981
    nrfutil dfu thread -f -pkg app_dfu_package.zip -p COM14 --channel 11 --panid 43981 -a fdde:ad00:beef:0:65ab:b4da:9355:117b

  • Hi,

    Can you post the log output? Have you tried to run the DFU client application without the coap server and see if everything works? Can you post your project folder so we can reproduce it?

    Best regards,

    Marjeris

  • Is exist any option how to debug dfu client project? 

  • After wtite my code DFU wont start. There is log from flashing DFU:

    Address not specified. Using ff03::1 (all Thread nodes)
    Using connectivity board at serial port: COM12
    Flashing connectivity firmware...
    Connectivity firmware flashed.
    Waiting for NCP to promote to a router...
    Thread DFU server is running... Press <Ctrl + D> to stop.

    And there is stoped. 

    There is log from RTT Viewer. 

    00> 
    <00> info> background_dfu: state=DFU_DOWNLOAD_INIT_CMD event=DFU_EVENT_PROCESSING_ERROR
    00> 
    <00> error> background_dfu: Processing error while downloading init command.
    00> 
    <00> info> background_dfu: Current DFU Diag version: Oct 22 2019 10:11:58, 0xC808AC73
    00> 
    <00> info> COAP_DFU: DFU trigger request received
    00> 
    <00> info> background_dfu: DFU trigger: init (sz=140, crc=2A5AA774) image (sz=363752, crc=F26E4F73)
    00> 
    <00> info> background_dfu: state=DFU_DOWNLOAD_TRIG event=DFU_EVENT_TRANSFER_COMPLETE
    00> 
    <00> warning> background_dfu: Installed image CRC is different
    00> 
    <00> warning> nrf_dfu_settings: Settings write aborted since it tries writing to forbidden settings.
    00> 
    <00> error> background_dfu: Init commad has changed
    00> 
    <00> info> background_dfu: Init complete. Unicast Mode.
    00> 
    <00> info> background_dfu: state=DFU_DOWNLOAD_INIT_CMD event=DFU_EVENT_TRANSFER_CONTINUE
    00> 
    <00> info> COAP_DFU: Requesting [i] (block:0 mid:25575)
    00> 
    <00> info> background_dfu: Storing block (b:0 c:0).
    00> 
    <00> info> background_dfu: state=DFU_DOWNLOAD_INIT_CMD event=DFU_EVENT_TRANSFER_CONTINUE
    00> 
    <00> info> COAP_DFU: Requesting [i] (block:1 mid:25576)
    00> 
    <00> info> background_dfu: Storing block (b:1 c:1).
    00> 
    <00> info> background_dfu: state=DFU_DOWNLOAD_INIT_CMD event=DFU_EVENT_TRANSFER_CONTINUE
    00> 
    <00> info> COAP_DFU: Requesting [i] (block:2 mid:25577)
    00> 
    <00> info> background_dfu: Storing block (b:2 c:2).
    00> 
    <00> info> nrf_dfu_validation: Signature required. Checking signature.
    00> 
    <00> info> nrf_dfu_validation: Calculating hash (len: 63)
    00> 
    <00> info> nrf_dfu_validation: Verify signature
    00> 
    <00> info> nrf_dfu_validation: Image verified
    00> 
    <00> warning> nrf_dfu_settings: Settings write aborted since it tries writing to forbidden settings.
    00> 
    <00> info> background_dfu: state=DFU_DOWNLOAD_INIT_CMD event=DFU_EVENT_PROCESSING_ERROR
    00> 
    <00> error> background_dfu: Processing error while downloading init command.
    00> 
    <00> info> background_dfu: Current DFU Diag version: Oct 22 2019 10:11:58, 0xC808AC73
    00> 

  • Hi Fran,

    You should be able to run a debugger on the application itself as with any other project. But looking at the log output it seems that the settings in flash could be corrupted somehow. You can take a look at the memory layout here, the dfu settings (bootloader settings) are stored near the end. You should check your linker file and adjust your RAM and flash settings accordingly.

    Best regards,

    Marjeris

  • it possible add to this dfu project coap client too? Now there is only coap server. I try add coap client but I have problems with communication. On the other site I dont get message. 

Reply Children
Related