9 years, 3 months ago.

FOTA load only working once

I'm using the online compiler and an nRF51822-mkit. (Maybe something is missing for FOTA in the recent library updates to the online compiler?)

Test Procedure/Notes:

  • I load the initial image hex file by copying to the mbed drive, it works fine. Device shows as "DefaultApp"
  • I can use Android nRF MCP to load the default app (or my own app), and they all appear to run fine.
    • On Android Lollipop Nexus5: [DFU], +Application[OK], ES File Explorer, Select Hex File, +Normal, [No Init File]
    • See: Starting Bootloader..., See Progress, completes OK, [Disconnect], Test's OK in App "nRF UART 2.0"
  • BUT, When try to do another load of the default app (or my own app) it fails to load the hex file.
    • On Android Lollipop Nexus5: [DFU], +Application[OK], ES File Explorer, Select Hex File, +Normal, [No Init File]
    • See: Connecting..., Starting Bootloader..., long time, returns to Connecting...
  • To recover I reset and load the initial hex to the mbed drive again. That allows one more FOTA Load.

As the App loaded and ran OK the first time, it may be something with the starting of the DFU mode in the online compiled Apps (in the compiling of the unmodified online BLE_Default_APP project, or my own project with recent online libs)? There is a different in the Initial App FOTA DFU, and theBLE_Default_App available for online import.

Files:

Please Help, FOTA is so useful for development of my wireless device.

Question relating to:

Bluetooth Low Energy (a.k.a Bluetooth LE, BTLE, Bluetooth Smart)

x

posted by Paul Russell 26 Jan 2015

I'm experiencing the same problem when uploading from iOS (iPhone 5) or Android (Nexus 7 tablet) to an mKit board (PCA10024).

I'm running thru some permutations using 4 projects (heartrate, iBeacon (not Beacon), temperature & bleIOv04_pr ) using: 1. the default projects as-is at checkout, 2. the projects updated to with the latest libs 3. and then after update replacing bed with with mbed-src (I didn't use mbed-src-nrf51822, it didn't compile, should it?)

I'm about half way thru but not having any luck past the first FOTA.

@rohit It would be good to know what types and revisions of the libs you are using or if you've tweaked the default apps source at all?

All the best Wayne

posted by Wayne Keenan 28 Jan 2015

fyi: I am having to upload the initial firmware from here in between every test: https://developer.mbed.org/media/uploads/rgrover1/ble_default_bootloader_app.hex.zip

posted by Wayne Keenan 28 Jan 2015

Hi Wayne, Try: - Initial to mbed drive, - FOTA DFU Load bleIOv04_pr (Latest rev26, set as FOTA) - FOTA DFU Load bleIOv04_pr again to see if consecutive load works. For me FOTA stopped working after load a program with BLE_UART I didn't try FOTA iBeacon or FOTA HTM.

posted by Paul Russell 28 Jan 2015

Hiya Paul, Thanks for the suggestion Compilation creates a 111kb hex file which I uploaded via MCP on android (latest app version). I skipped creating an Init.dat file.

After a successful upload the device no longer appears in the scanner, even after reset and power cycle. I've tried on 2 mbed kits, same result.

All the best Wayne

posted by Wayne Keenan 28 Jan 2015
  • Make sure you "disconnect" in "Android nRF Master Control Panel", otherwise it remembers the previous services.
  • I'm using Android Lollipop , how about you?
  • Ensure you have latest version of my bleIO project (don't change libs till this resolved)
  • bleIOv04_pr_NRF51822_OTA_.hex, R26, Size in properties: 108 KB (110,620 bytes)
posted by Paul Russell 28 Jan 2015

I wasn't disconnecting so will try; power cycling and rescanning should find it. I also use LightBlue on iOS (8) to scan for (unconnected) BLE devices, doesn't appear there either.

The Nexus 7 is Android 4.4.4.

I did a fresh checkout and left it as-is on rev 26.

Thanks Wayne

posted by Wayne Keenan 28 Jan 2015

May help to use the mbed's USB UART to see debug on TeraTerm 9600,8,N,1 (No Flow).

  • If you press reset on mkit then exit and restart TeraTerm.

When load a different program in mkit the Apps on the phone may et a gatt error due to the services mismatch (They cache services to reduce traffic as for production devices services don't tend to change, only us developers do that). To fix that connect in nRF-MCP, then Disconnect to force a reload of services. This also affects other Apps like nRF-UART-2.0.

I don't know if Lightblue caches services, my son has the ipod so I can't check till he gets home.

I just noticed the device name shows r25 in program revision 26, can't wait till have automatic version in compiler :)

posted by Paul Russell 28 Jan 2015

I just checked a fresh import and online compile of latest bleIOv04_pr (r26) and it works on consecutive FOTA. (Fresh reset once after mbed load init, restart TeraTerm just before press reset, don't need further resets, teraterm will show "Unknown onWrite(tHandle:0)" when the DFU starts)

  • Do need to do "disconnect & reconnect" in nRF MCP to refresh services.
posted by Paul Russell 28 Jan 2015

I have noticed that iOS does cache for far longer than Android, but MCP and LightBlue do a good job of spotting devices that are advertising and these mkit certainly aren't, greyed oy / RSSI is not updating.

On reset the serial output is some kind of device/mbed/other ID: $$$.107002001FE6E019E2190F91

So I'm guessing the application has not started / the upload silently failed somehow.

posted by Wayne Keenan 28 Jan 2015

Exit/restart teraterm, the data may be out of sync when displaying garbage. See my FOTA Notes wiki page. Serial: USB Serial or BLE UART?

posted by Paul Russell 28 Jan 2015

It's consistently outputting that every disconnect/reconnect of the terminal app.

posted by Wayne Keenan 28 Jan 2015

4 Answers

8 years, 11 months ago.

I am having issues getting FOTA working with the nRF51-DK

I have downloaded the default Softdevice + Default App + Bootloader .hex from https://developer.mbed.org/platforms/Nordic-nRF51-DK-FOTA/ and downloaded to the board. I then added the nRF51DK FOTA shadow target and built my own test app with it. The test app does nothing more than flash the four nRF51-DK LEDs on and off and has been confirmed to work by compiling to a non-FOTA target to check standalone operation.

I can see the nRF51-DK device and DFU service in the Nordic Apps and upload correctly however when the FOTA update is reported as complete and I reset the board nothing happens. I would expect soft device to boot, forward to the boot loader which would then forward to my blinky LED application. At this point I can't see the device anymore in the Nordic app but that is to be expected as my app does not bring up the bluetooth api.

Any thoughts on why this is not working for me would be appreciated.

Thanks,

Allen.

9 years, 3 months ago.

I cannot reproduce your issue with known applications. I start with the defaultApp and then update to the BLE_HeartRate and then BLE_iBeacon. It works; and that's not a surprise. I'll try to reproduce it with your particular application, but that may have to wait till tomorrow.

x Deleted info related to typo in my test code

posted by Paul Russell 26 Jan 2015
9 years, 3 months ago.

Hi Paul,

You should not use my fork (http://developer.mbed.org/users/yihui/code/BLE_Default_APP/) which is an experimental project. It uses NVIC_SystemReset() to enter bootloader. While the default bootloader needs to use relocating vector table.

When using NVIC_SystemReset() to enter bootloader, the default bootloader will not initialize softdevice (s110), which causes a error. It requires a custom bootloader.

The reason to use NVIC_SystemReset() is: it's the easiest way to clean all the things set by an app.

Yihui

OK,

x Deleted wrong info related to typo in my code

posted by Paul Russell 28 Jan 2015
9 years, 3 months ago.

I have discovered the errors of my ways, and can now do OTA updates.

The fundamental problem was when I went to add the Nordic FOTA platform I tried the Dongle and the DK ones (as they have OTA in their names/descriptions) from here: https://developer.mbed.org/platforms/?pvend=11

What I should of added was this one: http://developer.mbed.org/platforms/Nordic-nRF51822-FOTA/

But that doesn't appear in the list of platforms so I started off on the wrong foot. That is mentioned in a forum post here: https://developer.mbed.org/forum/team-63-Bluetooth-Low-Energy-community/topic/5203/

Thank you Paul for your help and suggestions during my voyage of discovery, I see the light! :) :

BLE Init FOTA4.3.m

u4

mkit: LED2=[Follow Button2], LED1=[Blink u4

u4

All the best

Wayne

Wayne, Can you FOTA load FOTA4 program again and again without going back to init program? I couldn't with FOTA4, but could with bleIOv04_pr.

posted by Paul Russell 28 Jan 2015

FOTA4: loads once and works but I couldn't do any further updates, it advertises the services (DFU & UART) but bails during "Connecting..." when FOTA'ing

bleIOv04_pr: after FOTA upload it doesn't advertise, I also get the same "$$$..." usb serial output as before.

BLE_HeartRate: does the same as bleIOv04_pr

So I'm closer but I spoke too soon, what else have I muppet'ed I wonder.

posted by Wayne Keenan 28 Jan 2015

I have created an example of the minimal code that can be repeatedly programmed OTA.

http://developer.mbed.org/users/waynek/code/HelloBlue/

Hope that helps

All the best Wayne

posted by Wayne Keenan 28 Jan 2015

x

posted by Paul Russell 28 Jan 2015

Thanks Wayne for spotting missing line in my FOTA4

posted by Paul Russell 30 Jan 2015