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

HOW much free flash size for mesh dfu?

hi,everyone

 when i test the mesh/example/dfu , it is upgrade scucessed,but when i combine it to switch_light example ,it was failed , it looks end the transfer too early ,so I think:

  1.why it will recivied a mesh event "NRF_MESH_EVT_DFU_END" while the transfer  is ongoing

  2.is becuse there not have enought free flash size for store the new firmware?

 3.how much kilobytes does the UICR  & Application data occupy? as show below in picture:

Parents
  • Hello,

    Can you please try to add "verbose"  to the nrfutil (mesh version) call that you use to perform the DFU to see why the device suddenly stops accepting the packets?

    Check the note regarding "verbose" right above the "troubleshooting" section here. Please copy paste the log to this ticket. 

    I can help you interpreting the serial message log, but if you want to look at it yourself, you can find some information here and here.

    Best regards,

    Edvin

  • hi,Edvin

     thank you for help me,  I  add dfu to light_switch_provisioner  scucessfully, but failed in light_switch_server,

    i have seen this talk ,

    but not found the solution yet?

    below is my program script and fail log:

    program script , scucess programed:

    nrfjprog -f NRF52 -e
    
    nrfjprog -f NRF52 --program .\hex\s132_nrf52_6.1.0_softdevice.hex
    
    nrfjprog -f NRF52 --program E:\BaiduNetdiskDownload\nRF52832_Breakout\nrf5SDKforMeshv310src\examples\light_switch\server\build\light_switch_server_nrf52832_xxAA_s132_6.1.0_Debug\light_switch_server_nrf52832_xxAA_s132_6.1.0.hex
    
    nrfjprog -f NRF52 --program .\hex\mesh_bootloader_serial_gccarmemb_nrf52832_xxAA.hex
    
    nrfjprog -f NRF52 --program .\hex\settings\client_device_page_nrf52832_xxAA_s132_6.1.0.hex
    
    nrfjprog -f NRF52 --reset
    
    cmd /k echo.

    Generate DFU.zip

    E:
    cd BaiduNetdiskDownload\nRF52832_Breakout\nRF-DFU\mesh_dfu\pc-nrfutil
    
    nrfutil dfu genpkg --application E:\BaiduNetdiskDownload\nRF52832_Breakout\nrf5SDKforMeshv310src\examples\light_switch\server\build\light_switch_server_nrf52832_xxAA_s132_6.1.0_Debug\light_switch_server_nrf52832_xxAA_s132_6.1.0.hex ^
        --company-id 0x00000059 ^
        --application-id 1 ^
        --application-version 2 ^
        --key-file private_key.txt ^
        --sd-req 0x00AF ^
        --mesh dfu_test.zip
    
    
    cmd /k echo.

    DFU script :

    E: 
    
    cd BaiduNetdiskDownload\nRF52832_Breakout\nRF-DFU\mesh_dfu\pc-nrfutil 
    nrfutil --verbose  dfu serial -pkg dfu_test.zip -p COM24 -b 115200 -m -i 300
    
    cmd /k echo.

    fail pic:

    sometimes it transfer few packets and failed ,sometimes it transfer many packets and failed,

    when failed ,it may return :03841982  or 03840082 , 03840084 , 03847884 , ,03847884 , 03847887

    and I also track the RTT viewer ,it show below when stopped:

    0x3 means as below in the source file:

    NRF_MESH_DFU_END_ERROR_PACKET_LOSS,                /**< Too many packets were lost in the transfer. */

    so i change the transmit interval  -i 1000 but it still not work.

Reply
  • hi,Edvin

     thank you for help me,  I  add dfu to light_switch_provisioner  scucessfully, but failed in light_switch_server,

    i have seen this talk ,

    but not found the solution yet?

    below is my program script and fail log:

    program script , scucess programed:

    nrfjprog -f NRF52 -e
    
    nrfjprog -f NRF52 --program .\hex\s132_nrf52_6.1.0_softdevice.hex
    
    nrfjprog -f NRF52 --program E:\BaiduNetdiskDownload\nRF52832_Breakout\nrf5SDKforMeshv310src\examples\light_switch\server\build\light_switch_server_nrf52832_xxAA_s132_6.1.0_Debug\light_switch_server_nrf52832_xxAA_s132_6.1.0.hex
    
    nrfjprog -f NRF52 --program .\hex\mesh_bootloader_serial_gccarmemb_nrf52832_xxAA.hex
    
    nrfjprog -f NRF52 --program .\hex\settings\client_device_page_nrf52832_xxAA_s132_6.1.0.hex
    
    nrfjprog -f NRF52 --reset
    
    cmd /k echo.

    Generate DFU.zip

    E:
    cd BaiduNetdiskDownload\nRF52832_Breakout\nRF-DFU\mesh_dfu\pc-nrfutil
    
    nrfutil dfu genpkg --application E:\BaiduNetdiskDownload\nRF52832_Breakout\nrf5SDKforMeshv310src\examples\light_switch\server\build\light_switch_server_nrf52832_xxAA_s132_6.1.0_Debug\light_switch_server_nrf52832_xxAA_s132_6.1.0.hex ^
        --company-id 0x00000059 ^
        --application-id 1 ^
        --application-version 2 ^
        --key-file private_key.txt ^
        --sd-req 0x00AF ^
        --mesh dfu_test.zip
    
    
    cmd /k echo.

    DFU script :

    E: 
    
    cd BaiduNetdiskDownload\nRF52832_Breakout\nRF-DFU\mesh_dfu\pc-nrfutil 
    nrfutil --verbose  dfu serial -pkg dfu_test.zip -p COM24 -b 115200 -m -i 300
    
    cmd /k echo.

    fail pic:

    sometimes it transfer few packets and failed ,sometimes it transfer many packets and failed,

    when failed ,it may return :03841982  or 03840082 , 03840084 , 03847884 , ,03847884 , 03847887

    and I also track the RTT viewer ,it show below when stopped:

    0x3 means as below in the source file:

    NRF_MESH_DFU_END_ERROR_PACKET_LOSS,                /**< Too many packets were lost in the transfer. */

    so i change the transmit interval  -i 1000 but it still not work.

Children
  • So this is receiving the DFU image over Mesh, not serial, right? 

    What compiler did you use to compile the projects? What type and what version?

    It looks like your serial device is rejecting the packet, and hence, the other device receiving the DFU image is not getting any more packets.

    I don't know the internal state machines too well, but are you sure you signed the DFU image with the correct keys? And that it is the same that is used in the device_page for your devices? Did you use your key in the device page?

    Have you tested the DFU just running the DFU getting started guide? I know it isn't much help with your final application, but it may uncover some basic errors in your setup. Could you give it a go?

    https://www.nordicsemi.com/DocLib/Content/SDK_Doc/Mesh_SDK/v3-1-0/md_doc_getting_started_dfu_quick_start

    Best regards,

    Edvin

  • So this is receiving the DFU image over Mesh, not serial, right? 

    one device over serial ,the other over mesh ,both are scucessd in  light_switch_proversioner

    What compiler did you use to compile the projects? What type and what version?

    i use the mesh3.1.0/example/light_switch , SES  IDE , i nerver modify the project options , i guess it is GCC show in the as show in the option->compiler . i use the bin/bootloader / gccarmemeb / mesh_bootloader_serial_gccarmemb_nrf52832_xxAA.hex , is there any problem?

    I don't know the internal state machines too well, but are you sure you signed the DFU image with the correct keys? And that it is the same that is used in the device_page for your devices? Did you use your key in the device page?

    yes , i use the same private_key.txt to generate device_page.hex and DFU image ,do as the 10 steps.

    Have you tested the DFU just running the DFU getting started guide? I know it isn't much help with your final application, but it may uncover some basic errors in your setup. Could you give it a go?

    i have scucess add dfu in light_switch_proversioner , so i think i  did the correct actions as the 10 steps says.

    the only thing i do not know is why it stopped in the middle?

  • ycp said:
    i use the mesh3.1.0/example/light_switch , SES  IDE , i nerver modify the project options , i guess it is GCC show in the as show in the option->compiler . i

     So you compile in SES, right?

    Can you open SES and click "Help"-> About Segger Embedded Studio and take a screenshot of the window that pops up?

    What SES release version do you have, and what GNU ARM Embedded Toolchain version do you have?

    I you don't have SES version 3.40, can you try to swich to this version (It is the recommended version in the SDK release notes).

    I know it sounds weird, but I have seen other customers having issues that was resolved by changing to this version of the compiler. Even though I don't know exactly what the problem is, different compiler versions behaves a bit different when optimization is enabled, and if there is a mismatch between the precompiled files and the files that you compile, it may lead to some weird behavior. 

    Let me know what version you have, and if it isn't 3.40, does it help to change to this?

    BR,

    Edvin

  • hi,Edvin

    thanks

    I have solved this by change some code in "example / light_switch_server" as below, thougth i do not know why it works:

    in "nrf_mesh_config_app.h"

    /** PB-GATT feature. To be enabled only in combination with linking GATT files. */
    #define MESH_FEATURE_PB_GATT_ENABLED                    (0)
    /** GATT proxy feature. To be enabled only in combination with linking GATT proxy files. */
    #define MESH_FEATURE_GATT_PROXY_ENABLED                 (0)
    /** @} end of MESH_CONFIG_GATT */

    in "app_config.h"

    #define NRF_BLE_CONN_PARAMS_ENABLED 0

    maybe it can not support PROXY and DFU coexsit ?

  • It should be able to, but there are more than these two defines that are needed to support it. Have you tried to debug? Where does your code stop? Is it getting caught by an ERROR_CHECK() or APP_ERROR_CHECK() that it is not getting past? What is your NRF_SDH_BLE_VS_UUID_COUNT in sdk_config.h?

    BR,

    Edvin

Related