6 years, 4 months ago.

Application updated over the air doesn't start properly

Dear all,

I have nRF51 DK and I use mbed CLI to build my application that is simple mbed-os-example-blinky. Also I have SDK11.0.0 and I built the ble dfu bootloader (./examples/dfu/bootloader/pca10028/dual_bank_ble_s130/armgcc), merged that .hex file with softdevice s130 .hex file (./components/softdevice/s130/hex/s130_nrf51_2.0.0_softdevice.hex) and flashed the board via nRFStudio (Program Bootloader tab) with the result .hex file.

I built my application with command

$ mbed compile -m NRF51_DK_OTA -t GCC_ARM -c --profile release

I follow the tutorial to update the application over the air. After update I realized that my application did bot start. I look into mbed-os-example-blinky.hex file and found out that FLASH MEMORY region set at `0x0001C000` however it has to be set at 0x0001b000 for softdevice s130 v2.0.0. So I fixed file ./mbed-os/targets/TARGET_NORDIC/TARGET_MCU_NRF51822/device/TOOLCHAIN_GCC_ARM/TARGET_MCU_NORDIC_32K/NRF51822.ld as following:

MEMORY
 {
-  FLASH (rx) : ORIGIN = 0x0001C000, LENGTH = 0x24000
+  FLASH (rx) : ORIGIN = 0x0001b000, LENGTH = 0x24000
   RAM (rwx) :  ORIGIN = 0x20002800, LENGTH = 0x5800
}

then rebuilt my application and updated over the air again. I noticed that LED blinked once at the beginning and that was all. I pressed reset button a few times and I saw how it blinked. I connected to the board via Ozone debugger and found out that my application started and after calling `wait()` function it didn't work anymore.

I built a few applications from SDK11, update them OTA and all of them work fine, as I undestood they don't use softdevice (BTW, is it true?).

I guess something is wrong with softdevice initialization in my application but I can't understand what exactly and how to fix it.

Any ideas? Because I ran out of them.

Be the first to answer this question.