This is a modified "BLE_Default_App". It doesn't use retargetStdout() which allows it to work with online Libs available on 20150123 (nRF51822, BLE_API)
Dependencies: BLE_API mbed nRF51822
You are viewing an older revision! See the latest version
FOTA Notes
Just a gathering of notes from my first FOTA test on an nRF51822-mkit, then an nRF51822-EK, and also nRFBeacon (using JLink Lite, or wire to nRF51822-EK)
FYI: Miscellaneous Notes
- When using the BLE UART in a FOTA App it 'may be necessary' to ensure all transmissions from mbed FOTA are terminated with "/n" to push the transmission over BLE. It is possible that unsent BLE UART may confuse the FOTA DFU process. This is unconfirmed, but I did notice FOTA DFU connection issues that may have been caused by this.
A: Prep Platform for FOTA
- Download the FOTA initial hex file from "Default Bootloader" section of:
- https://developer.mbed.org/teams/Bluetooth-Low-Energy/wiki/Firmware-Over-the-Air-FOTA-Updates
- this file includes App, Bootloader, and softdevice, it should be about 279KB
- Copy the hex file to the *normal* virtual USB drive of your FOTA platform
- Connect Platform to computer, a virtual drive should appear with file "mbed.htm" (If anything else you are in the wrong mode)
- When powering up the platform by connecting USB don't press reset or any other buttons
- drag the hex file to the virtual USB drive
- wait till the file is fully processed (drive disconnects, then reappears and file is gone
- disconnect the USB to powerdown the platform, then reconnect to powerup with FOTA
- LED1 blinks with default app installed
- Debug available on USB Serial "ping..." (TeraTerm 9600,8N1)
- You may need to Press reset and/or restart TeraTerm depending on what else you do
- Use Android App "nRF UART 2.0"
- Connect to [DefaultApp]
- Confirm regular "ping" messages
- Check FOTA:
- Start Android App "nRF Master Control Panel" (MCP)
- Connect to device [DefaultApp]
- There should be 5 services, including Device Firmware update service
- If not then disconnect and reconnect to refresh the services list (May be caches from your previous tests)
- To restore non-FOTA operation and mbed virtual drive see "Firmware Update" section in
- https://developer.mbed.org/platforms/Nordic-nRF51822/
- reference: https://developer.mbed.org/questions/5222/nRF51822-mkit-Hex-vs-Bin/
- It may be necessary to powercycle mkit one or twice
B. Compile sample project for FOTA Platform
- Get to your compiler: https://developer.mbed.org/users/yihui/code/BLE_Default_APP/
- I had no issues with this today for mkit 2015Jan11
- Ensure FOTA Platform selected
- i.e. for the mkit select "Nordic nRF51822 FOTA" (not "Nordic nRF51822 mkit")
- Modify the main.cpp so you are sure it is your file that is loaded
- change line: DEBUG("ping\r\n");
- to custom message : DEBUG("It Worked!\r\n");
- Compile, save hex file
- FOTA Hex file should be about 55KB (Application only, no bootloader or softdevice)
- (Normal mkit non-FOTA hex file should be >250KB)
C. Loading sample project using MCP
- copy hex file to Android device (Maybe to the folder "Download")
- Options: Shared folder, copy over USB cable, email to phone, etc.
- Start MCP
- Connect to [DefaultApp]
- Click [DFU] Button, Follow prompts to select Application hex file
- At this time use "No" for "Init Packet" (Future Feature?)
- Allow bootloader to process file
- New project should run automatically after completed
D. Check loaded sample project
- Use Android App "nRF UART 2.0"
- Connect to [DefaultApp] (Or whatever you modified it to)
- Confirm that your modified message is received
- Use MCP to connect
- In MCP it may be necessary to disconnect/reconnect to refresh the services for new Project on mkit
. ======================================================================================
E. FOTA on an nRF51822-EK (Not an mbed platform, but can run mbed using FOTA)
- Start nRFgo Studio on PC
- Select the nRF51822-EK
- Do [Erase All]
- Select Tab [Program Application]
- Select the FOTA Initial hex file for the Platform
- Download the FOTA initial hex file from "Default Bootloader" section of:
- https://developer.mbed.org/teams/Bluetooth-Low-Energy/wiki/Firmware-Over-the-Air-FOTA-Updates
- this file includes App, Bootloader, and softdevice, it should be about 279KB.
- I used the mkit file: ble_default_bootloader_app.hex.zip
- Download the FOTA initial hex file from "Default Bootloader" section of:
- Program the application (Option: verify)
- Disconnect the USB from the nRF51822-EK
- Powerup the nRF51822-EK with Battery or USB
- Continue with steps A5 through B,C,D
- Serial Debug over BLE works using App nRF UART 2.0
- LEDs and Buttons may need IO redefinitions
. ======================================================================================
F. FOTA on an nRF51822-Beacon PCA20006 (Not an mbed platform, but can run mbed using FOTA)
- Check that the Beacon still works, and record the LED Behaviour when insert battery (Needed for check in later step)
- Remove battery from nRFBeacon, disconnect USB from JLink Lite or EK
- Wire P2 on the nRFBeacon to the SWD on the Jlink-Lite from the nRF51822-DK kit, or the nRF51822-EK (PCA10001)
- use P2 instead of testpoints as less likely to damage circuit if burn these pads. Its tiny work so get help if uncertain of your soldering skills
- It may be useful to wire in a connector so can disconnect/reconnect the 4 signals later.
- Signals Required(4): V+ Target, Gnd, SWDIO(=T_TMS), SWDCLK(=T_CLK)
- The serial signals aren't required for programming (They are only for USB Serial Debug)
- For the nRF51822-EK turn off SW4, and wire the signals to the mbed IC side of the isolation buffers (Between U4 and R15/R16).
- Check before Powering:
- Check your wiring for incorrect wiring and shorts.
- Insert Battery in Beacon, Ensure LED still blinks same as before wiring
- Test that the beacon still transmits properly to a smartphone (nRF MCP App)
- Start nRFgo Studio on PC
- Select "nRF51 Programming"
- Do [Erase All]
- Select Tab [Program Application]
- Select the FOTA Initial hex file for the Platform
- Download the FOTA initial hex file from "Default Bootloader" section of:
- https://developer.mbed.org/teams/Bluetooth-Low-Energy/wiki/Firmware-Over-the-Air-FOTA-Updates
- this file includes App, Bootloader, and softdevice, it should be about 279KB.
- I used the mkit file: ble_default_bootloader_app.hex.zip
- Download the FOTA initial hex file from "Default Bootloader" section of:
- Program the application (Option: verify)
- Disconnect:
- Unplug USB
- Remove battery
- Disconnect the nRFBeacon from the programming wiring (or leave if you expect to re-use)
- Insert Battery
- Continue with steps A5 through B,C,D
- Serial Debug over BLE works using App nRF UART 2.0
- LEDs and Buttons may need IO redefinitions
. ======================================================================================