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

DFU OTA issue on NRF51822AA

I'm trying to implement DFU-OTA (Bluetooth transport) for our custom board and currently i'm facing problems in flashing the different elements (softdevice, bootloader, application). I think It's mostly a setup problem.

configuration:

  1. Hardware: NRF51822QFAA (256KB flash)
  2. Softdevice version: s110, v7.1.0
  3. nRFGo studio for flashing: v1.18.0.9
  4. Bootloader sample code: From SDK v6.1.0 (nrf51_sdk_v6_1_0_b2ec2e6)
  5. Custom application: total size of application (around 30kB)
  6. IDE: Keil uVision 5.14

To build bootloader, I've used the sample bootloader (without any modification at the moment, except some include path changes for linking). The bootloader builds fine and I use nRFGo Studio to flash the three elements (softdevice, bootloader and the application). I'm able to successfully flash all the three but when i do the verification of our application using "verify" tab in nRFGo studio, it says "Verification failed". Our custom board also has a LED that turns "ON", when there is some issue with the NRF51822QFAA. I do not know the workings of this feature yet, but the point is that i'm very much sure that there is some problem (maybe one being overwritten or being only written only partially).while flashing these three components

I'm attaching the memory ranges snapshot below, which I see in the Keil uVision for bootloader and our application. Please suggest.

memory layout for bootloder: image description

memory layout for our application: image description

Thank you for your help.

  • Update: This time I Used ".bin" file (Used fromelf.exe which is part of ARM toolchain) to generate .bin file and also renamed the .bin and .dat file as application.bin and application.dat (nRF Toolbox app suggests naming them as application.(bin|hex|dat). My .dat file contents are (As seen in sublime 3 editor) is: "ffff ffff ffff ffff 0100 feff f109 ") and invoking crc.exe on application.bin generated following: (shown here CRC value for 0xffff seed only)

    CRC-CCITT (0xffff) = 0x09F1 / 2545

    Steps:

    • Erased all (using nrfjprog.exe)
    • Program SD using nRF Studio
    • Flash bootloader. Using KEIL uVision, J-link and nrfjprog.exe
    • Write 0x1 at the address 0x00003fc00 using nrfjprog.exe

    Device is advertising as "Dfu Targ". Trying to flash application.bin using nRF Toobox app now gives DFU SERVICE ERROR (6) and a re-attempt gives DFU GATT INTERNAL ERROR(129) :(

  • Is this documentation on BLE DFU-OTA for SD v7.X.X up to date ? If yes, where can I find the experimental sample PC applications as mentioned in this tutorial ? I've nRF 51822QFAA (256 kB flash) chip on our custom board.

  • @sidekick: It's my mistake in the presentation. As shown here the init packet is optional. I will update the slide. Sorry about that.

    Could you explain why you want to write 0x01 to 0x00003fc00 ?

    With nRFLogger, after you have done a DFU session in nRFToolbox, you should see the log in the logger app. You can also try to use nRF Master Control Panel to do DFU. You can swipe right when doing it to see the log.

    To be able to open a file on your phone, you can try to install a File manager app. There are several of them on Goolge Play.

    Which phone did you use to test ?

  • Thank you Hung Bui for following up on this. As I'm reading more about DFU-OTA, my issue is turning multifaceted.

    1. I'm not using nRFgo Starter Kit (No button #7 as mentioned here) to go into bootloader mode, it's a custom board and has nrf51822QFAA SOC.
    2. Cannot use Experimental, sample PC applications*(~/\ble_dfu_send_hex/*) to perform device firmware update as I do not have Master Control Panel dongle. Initially I wanted, SD + Bootloader + App on our custom board and perform application upgrade later, but as I've understood so far, I've to implement a logic using GPREGRET register, both in Bootloader and in our application. So currently, just to test DFU, I should not write 0x01 to 0x00003fc00 and try only with SD and Bootloader.
  • Reached text size limit in my previous post, hence continuing here. Steps this time:

    • Erased all (using nrfjprog.exe --eraseall)
    • Program SD ( s110 v7.1.0) using nRFgo Studio
    • Flash bootloader. Using KEIL uVision, J-link and nrfjprog.exe
    • Use nRF Toolbox mobile app from Nordic (v 1.3.1 for samsung S3, android v4.3) to flash application.
    • Select our custom board as the device which is now advertising as "DFU Targ"
    • Select .hex file (size ~82kB) from Google drive
    • No init (.dat file)
    • Upgrade

    Result: DFU FILE ERROR (2)

Related