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.
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?
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?
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