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

UART DFU update of BLE application not working

Hi,

I am using the DFU example given in the SDK15.2.0 to try and update the application on my NRF52840. Currently, I have been able to update the application to run the blinky_mbr.hex file given in the secure_dfu_test_images. I works great. However, I wanted to see if I can update the application to run the sample ble_app_blinky example. I placed the corresponding hex file into a zip file and according to the terminal, I was able to download it onto the NRF52840, however, the application is not able to start. If I press Button 4, it goes back into DFU mode. If anyone has any advice on how to go about this, please let me know!

Parents
  • Hi,

    ble_app_blinky needs to run with softdevice. Do you flash the softdevice? You need to program the softdevice first or pack the softdevice and ble_app_blinky to upload. 

    -Amanda H.  

  • Update: I downloaded nRF Programmer on my laptop and have reprogrammed the nrf52840 the same way I have been. I check on the nRF Programmer and it looks as if the application, softdevice and the bootloader were downloaded as seen in the picture below, but the nrf52840 is now no longer going back into dfu mode once the application is uploaded. 

      

    Color Region Name Addr. Range Size (Bytes)

    1. black

    N/A 0x000FF000 - 0x000FF05B 1048576
    2. black MBR Parameters 0x000FE000 - 0x000FE05B 92
    3. pink Bootloader 0x000F8000 - 0x000FD217  21016
    4. gray Application 0x00000000 - 0x00100000 1048576
    5. green Application 0x00076000 - 0x0007B84B 22604
    6. green Application 0x00051000 - 0x00075E7B 151164
    7. green Application 0x0004B000 - 0x0005064F 22096
    8. green Application 0x00026000 - 0x0004AE7B 151164
    9. blue SoftDevice 0x00001000 - 0x00025E7B 151164
    10 orange MBR or Application 0x00000000 - 0x00000A17 2584
  • Hi, 

    If you use s140_nrf52_6.1.0, you should use --sd-req 0xAE for s140_nrf52_6.1.0 for ble_app_blinky_pca10056_s140. 

    If a valid application is installed on the device, hold Button 4 during startup to prevent the bootloader from starting the application and force it to enter DFU mode instead.

    -Amanda H.

Reply Children
  • I am using s140_nrf52_6.1.0 for the softdevice and programmed the nrf52840 using the following steps in the picture. The setbl.hex file is a merge file of my generated settings.hex and the secure_bootloader files.

    However, I am still getting the same result that the application is still not running. All of the leds turn off and nothing happens. I tried running the blinky_mbr.hex application file given in your test images and it works, so maybe it has to do with the ble_app_blinky file?  

  • Update: I tried erasing the nrf52840 and programming the ble_app_blinky_pca10056_s140.hex file by itself using the following code

    nrfjprog -e
    
    nrfjprog --program ble_app_blinky_pca10056_s140.hex

    I ran the nrfProgrammer to see what the hex file programmed and as you can see in the picture, the hex file programmed not only the application, but the softdevice as well. It also seems to be working just fine. However, I wanted to ask if this makes a difference in how I should be programming the dfu since originally I thought I was just updating the application without a softdevice?

     

    Color Range Name Range Size (bytes)
    1.gray Application 0x00000000 - 0x00100000 1048576
    2. green Application 0x00026000 - 0x0002B84B 22604
    3. blue Softdevice 0x00001000 - 0x00025E7B 151164
    4. orange MBR or Application 0x00000000 - 0x00000A17 2584
  • Hi,

    amarin said:
    I wanted to ask if this makes a difference in how I should be programming the dfu since originally I thought I was just updating the application without a softdevice?

    From the figure, I think you use the ble_app_blinky_pca10056_s140.hex under nRF5_SDK_15.2.0\examples\ble_peripheral\ble_app_blinky\hex. The one is combined with SD with ble_app_blinky (485KB). If you rebuild the project with ses, you will get the output image also named ble_app_blinky_pca10056_s140.hex under nRF5_SDK_15.2.0\examples\ble_peripheral\ble_app_blinky\pca10056\s140\ses\Output\Release\Exe. The one is without SD and size is small (62KB).   

     If you just want to update the application without the SD, I suggest you rebuild the ble_app_blinky to get the app image without SD. The you could use the following commands to update:

    nrfjprog --eraseall
    nrfjprog --program secure_bootloader_uart_mbr_pca10056_debug.hex --verify
    nrfjprog --program s140_nrf52_6.1.0_softdevice.hex --verify -r

    nrfutil pkg generate --hw-version 52 --sd-req 0xAE --application-version 1 --key-file private.pem --application ble_app_blinky_pca10056_s140.hex APP.zip
    nrfutil dfu serial -pkg APP.zip -p COM19

    --

    Note that secure_bootloader_uart_mbr_pca10056_debug.hex is generated by rebuilding pca10056_uart_debug under nRF5_SDK_15.2.0\examples\dfu\secure_bootloader. 

    BR,

    -Amamda

Related