DFU OTA by using mcuboot bootloader in serial recovery mode #ble #hci #nrf52480 #uart
Right now I'm exploring the best way to do DFU OTA.
I would like to ask that how i can do the DFU by booting the mcuboot bootloader in serial recovery mode.
I have one nrf52840_pca10056 chip integrated on my custom board, which has mcuboot as a bootloader. I don't have any direct pin access to the nrf chip.
I'm doing an OTA for zephyr's hci_uart sample application.
My aim is:
- Flash mcuboot
- Flash hci_uart application one time using Jlink segger (For beacon scanning)
- After that i should be able to do DFU OTA on field, without having any Jlink kind of wired connection.
I had a similar requirement, also without a button on the same Nordic chip. I simply copied this file into my project, and called smp_svr_init() from my main() after bluetooth was up and running
This creates a Bluetooth advertisement for OTA update, and I can push new images from mu Ubuntu system with:
Use mcumgr to upload the new version over Bluetooth
sudo bash # must run as root to access the Bluetooth device
mcumgr conn add zephyr type=ble connstring=peer_name="My Device" # make a symbolic name for the device
mcumgr -c zephyr image list # Query device for its current image list.
mcumgr -c zephyr image upload build/zephyr/zephyr.signed.bin # Upload new image to device.
mcumgr -c zephyr image test <image-hash> # Tell the device to run the new image on its next boot ("test" the new image).
mcumgr -c zephyr reset # Reboot the device.
mcumgr -c zephyr image list # Query device for its current image list; ensure new image is running.
mcumgr -c zephyr image confirm # Make the image swap permanent.
You do need to get the right bits in your prj.conf file, I think these are all you need, but there may be more…
# Allow for large Bluetooth data packets.
# Enable the Bluetooth and shell mcumgr transports.
# Required by the `taskstat` command.
# Enable statistics and statistic names.
# Enable all core commands.
Unfortunately you will need to reflash your units with JTAG/SWD to get the smp_svr in, but after that you can do OTA.
From: devel@... <devel@...> On Behalf Of Mayank
Sent: Tuesday, December 3, 2019 6:47 AM
Subject: [Zephyr-devel] DFU OTA by using mcuboot bootloader in serial recovery mode #ble #hci #nrf52480 #uart
|1 - 2 of 2|