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

how to upgrade nrf52840 application with OTBR

                Hi,I am working on an OTBR, nrf52840 connects to the router through SPI, I want to know how to upgrade 52840 through the router. The router use OpenWRT. please give me some suggestions .thank you.

  • There are no upgrade options in OpenWRT/NCP (Network Co Processor) itself, as far as I know. One solution could be to use a serial bootloader (needs to be ported from UART to SPI), and then use the nRF5 SDK's serial bootloader. You must use nrfutil to generate the FW image, and you can use nrfutil to transfer the image (nrfutil uses USB->UART, so this would also need to be ported.).

    I don't know what your PCB looks like. If you have a large main CPU, perhaps it is easier to add an SWD connection, and program it manually?

  • Thank you so much for your kind reply. Follow your suggestions, I found the corresponding Nordic documents, which instructed us to use the UART-DFU interface to upgrade the nRF SoC (https://infocenter.nordicsemi.com/topic/sdk_nrf5_v17.0.0/sdk_app_serial_dfu_bootloader.html). So I want to try the DFU upgrade with UART first, which mentioned DFU mode to use the bootloader. I updated the module with the HEX compiled from the SDK (<InstallFolder>\examples\dfu\secure_bootloader\pca10056_uart), with command: nrfjprog --reset --program examples\dfu\secure_bootloader\pca10056_uart\secure_bootloader_uart_mbr_pca10056.hex --family NRF52 --sectoranduicrerase Then use the nrfutil command to upgrade: nrfutil dfu serial -pkg hrs_application_s140.zip -p COM4 The result prompts 'No ping Response after opening COM Port'. I am very confused. I did according to the documentation, whether I burned the wrong bootloader or the wrong command to upgrade? Any suggestions would be highly appreciated. Best, Tao
  • Hello,

    There are a few traps here. I actually recommend you to try to follow this guide

    However, in your case, if you want to test the prebuilt images:

    There is something called the MBR, which is responsible for moving around the application images when the DFU is complete. The MBR is included as a part of the softdevice, but also exists as a standalone .hex file found in SDK\components\softdevice\mbr\hex\*.hex

    So when you are working with bootloaders, you need to either program the softdevice you intend to use, or the MBR. In your case, since you are trying to update the application to an application that uses the softdevice, I suggest you program the softdevice (which also includes the MBR).

    After you program the [SoftDevice or MBR], and the bootloader, and reset the device, you should see two LEDs turned on on the DK. This indicates that the device is in bootloader mode. 

    I am not sure exactly what bootloader hex file you are using. I can't find any prebuilt bootloader in:

    SDK\examples\dfu\secure_bootloader\pca10056_uart\secure_bootloader_uart_mbr_pca10056.hex. 

    If you built the bootloader yourself, then the test image will not work, because it doesn't use a matching key set (private and public keys). To generate a matching key set, please see the guide in the link in the top of this reply.

    If you want to only test the transfer, you can do the following: First, make sure that no other programs are using the COM port for your DK (power cycle it to be sure, and close all programs that uses the DK. Then open a terminal:

    cd <SDK>\examples\dfu\secure_dfu_test_images\uart\nrf52840
    nrfjprog -e
    nrfjprog --program ..\..\..\..\..\components\softdevice\s140\hex\s140_nrf52_7.0.1_softdevice.hex --verify
    nrfjprog --program bootloader_secure_uart_debug_without_bonds_mbr.hex --verify
    nrfjprog --reset
    nrfutil dfu serial -pkg hrs_application_s140.zip -p COM4

    After the last command, it will take some time, and then LED1 should start blinking, indicating that the application is running, and the DK is advertising. 

    The guide above is aiming for a BLE bootloader, but the method is very similar in the serial bootloader. It is just a matter of changing the DFU transport from nRF Connect on a phone to the "nrfutil dfu serial ..." that you are already using. 

    Best regards,

    Edvin

Related