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

Data transfer via DFU

My example has an in-flash-memory data file that needs to be updated much more often than the code. I thought of using DFU for this and like it says here..

devzone.nordicsemi.com/.../

.. implementing a new "filetype". Has anyone tried this? Which files in DFU would need to be modified?

I have built my example in SDK12.3 . Would it be worth moving up to a more reset DFU implementation for this?

Thx.

  • Hi Paul,

    I'm not sure why you want to use bootloader for this task ? Could it be possible that you can just receive your memory data in your application and directly store that into flash ?

    The main reason of having a bootloader is to swap the application image, which the application can't do on it own.

  • Thx @Hung

    I should have said that the only interface available on the example I have in mind is BLE. I was thinking that I could avoid custom apps for this (at least for a quick prototype).

    (Apart from DFU, I don't think there's an off-the-shelf app for file transfer.)

    My latest thought is to attach an SD card and use FDS to save the data to flash. This is a little messy (wires etc) but will do if my first suggestion is too hard.

  • I don't think it would be very hard to make an app to send a file via BLE to the application. If you want to reuse the DFU app, you can also do that and just make your application so that the DFU app would think it's a bootloader and send the file.

    You can also of course modify the bootloader, so that when it see a certain flag (for example now we do 0x0104 as command to update application, you can create a new one, 0x0105 for instance). Then in the bootloader you store the data into specified place in flash.

    I don't think using SD card should be the best way here. You plan to unplug the card and plug it into PC and write the file there before plug the SD card back ?

  • Yes. If using the SD card we'd load it with the file from any machine with a writer and then transfer the card to the board(s) with the nRF52 and SD card socket. We then use a button to tell it to read the file into flash so we can remove the card.

    I also like the idea of adapting the DFU app to make it do file transfers. I see the Android sources are here github.com/.../Android-DFU-Library. There's also a cordova library here www.npmjs.com/.../cordova-plugin-nordic-dfu

Related