This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts
This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

Flashing bootloader and application via J-Link

Hello. I want to make flashing of devices for production faster. So I want to write application together with bootloader via J-Link simultaneously and not via OTA DFU. I'm using S110 v6 and dual bank BLE DFU from SDK 5.1 example. I know that after flashing bootloader and application I just need to compute CRC16 of the DFU bank 0 and write this value to the bootloader settings in the flash, but maybe someone already has a solution to this problem?

Parents
  • I finally figured out how to get the bootloader working with -O0 -> "const" is required as shown below:

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

    const uint32_t m_uicr_bootloader_start_address attribute((at(NRF_UICR_BOOT_START_ADDRESS))) = BOOTLOADER_REGION_START;

    All my problems are solved now :)

Reply
  • I finally figured out how to get the bootloader working with -O0 -> "const" is required as shown below:

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

    const uint32_t m_uicr_bootloader_start_address attribute((at(NRF_UICR_BOOT_START_ADDRESS))) = BOOTLOADER_REGION_START;

    All my problems are solved now :)

Children
  • The 'const' issue with data bound to sections but not in the binary stumped me as well. I was reading the data in my program and it was coming up zeros and reading it with gdb and it wasn't. Turns out that the optimizer (maybe -flto) was seeing that the data was constant and zero filled and just compiling the reads away. I removed the 'const' to get it to run. I haven't had the chance to figure out what the proper linker command file option is to convince gcc that the data values are unknown at compile time. NOLOAD does not seem to be enough.

Related