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

App does not start from bootloader when it is programmed via jlink

Hi All,

Please, I would like to know why when using bootloader on nRF51822, the app does not start when it is being flashed with a debugger (I'm using the J-Link), however when programmed with MCP (Master Control Pannel) using DFU service every thing is alright and the app starts correctly?

The application is placed at 0x1C000 and it is exactly where the boot-loader expects it to be:

image description

However when checking bootloader_settings->bank_0 flag, no valid application seems to be present:

image description

Please note that the app is already flashed via J-Link:image description

Would you please confirm that when using DFU bootloader we can no longer flash the application using a debugger? and is there any alternative to handle that?

Kind Regards, Ayman.

manu_setting.PNG

bank_0.PNG

Parents
  • If you have erased the chip completely and flash everything, then you have to manually write VALID_APP after flashing. It could be done writing to bootloader settings using J-Link/nrfjprog or you can add it as a default bootloader setting in your firmware as

    const uint8_t m_boot_settings[CODE_PAGE_SIZE] attribute((at(BOOTLOADER_SETTINGS_ADDRESS))) attribute((used)) = {BANK_VALID_APP};.

    Have a look at this for more info.

    If you flash only the firmware (bootloader and softdevice flashed separately) with --sectorerase, then bootloader setting will not be erased.

    For example my bootloader settings are at 0x3fc00 and i do nrfjprog --memwr 0x3fc00 --val 0x01 -f NRF51 to booloader settings to have VALID_APP flag, if i have erased whole chip and flashed everything fresh.

Reply
  • If you have erased the chip completely and flash everything, then you have to manually write VALID_APP after flashing. It could be done writing to bootloader settings using J-Link/nrfjprog or you can add it as a default bootloader setting in your firmware as

    const uint8_t m_boot_settings[CODE_PAGE_SIZE] attribute((at(BOOTLOADER_SETTINGS_ADDRESS))) attribute((used)) = {BANK_VALID_APP};.

    Have a look at this for more info.

    If you flash only the firmware (bootloader and softdevice flashed separately) with --sectorerase, then bootloader setting will not be erased.

    For example my bootloader settings are at 0x3fc00 and i do nrfjprog --memwr 0x3fc00 --val 0x01 -f NRF51 to booloader settings to have VALID_APP flag, if i have erased whole chip and flashed everything fresh.

Children
No Data
Related