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.

  • Another DFU-OTA attempt:

    • Restarted both cellphone and our custom board

    • 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" (I must say that it is very unstable, i've to do multiple scans from nRF Toolbox to even find our custom board)

    • Select .bin file (generated using fromelf.exe, application.bin file size ~29kB) from internal storage (Instead of uploading file from Google drive)

    • No init (.dat file)

    • Upgrade

    Result: GATT ERROR or DFU SERVICE NOT FOUND ERROR

  • Update: Finally managed to successfully perform DFU-OTA :) Modified ble_stack_init routine in bootloader to use LFCLK RC oscillator, 250ms calibration interval. i.e.

    SOFTDEVICE_HANDLER_INIT(NRF_CLOCK_LFCLKSRC_RC_250_PPM_250MS_CALIBRATION, true);  
    

    and ble_stack_init() routine in application:

    SOFTDEVICE_HANDLER_INIT(NRF_CLOCK_LFCLKSRC_RC_250_PPM_2000MS_CALIBRATION, false);
    

    Rest of the steps were the same as mentioned in my last comment (except that I used .hex file instead of .bin). reference: this thread.

  • @sidekick: I'm sorry that I forgot to check if you may not have the 32kHz crystal. Do you have that in your custom board ? If you don't you would need to do the same modification on the application firmware as well.

  • It's big help for me. Many thanks. How do you know or where are the instructions for the two initial parameters:SOFTDEVICE_HANDLER_INIT(NRF_CLOCK_LFCLKSRC_RC_250_PPM_250MS_CALIBRATION, true); and SOFTDEVICE_HANDLER_INIT(NRF_CLOCK_LFCLKSRC_RC_250_PPM_2000MS_CALIBRATION, false);

Related