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

Mesh DFU Example 52840 - No CMD handler

Using 840DK and latest Segger (4.42)

Building Mesh DFU example: dfu_nrf52840_xxAA_s140_7_0_1

Latest Mesh SDK v4

Latest SDK 16

Build with no errors, when starting debug, loads app, soft device without any problems, an runs with following output: No CMD handler!

In one post found suggestion to change RAM_PH_SIZE to RAM_SIZE in flash_placement.xml

 <MemorySegment name="RAM" start="$(RAM_PH_START)" size="$(RAM_PH_SIZE)">

but this results in the linking errors.

Building ‘dfu_nrf52840_xxAA_s140_7.0.1’ from solution ‘dfu_nrf52840_xxAA_s140_7.0.1’ in configuration ‘Debug’
Generating linker script ‘dfu_nrf52840_xxAA_s140_7.0.1.ld’
Linking dfu_nrf52840_xxAA_s140_7.0.1.elf
.reserved_ram is too large to fit in RAM memory segment
.data_run is too large to fit in RAM memory segment
.bss is too large to fit in RAM memory segment
.heap is too large to fit in RAM memory segment
section .heap overlaps absolute placed section .stack
Build failed

<t: 0>, main.c, 194, ----- Bluetooth Mesh DFU Example -----
<t: 13451>, serial_handler_prov.c, 267, Generating encryption keypair...
<t: 18243>, main.c, 200, Initialization complete!
<t: 22923>, main.c, 221, Enabling serial interface...
<t: 22926>, mesh_app_utils.c, 65, Device UUID (raw): A5C185160B129148864B03CC8F8DA428
<t: 22929>, mesh_app_utils.c, 66, Device UUID : 1685C1A5-120B-4891-864B-03CC8F8DA428
<t: 22939>, nrf_mesh_dfu.c, 919, ERROR: No CMD handler!
<t: 22946>, main.c, 229, DFU example started!

  • Tried to upload bootloader, generated with python script, but this is too small for the bootloader, you call it device page. It looks like below. Is it correct?

    Looking for the image for the bootloader for the 52832, I want to use it with dfu example - I would need one with serial I/F for my controller device, and one without UART for the emergency lights.

    Piotr

    C:\work\svn\produkte\WIRELESS\mesh\nrf5_SDK_for_Mesh_v4.0.0_src\tools\dfu\bin>nrfjprog --program device_page_nrf52832_xxAA_s132_7.0.1.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.

    C:\work\svn\produkte\WIRELESS\mesh\nrf5_SDK_for_Mesh_v4.0.0_src\tools\dfu\bin>nrfjprog --memrd 0xfeff0 --w 8 --n 0x80
    0x000FEFF0: FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF |................|
    0x000FF000: 04 01 08 08 03 00 12 00 00 70 02 00 00 00 0D 00 |.........p......|
    0x000FF010: 03 00 10 00 00 10 00 00 00 70 02 00 03 00 11 00 |.........p......|
    0x000FF020: 00 80 0F 00 00 60 00 00 05 00 02 00 CA 00 01 01 |.....`..........|
    0x000FF030: 59 00 00 00 01 00 01 00 00 00 FF FF 02 00 04 00 |Y...............|
    0x000FF040: FF FF FF FF FF FF FF 7F FF FF FF FF FF FF FF FF |................|
    0x000FF050: FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF |................|
    0x000FF060: FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF |................|

  • Trying to load and execute: dfu_nrf52832_xxAA_s132_7_0_1.emProject

    Current steps:

    use nrfjprog to load bin/app_green_s132.hex - it loads at address 0x1F000

    C:\work\svn\produkte\WIRELESS\mesh\nrf5_SDK_for_Mesh_v4.0.0_src\examples\dfu\bin>nrfjprog --program app_green_s132.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.

    C:\work\svn\produkte\WIRELESS\mesh\nrf5_SDK_for_Mesh_v4.0.0_src\examples\dfu\bin>nrfjprog --memrd 0x1eff0 --w 8 --n 0x20
    0x0001EFF0: FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF |................|
    0x0001F000: 00 F0 00 20 B1 F5 01 00 D9 F5 01 00 DB F5 01 00 |... ............|

    load app through SES - it owerwrites the bootloader. Read back after app load:

    C:\work\svn\produkte\WIRELESS\mesh\nrf5_SDK_for_Mesh_v4.0.0_src\examples\dfu\bin>nrfjprog --memrd 0x1eff0 --w 8 --n 0x20
    0x0001EFF0: 62 FA A0 68 00 78 C0 F3 80 11 60 68 01 27 90 F8 |b..h.x....`h.'..|
    0x0001F000: 4D 20 00 2A 18 BF 00 29 04 D0 6A 79 02 F0 C0 02 |M .*...)..jy....|

  • Questions would be:

    at what address the bootloader should be loaded at?

    how do you set the UICR value after uploading the bootloader?

  • Hi Piotr, 

    You would need to flash the bootloader in addition to the DFU application and the device page. 

    So 4 things need to be flashed: 

    - softdevice

    - bootloader

    - dfu application (\examples\dfu)

    - device page. 

    The bootloader binary file can be found at \Mesh_v4.0.0\bin\bootloader

    You can compile the bootloader as well, to compile the bootloader you do this on the commandline: 

    cmake -G Ninja .. -DSDK_ROOT=[path to your nRF5 SDK] -DCMAKE_BUILD_TYPE=MinSizeRel -DBUILD_BOOTLOADER=ON


  • Good, some progress...

    2 questions:

    Which bootloader is "better": gccarmemb or armcc?

    Are the softdevices the same as in the sdk16? Why are those duplicated here?

Related