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

Open_bootloader_usb_mbr_pca10056_debug would not start up application

Hi Support, 

Now I am developing over Nordic 52840 DK (PCA10056). My environment as below,

(1) upon SDK (nRF5_SDK_15.3.0_59ac345)

(2) softdevice s140_nrf52_6.1.1_softdevice, which softdevice ID should be 0xB6 (??).

(3) Nordic Programmer in nRF Connect v3.3.0 (Windows10)

(4) Nordic Open_Bootloader (example project: Open_bootloader_usb_mbr_pca10056_debug) with preload SD as well like below,

Now the issue is that, what I am doing is to try to use  Nordic Open_bootloader to work with Nordic Programmer to download my pure application (I don't use mergehex tool since there is only one application). This is the screenshot  from Nordic Programmer, 

However, each time when main application transfer completes, the bootloader would not get the application run up, will be stuck in "In nrf_bootloader_init". Briefed log and detailed log as below, 

Briefed log :

<debug> nrf_dfu_req_handler: Whole firmware image received. Postvalidating.
Logs dropped (1)
<debug> nrf_dfu_validation: Hash verification. start address: 0x26000, size: 0x22980
Logs dropped (1)
<debug> nrf_dfu_validation: Validating new application in bank 1.
<debug> nrf_dfu_validation: Invalidating old application in bank 0.
Logs dropped (2)
<debug> nrf_dfu_serial: Sending Response: [0x4, 0x1]
<debug> nrf_dfu_settings: Writing settings...
Logs dropped (2)
<debug> nrf_dfu_settings: Erasing old settings at: 0x000FF000
Logs dropped (1)
<debug> nrf_dfu_flash: nrf_fstorage_erase(addr=0x0x000FF000, len=1 pages), queue usage: 1
Logs dropped (1)
<debug> nrf_dfu_flash: Flash erase success: addr=0x000FF000, pending 0
<debug> nrf_dfu_settings: the bank1 code is: 1
Logs dropped (2)
<debug> nrf_dfu_flash: nrf_fstorage_write(addr=0x000FF000, src=0x20008614, len=896 bytes), queue usage: 1
Logs dropped (1)
<debug> nrf_dfu_flash: Flash write success: addr=0x000FF000, pending 0
Logs dropped (2)
<info> nrf_dfu_settings: Backing up settings page to address 0xFE000.
<debug> nrf_dfu_settings: Writing settings...
<debug> nrf_dfu_settings: Erasing old settings at: 0x000FE000
Logs dropped (1)
<debug> nrf_dfu_flash: nrf_fstorage_erase(addr=0x0x000FE000, len=1 pages), queue usage: 1
Logs dropped (2)
<debug> nrf_dfu_flash: Flash erase success: addr=0x000FE000, pending 0
Logs dropped (1)
<debug> nrf_dfu_settings: the bank1 code is: 1
Logs dropped (1)
<debug> nrf_dfu_flash: nrf_fstorage_write(addr=0x000FE000, src=0x20008994, len=896 bytes), queue usage: 1
Logs dropped (1)
<debug> nrf_dfu_flash: Flash write success: addr=0x000FE000, pending 0
Logs dropped (1)
<debug> nrf_dfu_req_handler: All flash operations have completed. DFU completed.
Logs dropped (1)
<debug> app: Shutting down transports (found: 1)
Logs dropped (1)
<debug> app: Resetting bootloader.
Logs dropped (1)
<info> nrf_dfu_settings: Backing up settings page to address 0xFE000.
<debug> nrf_dfu_settings: Destination settings are identical to source, write not needed. Skipping.
<info> app: Open USB bootloader started
<debug> app: In nrf_bootloader_init
<debug> nrf_dfu_settings: Calling nrf_dfu_settings_init()...
<debug> nrf_dfu_flash: Initializing nrf_fstorage_nvmc backend.
<debug> nrf_dfu_settings: Using settings page.
<debug> nrf_dfu_settings: Copying forbidden parts from backup page.
<debug> nrf_dfu_settings: Destination settings are identical to source, write not needed. Skipping.
<info> nrf_dfu_settings: Backing up settings page to address 0xFE000.
<debug> nrf_dfu_settings: Destination settings are identical to source, write not needed. Skipping.
<debug> app: Enter nrf_bootloader_fw_activate
<debug> app: Valid App
<debug> app: Enter nrf_dfu_app_continue
<debug> app: No copy needed
<debug> app: Setting app as valid
<debug> nrf_dfu_settings: Writing settings...
<debug> nrf_dfu_settings: Erasing old settings at: 0x000FF000
<debug> nrf_dfu_flash: nrf_fstorage_erase(addr=0x0x000FF000, len=1 pages), queue usage: 0
<debug> nrf_dfu_flash: Flash erase success: addr=0x000FF000, pending 0
<debug> nrf_dfu_settings: the bank1 code is: 0
<debug> nrf_dfu_flash: nrf_fstorage_write(addr=0x000FF000, src=0x20008614, len=896 bytes), queue usage: 1
<debug> nrf_dfu_flash: Flash write success: addr=0x000FF000, pending 0
<info> nrf_dfu_settings: Backing up settings page to address 0xFE000.
<debug> nrf_dfu_settings: Writing settings...
<debug> nrf_dfu_settings: Erasing old settings at: 0x000FE000
<debug> nrf_dfu_flash: nrf_fstorage_erase(addr=0x0x000FE000, len=1 pages), queue usage: 1
<debug> nrf_dfu_flash: Flash erase success: addr=0x000FE000, pending 0
<debug> nrf_dfu_settings: the bank1 code is: 0
<debug> nrf_dfu_flash: nrf_fstorage_write(addr=0x000FE000, src=0x20008994, len=896 bytes), queue usage: 1
<debug> nrf_dfu_flash: Flash write success: addr=0x000FE000, pending 0
<debug> app: Resetting bootloader.
<info> nrf_dfu_settings: Backing up settings page to address 0xFE000.
<debug> nrf_dfu_settings: Destination settings are identical to source, write not needed. Skipping.
<info> app: Open USB bootloader started
<debug> app: In nrf_bootloader_init

 

Detailed log:

log_open-bootloader.txt

Thanks a lot

Regards

S.

  • Just wondering if open bootloader (CDC/ACM over USB) would work directly together with nRF Connect V3.3 to download my application Hex. So far it seems that the file download is ok. And Bootloader also move it bank1 and then bank0. However, why would it fail to startup? waiting online...

    S. 

  • Hi James, 

    Could you try to test with some simple example ? For example the LED blinky example.
    Please make sure that the start address of your application match with the end address of the softdevice. 

  • Thanks. I will do this and let you know the result. 

    Re-"Please make sure that the start address of your application match with the end address of the softdevice. ", Yes, the softdevice address is from 0x00001000 ~0x00026000, and my application 0x00026000~0x0048980.

    details of memory layout as below, which shouldn't overlap the softdevice, 

    FLASH_PH_START=0x0

    FLASH_PH_SIZE=0x100000

    RAM_PH_START=0x20000000

    RAM_PH_SIZE=0x40000

    FLASH_START=0x26000

    FLASH_SIZE=0xda000

    RAM_START=0x20002a98

    RAM_SIZE=0x3d568

    S. 

  • Hi Hung, 

    I swap the application to LED blinky example (blank) with only one modification in memory layout as below,

    FLASH_PH_START=0x0

    FLASH_PH_SIZE=0x100000

    RAM_PH_START=0x20000000

    RAM_PH_SIZE=0x40000

    FLASH_START=0x26000  (I even change to 0x26004, but no joy)

    FLASH_SIZE=0xda000

    RAM_START=0x20002a98

    RAM_SIZE=0x3d568

    But the behavior still like before, 

    <debug> app: Enter nrf_bootloader_fw_activate
    <debug> app: Valid App
    <debug> app: bank0 start address: SD PRESENT
    <debug> app: Enter nrf_dfu_app_continue
    <debug> app: No copy needed
    <debug> app: bank0 start address: SD PRESENT
    <debug> app: Setting app as valid
    <debug> nrf_dfu_settings: Writing settings...
    <debug> nrf_dfu_settings: Erasing old settings at: 0x000FF000
    <debug> nrf_dfu_flash: nrf_fstorage_erase(addr=0x0x000FF000, len=1 pages), queue usage: 0
    <debug> nrf_dfu_flash: Flash erase success: addr=0x000FF000, pending 0
    <debug> nrf_dfu_settings: the bank1 code is: 0
    <debug> nrf_dfu_flash: nrf_fstorage_write(addr=0x000FF000, src=0x20008614, len=896 bytes), queue usage: 1
    <debug> nrf_dfu_flash: Flash write success: addr=0x000FF000, pending 0
    <info> nrf_dfu_settings: Backing up settings page to address 0xFE000.
    <debug> nrf_dfu_settings: Writing settings...
    <debug> nrf_dfu_settings: Erasing old settings at: 0x000FE000
    <debug> nrf_dfu_flash: nrf_fstorage_erase(addr=0x0x000FE000, len=1 pages), queue usage: 1
    <debug> nrf_dfu_flash: Flash erase success: addr=0x000FE000, pending 0
    <debug> nrf_dfu_settings: the bank1 code is: 0
    <debug> nrf_dfu_flash: nrf_fstorage_write(addr=0x000FE000, src=0x20008994, len=896 bytes), queue usage: 1
    <debug> nrf_dfu_flash: Flash write success: addr=0x000FE000, pending 0
    <debug> app: Resetting bootloader.
    <info> nrf_dfu_settings: Backing up settings page to address 0xFE000.
    <debug> nrf_dfu_settings: Destination settings are identical to source, write not needed. Skipping.
    <info> app: Open USB bootloader started
    <debug> app: In nrf_bootloader_init

    Furthermore, could I use nRFConnect v3.3 Programmer to transfer the application firmware Hex to the bootloader? Here, the application firmware Hex is purely the build result by SERGGER, which I didn't use nrfutil or some other tools to repackage. 

    Thanks. Online...waiting...

    Regards

    S. 

  • Finally got it done. As below, if I got the uart-log-backend enabled, the serial_tx will enter a very dangerous cycle during boot application start, please refer to call stack in this screenshot below. 

    Once I comment out the log debug in  nrf_bootloader_app_start, the main application will be started normally. 

    I believe it is the last nrf_log_flush() in the nrf_bootloader_app_start_final would matter because at this moment the interrupt is already disabled. Just comment out this sentence, the application would be started normally.

    Anyway, thanks a lot.

    S. 

Related