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

USB-Serial DFU to nRF52840 on nRF91 DK Board

Hello, thank you for taking time to review this.

I am trying to setup a serial DFU setup for the nRF52 on the nRF91 DK board. I am running into problems getting it to work and understanding it in general.
I looked at several pages trying to help myself understand it
1) https://docs.zephyrproject.org/1.12.0/samples/subsys/usb/dfu/README.html
2) https://docs.zephyrproject.org/1.13.0/devices/dts/flash_partitions.html
3) https://mcuboot.com/mcuboot/readme-zephyr.html
4) https://docs.zephyrproject.org/1.12.0/samples/subsys/mgmt/mcumgr/smp_svr/README.html
5) https://github.com/apache/mynewt-mcumgr-cli
    As well as the links on these pages

I have tried several processes, but for the sake of conversation I will explain my most recent approach.

I compiled the MCUbootloader:
-in mcuboot/boot/zephyr/build

1) cmake -GNinja -DBOARD=nrf52840_pca10090 ..
2) ninja
3) ninja flash

Once I have flashed the bootloader
-in /zephyr/samples/bluetooth/beacon/build
1) cmake -GNinja -DBOARD=nrf52840_pca10090 ..
2) ninja
3) ~/<path/to/source>/ncs/mcuboot/scripts/imgtool.py sign \
--key ~/<path/to/source>/ncs/mcuboot/root-rsa-2048.pem \
--header-size 0x200 \
--align 8 \
--version 1.0 \
--slot-size 0x69000 --pad-header \
./zephyr/zephyr.hex b_signed.hex

After both are completed:
-in above build dir
1) nrfjprog --program b_signed.hex

Error:
Parsing hex file.
Reading flash area to program to guarantee it is erased.
ERROR: The area to write is not erased.

Notes:
I have tried signing the bootloader and loading at 0xC000
I have tried adding CONFIG_BOOTLOADER_MCUBOOT=y to the beacon prj.conf

I am just having trouble putting this all together and understanding how it all works and how to do it. My goal is to load some project like bluetooth/beacon, then use a serial DFU to change the project image to like the hello_world example and have it load into slot1, then switch it to slot0 after verification and then load hellow_world on reset/boot.

Thanks for your help

Parents
  • Also tried downloading a signed at 0x69000 .bin of a file with dfu-util
    --from example (dfu-util --alt 1 --download signed-hello.bin)

    dfu-util: Invalid DFU suffix signature
    dfu-util: A valid DFU suffix will be required in a future dfu-util release!!!
    Deducing device DFU version from functional descriptor length
    Opening DFU capable USB device...
    ID 05ac:821d
    Run-time device DFU version 0100
    Claiming USB DFU Runtime Interface...
    Determining device status: state = appIDLE, status = 0
    Device really in Runtime Mode, send DFU detach request...
    Resetting USB...
    Deducing device DFU version from functional descriptor length
    dfu-util: Lost device after RESET?

    And when attempting to move a signed image via mcumgr I get:

    Error: NMP timeout

Reply
  • Also tried downloading a signed at 0x69000 .bin of a file with dfu-util
    --from example (dfu-util --alt 1 --download signed-hello.bin)

    dfu-util: Invalid DFU suffix signature
    dfu-util: A valid DFU suffix will be required in a future dfu-util release!!!
    Deducing device DFU version from functional descriptor length
    Opening DFU capable USB device...
    ID 05ac:821d
    Run-time device DFU version 0100
    Claiming USB DFU Runtime Interface...
    Determining device status: state = appIDLE, status = 0
    Device really in Runtime Mode, send DFU detach request...
    Resetting USB...
    Deducing device DFU version from functional descriptor length
    dfu-util: Lost device after RESET?

    And when attempting to move a signed image via mcumgr I get:

    Error: NMP timeout

Children
No Data
Related