RedBearLab/nRF51822-Arduino

OTA update works only once after copy/pasting the bootloader.hex to MBED drive

Opened this issue · 0 comments

Hi all! Thanks guys for your awesome work with this plugin!

I have some issues to make OTA work reliably(more than once), using the bootloader.hex provided in the bootloader folder, using Windows 7 and Arduino IDE software.

  1. I attach the mk20 USB dongle
  2. I copy /paste the bootloader.hex file to the MBED drive which is shown in Windows 7
  3. I detach the Nano and power it on with a battery
  4. Then I compile the sketch in Arduino, using BLE NANO v1.5 32Kb as board, export the compiled .hex file
  5. A file named "test.ino_OTA.BLE_Nano.hex" is created inside of the "test" folder
  6. Using google drive I can find the hex file inside my smartphone
  7. Using the Nrf toolbox DFU app in my smartphone I select the "test.ino_OTA.BLE_Nano.hex" and to upload it as application
  8. I select "DFU" in the devices scanned
  9. I click on Upload and it says "Uploading" and then "Starting DFU" with the progress bar and then "Success"
  10. Now the firmware is successfully uploaded and I can see the different behaviour of pins of the Nano

From now on, If I try to upload the same "test.ino_OTA.BLE_Nano.hex" file again, I can't find anymore the "DFU" device within the list of nearby devices, thus I can't upload any file!!

Then I tried to reset the power and I can see "DFU" device appearing only for 5 seconds, then it disappears from the list and the last uploaded firmware behaviour runs.

Trying to upload within these first 5 seconds I get "Uploading" and then "DFU DEVICE DISCONNECTED" error message.

If I upload the bootloader.hex again, using mk20 and the usb cable, then OTA starts to work again but always only once.

I checked the "test.ino_OTA.BLE_Nano.hex" file size and it is very small: 17,3 KB, while the bootloader.hex is
337KB

  • Why this difference of size?
  • Why the DFU device disappears after 5 seconds? Is it expected?
  • Why the error message "DFU DEVICE DISCONNECTED" when uploading during first 5 seconds?

I checked there are also 2 files in the bootloader folder:

  • Copy/pasting the "SoftdeviceS130_1.0_Bootloader_20160824.hex" instead of the bootloader.hex I get a "DFUTarg" advertising message from the Nano instead of the "DFU" device.
  • Copy/pasting the "SoftdeviceS130_1.0_Bootloader_Blinky_20160824.hex" instead of the bootloader.hex I can't see any advertising message from the Nano
  • What is the intended use for these two files??
  • I tried also to upload them using OTA and the steps above but I get a "DATA SIZE EXCEEDS LIMIT" error message

Keep up with your good work guys and thanks all in advance for any answer!