DFU Mesh serial not working

Hello, 

I'm trying to use mesh_bootloader_serial_gccarmemb_nrf52832_xxAA.hex with my custom app based on light switch example. 

I'm working with nrf_mesh_sdk 5.0. nRF52832 and devkit.

I'm programming with : 

nrfjprog --eraseall 
mergehex --merge "nrf5_SDK_for_Mesh_v5/bin/softdevice/s132_nrf52_7.2.0_softdevice.hex" "nrf5_SDK_for_Mesh_v5/mesh/bootloader/build/mesh_bootloader_serial_gccarmemb_nrf52832_xxAA_Debug/mesh_bootloader_serial_gccarmemb_nrf52832_xxAA.hex" --output "SD_BL.hex"
mergehex --merge "SD_BL.hex" "myapp_nrf52832_xxAA_s132_7.2.0.hex" --output "SD_BL_APP.hex"
nrfjprog --program "SD_BL_APP.hex" --family NRF52 --chiperase
nrfjprog --reset


My app is working but the bootloader is not started. 

I tried and read all your documentations. The application starts but the bootloader does not. The start address for the application flash is 0x26000 and the bootloader starts at 0x78000.

I don't have any programming errors except when I try to program the setting.hex that I generate with nrfutil settings generate.


Why is my bootloader never called? I put logs and a delay without success.

Thank you 

Parents
  • Hello, 

    Ok thank you. 

    That means that I can run DFU update without using any bootloader. I just need to add it on the main code of light switch application ? 

    But why my bootloader doesn't works ? 

    Br, 

    Nabil

  • Hi Nabil, 

    I meant you can do DFU when you application running with the bootloader not without the bootloader. The bootloader and the application work at the same time. You need to flash the bootloader. 


    You just need to follow what we have in the \examples\dfu  example and flash the bootloader. 


    Have you tried to follow the instruction in the link I sent ? 

  • Exactly but it doesn't work with light switch. Do you have a list of command to program the light switch example with DFU and the bootloaders ? 

    The start address for the application flash is 0x26000 and the bootloader starts at 0x78000.

  • Hi Nabil, 
    Have you tried to test with the \examples\dfu  and managed to update the firmware ? 

  • Yes I tried the dfu_no_serial and dfu_serial example from your folder and it works. But when I copy paste the code I embed in light_switch it doesn't work. My goal is to integrate the DFU background mesh code into the light_switch code.

    Besides, the bootloader_verify.py script does not return a positive return.

    Is something stuck?


    nrfjprog --eraseall 
    python bootloader_verify.py <myserialnumber> <myserialport>
    nrfjprog --program "device_page_nrf52832_xxAA_s132_7.2.0.hex"
    nrfjprog --program "nrf5_SDK_for_Mesh_v5/bin/softdevice/s132_nrf52_7.2.0_softdevice.hex" 
    nrfjprog --program "nrf5_SDK_for_Mesh_v5/mesh/bootloader/build/mesh_bootloader_serial_gccarmemb_nrf52832_xxAA_Debug/mesh_bootloader_serial_gccarmemb_nrf52832_xxAA.hex"
    nrfjprog --program "light_switch_server_nrf52832_xxAA_s132_7.2.0_Debug/light_switch_server_nrf52832_xxAA_s132_7.2.0.hex"
    nrfjprog --reset


    I copied and pasted the DFU functions from the dfu_serial code into the light_switch code.

    The application works but the DFU does not start. And the bootloader obviously does not work

    Thank you in advance !

Reply
  • Yes I tried the dfu_no_serial and dfu_serial example from your folder and it works. But when I copy paste the code I embed in light_switch it doesn't work. My goal is to integrate the DFU background mesh code into the light_switch code.

    Besides, the bootloader_verify.py script does not return a positive return.

    Is something stuck?


    nrfjprog --eraseall 
    python bootloader_verify.py <myserialnumber> <myserialport>
    nrfjprog --program "device_page_nrf52832_xxAA_s132_7.2.0.hex"
    nrfjprog --program "nrf5_SDK_for_Mesh_v5/bin/softdevice/s132_nrf52_7.2.0_softdevice.hex" 
    nrfjprog --program "nrf5_SDK_for_Mesh_v5/mesh/bootloader/build/mesh_bootloader_serial_gccarmemb_nrf52832_xxAA_Debug/mesh_bootloader_serial_gccarmemb_nrf52832_xxAA.hex"
    nrfjprog --program "light_switch_server_nrf52832_xxAA_s132_7.2.0_Debug/light_switch_server_nrf52832_xxAA_s132_7.2.0.hex"
    nrfjprog --reset


    I copied and pasted the DFU functions from the dfu_serial code into the light_switch code.

    The application works but the DFU does not start. And the bootloader obviously does not work

    Thank you in advance !

Children
  • Hi Nabil, 
    Please clarify that by using dfu_serial  you have managed to update the mesh node and other nodes in the network. 

    How did you modify the light_switch example ? Have you included all the functions called in mesh_evt_handler() ? If you plan to receive the update via serial , in the preprocessor symbol you need to define NRF_MESH_SERIAL_ENABLE. You will also need to include serial library nrf_mesh_serial.c  . Please refer to the dfu example. 

    When you say it doesn't work, what exactly didn't work ? Which error you receive ? 

  • Thank you, 


    I don't need the serial connexion. In my case I have a mesh network and I want to do a DFU update via wireless connectivity. I say it doesn't work because my devkit connected to my pc is receiving dfu packets and segments fine but the remote devkit are not moving.

    If I don't use the serial what are the steps to integrate correctly in light switch? To be sure everything is done correctly

    in my case the "mesh_evt_handler" function is added in light_switch but something doesn't works

    Thanks for your help !

  •  

    In the code I have on the remote DEVKIT I have an error while initializing DFU commands. So that is exactly why I ask you my question. The way I program doesn't work for the bootloader. The app is ok but the bootloader is not. How can I program both app and booloader : light_switch example and nrf5_SDK_for_Mesh_v5/mesh/bootloader/build/mesh_bootloader_serial_gccarmemb_nrf52832_xxAA_Debug/

    I got this error : 

    if (BOOTLOADERADDR() == 0xFFFFFFFF)
        {
            /* No bootloader present. */
             __LOG(LOG_SRC_DFU, LOG_LEVEL_ERROR, "dfu_cmd_handler_set : NRF_ERROR_NOT_SUPPORTED!\n");
            return NRF_ERROR_NOT_SUPPORTED;
        }


    Thank you for your help 

  • Hi Nabil, 
    Before moving any further, please clarify if you have managed to do a DFU with the dfu_no_serial and dfu_serial example ? 
    Please use one board with serial that receive the image, and one board with dfu_no_serial and then confirm that the dfu_no_serial get updated to a new firmware. 

    When you program the hex files, please use the command one by one , don't use the script. And check the result of nrfjprog. please copy the full log here. 

  • Yes you are right.

    When working with precompiled bin dfu it works. But I'm trying to use sagger projet with light switch. 

    Here all my CMD : 

    nrfjprog --eraseall
    Erasing user available code and UICR flash areas.
    Applying system reset.
    
    nrfjprog --program "nrf5_SDK_for_Mesh_v5/bin/softdevice/s132_nrf52_7.2.0_softdevice.hex" 
    Parsing hex file.
    Reading flash area to program to guarantee it is erased.
    Checking that the area to write is not protected.
    Programming device.
    
    nrfjprog --program "nrf5_SDK_for_Mesh_v5/mesh/bootloader/build/mesh_bootloader_serial_gccarmemb_nrf52832_xxAA_Debug/mesh_bootloader_serial_gccarmemb_nrf52832_xxAA.hex"
    Parsing hex file.
    Reading flash area to program to guarantee it is erased.
    Checking that the area to write is not protected.
    Programming device.
    
    nrfjprog --program "nrf5_SDK_for_Mesh_v5/examples/dfu/build/dfu_no_serial_nrf52832_xxAA_s132_7.2.0_Debug/dfu_no_serial_nrf52832_xxAA_s132_7.2.0.hex"
    Parsing hex file.
    Reading flash area to program to guarantee it is erased.
    Checking that the area to write is not protected.
    Programming device.
    
    python pc-nrfutil-5.2.0/ settings generate --family NRF52 --application "nrf5_SDK_for_Mesh_v5/examples/dfu/build/dfu_no_serial_nrf52832_xxAA_s132_7.2.0_Debug/dfu_no_serial_nrf52832_xxAA_s132_7.2.0.hex" --application-version 1 --bootloader-version 1 --bl-settings-version 1 "DFU/setting.hex"
    
    I also tried --bl-settings-version 2
    
    Note: Generating a DFU settings page with backup page included.
    This is only required for bootloaders from nRF5 SDK 15.1 and newer.
    If you want to skip backup page generation, use --no-backup option.
    Generated Bootloader DFU settings .hex file and stored it in: DFU/setting.hex
    
    Bootloader DFU Settings:
    * File: DFU/setting.hex
    * Family: nRF52
    * Start Address: 0x0007F000
    * CRC: 0xFE5F3DE8
    * Settings Version: 0x00000001 (1)
    * App Version: 0x00000001 (1)
    * Bootloader Version: 0x00000001 (1)
    * Bank Layout: 0x00000000
    * Current Bank: 0x00000000
    * Application Size: 0x0001D658 (120408 bytes)
    * Application CRC: 0xF02D6B0F
    * Bank0 Bank Code: 0x00000001
    * Softdevice Size: 0x00000000 (0 bytes)
    * Boot Validation CRC: 0x00000000
    * SD Boot Validation Type: 0x00000000 (0)
    * App Boot Validation Type: 0x00000000 (0)
    
    
    nrfjprog --program "DFU/setting.hex" --verify
    Parsing hex file.
    Reading flash area to program to guarantee it is erased.
    ERROR: The area to write is not erased.

Related