Cannot perform DFU for Thingy52

I'm trying to follow the instructions to perform an OTA DFU for the Thingy 52.

https://nordicsemiconductor.github.io/Nordic-Thingy52-FW/documentation/dfu_generating.html

I'm using tag 2.2.0 of the Thingy firmware from https://github.com/NordicSemiconductor/Nordic-Thingy52-FW

I generated the public key and compiled the bootloader using the Makefile in project/bootloader_secure/pca20020/armgcc.  

I then flashed the softdevice:

nrfjprog --program ../../../sdk_components/softdevice/s132/hex/s132_nrf52_4.0.2_softdevice.hex -f nrf52 --chiperase

Then flashed the bootloader:

nrfjprog --program _build/nrf52832_xxaa_s132.hex -f nrf52 --sectorerase

However, at this point I can't see the Thingy in a scan using nRF Connect on Mobile.  It doesn't seem to be advertising and the LED is off.

I've also tried flashing the Thingy application as well, but get the same result.

I'm able to flash just the softdevice+application and that works properly.  I'm using a nRF52833 DK and connecting a ribbon cable from its Debug Out port to the Thingy.  The problem seems to come from using the bootloader.  Is there something I'm missing?

Parents
  • However, at this point I can't see the Thingy in a scan using nRF Connect on Mobile.  It doesn't seem to be advertising and the LED is off.

    Do you see anything in the RTT log? Try using the pca20020_debug bootloader project

  • It looks like there's no "armgcc" project in the pca20020_debug folder (I'm using Linux).  I tried setting up a new environment on a Windows machine and downloaded Keil, but it seems like the linker refuses to create the image while i'm using the evaluation license.

    I tried porting the armgcc Makefile from pca20020 to pca20020_debug to the best of my ability, and saw this in the log:

    :INFO:Inside main
    :ERROR:Single: Invalid bank

  • Hi,

    What command did you use to generate the DFU package? nrfutil pkg generate <something>

    This is the nRF Connect for iOS mobile app? Do you see in the log how long time it used between "Scanning for DFU Bootloader" until the scanning timeout?

  • I generated the DFU package like this:

    nrfutil pkg generate --application _build/nrf52832_xxaa_s132.hex --application-version 0 --hw-version 52 --sd-req 0x98 --key-file ~/nordic_ota/private-key.pem  dfu-app-3.zip

    Yes, this is the iOS app.  It's not reported in the log, but it takes about 5 seconds for the scanning timeout.

  • wsh said:
    Yes, this is the iOS app.

    Do you have a spare nrF52-kit? Do you see the same behavior if you use the nRF Connect for Desktop, Bluetooth low energy app ?

    infocenter.nordicsemi.com/.../nRF_Connect_DFU.html

  • It seems to have similar behavior:

    11:17:32.964 Connecting to device
    11:17:32.995 Connected to device DA:41:FC:30:A0:D3: interval: 7.5ms, timeout: 4000ms, latency: 0
    11:17:33.417 Attribute value read, handle: 0x03, value (0x): 53-50-4C-4B
    11:18:01.575 Disconnected from device DA:41:FC:30:A0:D3
    11:18:01.576 Performing DFU with file: /home/wshum/vm_share/dfu-app-3.zip
    11:18:04.063 Attribute value changed, handle: 0x6C, value (0x): 02-00
    11:18:04.085 Attribute value changed, handle: 0x6B, value (0x): 01
    11:18:04.087 Attribute value changed, handle: 0x6B, value (0x): 20-01-01
    11:18:28.113 Connection to device timed out
    11:18:28.113 DFU failed with error: Connect timed out..

  • I found that the bootloader seems to crash on the leds_on() function in bootloader_secure/thingy_dfu.c.  I commented out the contents of the function and got a bit further.  This is the debug log from the bootloader:

    :INFO:Inside main
    :DEBUG:In nrf_bootloader_init
    drv_ext_light :DEBUG:Initialized
    :DEBUG:In real nrf_dfu_init
    :DEBUG:running nrf_dfu_settings_init
    :DEBUG:Enter nrf_dfu_continue
    :DEBUG:Valid App
    :INFO:DFU GPREGRET
    :DEBUG:Application sent bootloader request
    :DEBUG:In nrf_dfu_transports_init
    :DEBUG:num transports: 1
    :DEBUG:vector table: 0x00072000
    :DEBUG:vector table: 0x00072000
    :DEBUG:Error code - sd_softdevice_vector_table_base_set: 0x00000000
    :DEBUG:Before SOFTDEVICE_HANDLER_APPSH_INIT
    :DEBUG:After SOFTDEVICE_HANDLER_APPSH_INIT
    :INFO:Error code - sd_ble_cfg_set: 0x00000000
    :DEBUG:Enabling softdevice.
    SDH:DEBUG:RAM start at 0x20002c00.
    SDH:WARNING:RAM start should be adjusted to 0x20002060.
    SDH:WARNING:RAM size should be adjusted to 0xdfa0.
    :DEBUG:Softdevice enabled
    :DEBUG:After nrf_dfu_transports_init
    :DEBUG:------- nrf_dfu_flash_init-------
    :DEBUG:Waiting for events

    At this point, it stalls.

Reply
  • I found that the bootloader seems to crash on the leds_on() function in bootloader_secure/thingy_dfu.c.  I commented out the contents of the function and got a bit further.  This is the debug log from the bootloader:

    :INFO:Inside main
    :DEBUG:In nrf_bootloader_init
    drv_ext_light :DEBUG:Initialized
    :DEBUG:In real nrf_dfu_init
    :DEBUG:running nrf_dfu_settings_init
    :DEBUG:Enter nrf_dfu_continue
    :DEBUG:Valid App
    :INFO:DFU GPREGRET
    :DEBUG:Application sent bootloader request
    :DEBUG:In nrf_dfu_transports_init
    :DEBUG:num transports: 1
    :DEBUG:vector table: 0x00072000
    :DEBUG:vector table: 0x00072000
    :DEBUG:Error code - sd_softdevice_vector_table_base_set: 0x00000000
    :DEBUG:Before SOFTDEVICE_HANDLER_APPSH_INIT
    :DEBUG:After SOFTDEVICE_HANDLER_APPSH_INIT
    :INFO:Error code - sd_ble_cfg_set: 0x00000000
    :DEBUG:Enabling softdevice.
    SDH:DEBUG:RAM start at 0x20002c00.
    SDH:WARNING:RAM start should be adjusted to 0x20002060.
    SDH:WARNING:RAM size should be adjusted to 0xdfa0.
    :DEBUG:Softdevice enabled
    :DEBUG:After nrf_dfu_transports_init
    :DEBUG:------- nrf_dfu_flash_init-------
    :DEBUG:Waiting for events

    At this point, it stalls.

Children
Related