Keil SDK13 BLE OTA bootloader_secure_ble bootloader

Keil SDK13 BLE OTA upgrade failure causes the device to become unbootable, requiring re-flashing. How can this be resolved? We are using the bootloader_secure_ble bootloader. Does it support dual-bank OTA? Could you provide a reference sample?

Parents Reply Children
  • This was only a bug fix release of the softdevice and should not have any breaking changes. What you are experiencing is most likely unrelated to the Softdevice. To be able to find out what is wrong we must try to debug the bootloader/app to determine why it crashes after DFU is complete. A good first step is to read out the CPU registers after the DFU is complete as this may help reveal what state the device is in. You can do this with nrfjprog or nrfutil from the command line.

    nrfjprog --readregs
    nrfutil device cpu-register-read

  • nrfjprog --readregs
    R0: 0x01000001
    R1: 0x40020518
    R2: 0x00000000
    R3: 0x20000000
    R4: 0x2000009B
    R5: 0x00000000
    R6: 0xE000E000
    R7: 0x00000056
    R8: 0x00000000
    R9: 0x00000000
    R10: 0x00000000
    R11: 0x00000000
    R12: 0x046E4C9F
    SP: 0x20003F88
    LR: 0x00012459
    PC: 0x0001245A
    xPSR: 0x21000000
    MSP: 0x20003F88
    PSP: 0x00000000
    RAZ: 0x00000000
    CFBP: 0x00000000
    APSR: 0x20000000
    EPSR: 0x01000000
    IPSR: 0x00000000

    nrfutil device cpu-register-read
    Usage: nrfutil [OPTIONS] COMMAND [ARGS]...
    Try "nrfutil --help" for help.

    Error: No such command "device"

  • Hi,

    Thanks. This show that the program is inside the sd_app_evt_wait() function. This suggests that the device program has not "crashed" but is just staying in sleep waiting for an interrupt. Unfortunately it is not possible to tell from this if the function was called from the bootloader or the application. Next step is to try debug the bootloader and application and see if the program reaches the main app.

  • "According to the log, the application has been erased. What caused this?"

    :DEBUG:Erasing old settings at: 0x0007f000
    :DEBUG:Erasing: 0x0007f000, num: 1
    :DEBUG:Writing 0x00000057 words
    :DEBUG:Writing settings...
    :DEBUG:Sending Response: [0x4, 0x1]
    :DEBUG:Received create object
    :INFO:Before OP create
    :INFO:Valid Data Create
    :DEBUG:Erasing: 0x00020000, num: 1
    :INFO:Creating object with size: 4096. Offset: 0x00001000, CRC: 0x4f9e1f67
    :DEBUG:Sending Response: [0x1, 0x1]
    :DEBUG:Sending CRC: [0x60, 0x03, 0x01, 0:x000010c8, CRC:0x7c50c9ab]
    :INFO:Storing 256 B at: 0x00020000
    :DEBUG:Sending CRC: [0x60, 0x03, 0x01, 0:x00001190, CRC:0xe34c5138]
    :INFO:Storing 256 B at: 0x00020100
    :DEBUG:Sending CRC: [0x60, 0x03, 0x01, 0:x00001258, CRC:0xf4dbf38c]
    :INFO:Storing 256 B at: 0x00020200
    :DEBUG:Sending CRC: [0x60, 0x03, 0x01, 0:x00001320, CRC:0xfad69a8d]
    :DEBUG:Sending CRC: [0x60, 0x03, 0x01, 0:x000013e8, CRC:0x8d2c78ad]
    :INFO:Storing 256 B at: 0x00020300
    :DEBUG:Sending CRC: [0x60, 0x03, 0x01, 0:x000014b0, CRC:0x123582c1]
    :INFO:Storing 256 B at: 0x00020400
    :DEBUG:Sending CRC: [0x60, 0x03, 0x01, 0:x00001578, CRC:0xba371df4]
    :INFO:Storing 256 B at: 0x00020500
    :DEBUG:Sending CRC: [0x60, 0x03, 0x01, 0:x00001640, CRC:0xd7218135]
    :INFO:Storing 256 B at: 0x00020600
    :DEBUG:Sending CRC: [0x60, 0x03, 0x01, 0:x00001708, CRC:0xc04f36db]
    :DEBUG:Sending CRC: [0x60, 0x03, 0x01, 0:x000017d0, CRC:0x42b9c0f1]
    :INFO:Storing 256 B at: 0x00020700
    :DEBUG:Sending CRC: [0x60, 0x03, 0x01, 0:x00001898, CRC:0xe39aa5f6]
    :INFO:Storing 256 B at: 0x00020800
    :DEBUG:Sending CRC: [0x60, 0x03, 0x01, 0:x00001960, CRC:0x274d3e23]
    :INFO:Storing 256 B at: 0x00020900
    :DEBUG:Sending CRC: [0x60, 0x03, 0x01, 0:x00001a28, CRC:0x9d4fdb36]
    :DEBUG:Sending CRC: [0x60, 0x03, 0x01, 0:x00001af0, CRC:0x0687401b]
    :INFO:Storing 256 B at: 0x00020a00
    :DEBUG:Sending CRC: [0x60, 0x03, 0x01, 0:x00001bb8, CRC:0x7714f0ad]
    :INFO:Storing 256 B at: 0x00020b00
    :DEBUG:Sending CRC: [0x60, 0x03, 0x01, 0:x00001c80, CRC:0x181b197b]
    :INFO:Storing 256 B at: 0x00020c00
    :DEBUG:Sending CRC: [0x60, 0x03, 0x01, 0:x00001d48, CRC:0x08e0dcd3]
    :INFO:Storing 256 B at: 0x00020d00
    :DEBUG:Sending CRC: [0x60, 0x03, 0x01, 0:x00001e10, CRC:0x650d0d52]
    :DEBUG:Sending CRC: [0x60, 0x03, 0x01, 0:x00001ed8, CRC:0x004cb4be]
    :INFO:Storing 256 B at: 0x00020e00
    :DEBUG:Sending CRC: [0x60, 0x03, 0x01, 0:x00001fa0, CRC:0x1af7dfa8]
    :INFO:Storing 256 B at: 0x00020f00
    :DEBUG:Received calculate CRC
    :INFO:Before OP crc
    :DEBUG:Sending CRC: [0x60, 0x03, 0x01, 0:x00002000, CRC:0x5fcdda05]
    :DEBUG:Received execute object
    :INFO:Before OP execute
    :INFO:Valid Data Execute
    :DEBUG:Erasing old settings at: 0x0007f000
    :DEBUG:Erasing: 0x0007f000, num: 1
    :DEBUG:Writing 0x00000057 words
    :DEBUG:Writing settings...
    :DEBUG:Sending Response: [0x4, 0x1]
    :DEBUG:Received create object
    :INFO:Before OP create
    :INFO:Valid Data Create
    :DEBUG:Erasing: 0x00021000, num: 1
    :INFO:Creating object with size: 4096. Offset: 0x00002000, CRC: 0x5fcdda05
    :DEBUG:Sending Response: [0x1, 0x1]
    :DEBUG:Sending CRC: [0x60, 0x03, 0x01, 0:x000020c8, CRC:0xd8a02b44]
    :INFO:Storing 256 B at: 0x00021000
    :DEBUG:Sending CRC: [0x60, 0x03, 0x01, 0:x00002190, CRC:0x19e25c16]

  • Why does the bootloader erase the app region (0x1f0000) when the app is terminated/killed?

Related