I see that BLE OTA DFU mechanism is available for RAK4631. Instead of using the BLE layer, I am developing a process to do the DFU using UART.
My approach would be to store the new image file on my modem’s (RAK2011 - BG96) storage and then to mimic whatever process BLE layer is doing to write to the memory of NRF chip (RAK4631).
However, in the the Bluefruit52Lib library, I don’t see the chip memory being exposed directly to the incoming BLE packets for DFU. All I see are supervisor calls that are using data fetched from BLE GATTS and in turn , maybe writing to the memory banks of the chip.
Therefore, I wanted to ask if I can directly write my image file to the memory banks and is my approach possible while remaining within the constraints of PlatformIO (and not involving the NRF SDK).
Hello @rommel
The BLE OTA DFU functions are handled directly in the bootloader and softdevice of the nRF52 and there is little possibility to change anything there.
If you want to do the DFU over UART, a better solution could be to look into the nrfutil source codes. The sources for the nrfutil app are available on Github
Thanks. I see that the source code is handling the firmware update on serial layer. Similar source code (image attached) is also part of the NRF SDK.
Which again takes me to the question whether I can integrate those SDK modules in my PlatformIO development environment.(which is using arduino as a framework)
As far as I know:
The Adafruit BSP is not using the full SDK, instead they are using something called nrfx which seems to be a kind of wrapper around the SDK functions.
Everything related to the SDK is in the nordic folder inside the BSP package : .platformio\packages\framework-arduinoadafruitnrf52\cores\nRF5
I never went down that deep into the SDK because usually it is not necessary.
Yeah, that’s correct. That modified part of SDK (nrfx) mainly contains peripheral drivers and not the whole SDK. Issues have been posted to make the full SDK available as a framework on platformIO. No progress yet.
Commercial customers often do not want OTA DFU because of the risks (fake firmware downloaded to remote devices).
Otherwise BLE OTA DFU is what I use most, specially if the device is in an IP65 enclosure and I do not want to open it for the update. It is very convenient for me.
What do you mean with truly wireless OTA? I do not understand that. BLE DFU is as wireless as it can get.
@beegee
Could you point out which one of these bootloader binaries provided by Adafruit nRF52 core is being used for RAK-4631 ? I am assuming it’s “pca10056” or is it a further modified form of it ?
Yes, that I am able to see. But it’s the one modified for RAK4631, I was asking for the original source (Adafruit bootloader) of this modified RAK bootloader.