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

Segger Embedded Studio and Bootloader

Continuing with my attempts to get this to work on SES I'm not sure if I'm missing something simple or not.

So using the excellent RKNRFGO (which by the way is much quicker for adding the softdevice than linking it in with SES, highly recommended for any Mac users) when I attempt to add the Bootloader the bootloader nor any app appears to be working. I have tried adding a Code hex which has been compiled linking in bootloader_settings_nrf52.hex and I have tried just the softdevice and the bootloader themselves without any Code hex.

How are other people using SES managing to achieve this?

Thanks

[UPDATE] These are the settings for RKNRFGO and this is the log after flashing.

screenshot.png

Reset delay: 0 ms
Reset type NORMAL: Resets core & peripherals via SYSRESETREQ & VECTRESET bit.

Writing 00000001 -> 4001E504

Reset delay: 0 ms
Reset type NORMAL: Resets core & peripherals via SYSRESETREQ & VECTRESET bit.

Sleep(1000)

Downloading file [Section0.0vOdqsDF.bin]...Comparing flash   [000%]000%]050%]100%] Done.
Erasing flash     [000%]100%] Done.
Programming flash [000%]000%]005%]005%]010%]010%]020%]020%]025%]025%]035%]035%]040%]040%]045%]045%]055%]055%]060%]100%] Done.
Verifying flash   [000%]000%]100%] Done.
J-Link: Flash download: Flash programming performed for 1 range (4096 bytes)
J-Link: Flash download: Total time needed: 0.164s (Prepare: 0.089s, Compare: 0.003s, Erase: 0.000s, Program: 0.061s, Verify: 0.000s, Restore: 0.009s)
O.K.

Downloading file [Section1.lCJ9YuF5.bin]...Comparing flash   [000%]000%]050%]100%] Done.
Erasing flash     [000%]100%] Done.
Programming flash [000%]000%]000%]000%]000%]000%]005%]005%]005%]005%]005%]005%]010%]010%]010%]010%]010%]010%]015%]015%]015%]015%]020%]020%]020%]020%]020%]020%]025%]025%]025%]025%]025%]025%]030%]030%]030%]030%]035%]035%]035%]035%]035%]035%]040%]040%]040%]040%]040%]040%]045%]045%]045%]045%]050%]050%]050%]050%]050%]050%]055%]055%]055%]055%]055%]055%]060%]060%]060%]060%]060%]060%]065%]065%]065%]065%]070%]070%]070%]070%]070%]070%]075%]075%]075%]075%]075%]075%]080%]080%]080%]080%]085%]085%]085%]085%]085%]085%]090%]090%]090%]090%]090%]090%]095%]095%]095%]100%] Done.
Verifying flash   [000%]000%]100%] Done.
J-Link: Flash download: Flash programming performed for 1 range (110592 bytes)
J-Link: Flash download: Total time needed: 2.169s (Prepare: 0.162s, Compare: 0.012s, Erase: 0.000s, Program: 1.905s, Verify: 0.002s, Restore: 0.086s)
O.K.

Downloading file [Section2.j6YAf9Gp.bin]...Comparing flash   [000%]000%]050%]100%] Done.
Erasing flash     [000%]100%] Done.
Programming flash [000%]000%]005%]100%] Done.
Verifying flash   [000%]000%]100%] Done.
J-Link: Flash download: Flash programming performed for 1 range (4096 bytes)
J-Link: Flash download: Total time needed: 0.169s (Prepare: 0.115s, Compare: 0.003s, Erase: 0.000s, Program: 0.011s, Verify: 0.000s, Restore: 0.038s)
O.K.

Downloading file [Section3.RxSJH8nW.bin]...Comparing flash   [000%]000%]050%]050%]100%] Done.
Verifying flash   [000%]100%] Done.
J-Link: Flash download: Flash download skipped. Flash contents already match
O.K.

Downloading file [Section4.qpm37Mkh.bin]...Comparing flash   [000%]000%]050%]050%]100%] Done.
Verifying flash   [000%]100%] Done.
J-Link: Flash download: Flash download skipped. Flash contents already match
O.K.

Downloading file [Section5.CQi0rkWg.bin]...Comparing flash   [000%]000%]040%]040%]050%]050%]090%]100%] Done.
Erasing flash     [000%]000%]100%] Done.
Programming flash [000%]000%]010%]010%]025%]025%]035%]035%]050%]050%]060%]060%]075%]075%]085%]085%]100%] Done.
Verifying flash   [000%]000%]100%] Done.
J-Link: Flash download: Flash programming performed for 1 range (16384 bytes)
J-Link: Flash download: Total time needed: 0.662s (Prepare: 0.162s, Compare: 0.099s, Erase: 0.031s, Program: 0.282s, Verify: 0.000s, Restore: 0.086s)
O.K.

Downloading file [Section6.W0fSYpr8.bin]...Comparing flash   [000%]000%]050%]100%] Done.
Erasing flash     [000%]000%]100%] Done.
Programming flash [000%]000%]005%]100%] Done.
Verifying flash   [000%]000%]100%] Done.
J-Link: Flash download: Flash programming performed for 1 range (4096 bytes)
J-Link: Flash download: Total time needed: 0.171s (Prepare: 0.115s, Compare: 0.004s, Erase: 0.007s, Program: 0.004s, Verify: 0.000s, Restore: 0.038s)
O.K.

Downloading file [Section7.LMfV07KW.bin]...Comparing flash   [000%]000%]050%]100%] Done.
Erasing flash     [000%]000%]100%] Done.
Programming flash [000%]000%]005%]100%] Done.
Verifying flash   [000%]000%]100%] Done.
J-Link: Flash download: Flash programming performed for 1 range (4096 bytes)
J-Link: Flash download: Total time needed: 0.171s (Prepare: 0.114s, Compare: 0.004s, Erase: 0.007s, Program: 0.004s, Verify: 0.000s, Restore: 0.038s)
O.K.

Sleep(1000)

Reset delay: 0 ms
Reset type NORMAL: Resets core & peripherals via SYSRESETREQ & VECTRESET bit.


Script processing completed.
Parents
  • Ok, I got this to work and it ended up pretty easy in the end.

    Here are the steps (for nRF52, pca10040):

    1. Using RKNRFGO set the Softdevice as "dfu_dual_bank_ble_s132_pca10040.hex" . Since we know this includes the SoftDevice, you don't flash a SoftDevice separately and RKNRFGO doesn't seem to mind that it has a Bootloader in it, although it does give a warning - but ignore it for these purposes. Don't add anything else (i.e., do not tick Use Code and do not tick Use Bootloader).

    2. Hit "Both" and RKNRFGO will wipe and install. If you just wanted the Bootloader up and running, then you can stop here. But if you have an app, keep going.

    3. Go to Segger Embedded Studio and your app. Set the memory Section Placement Macros as normal (so FLASH_START=0x1c000 and RAM_START=0x20002080).

    4. DO NOT specify a SoftDevice in Loader Options, remember we have already added that with RKNRFGO.

    5. However DO specify "bootloader_settings_nrf52.hex" in Loader Options which writes the flag to tell the device an app is present (more on this here -> devzone.nordicsemi.com/.../). This step is not strictly necessary, it just means that on each boot, the Bootloader will start and not the app, but if that is what you want you could stop at Step 2 above.

    6. Make sure you have done all the other steps for SES (i.e, deleting duplicate SEGGER_RTT files, etc) as outlined in the blog post here -> devzone.nordicsemi.com/.../.

    7. Then "Build and Run" and, as usual, your app will be running on the board.

    8. Now if you hit Boot/Reset on the DK while holding down Button 4, viola, the board will go into Bootloader mode. If you want to restart your app, just hit Boot/Reset again (without holding down Button 4) and your app will run once more.

    So now without leaving the comfort of your Mac, SES and RKNRFGO you can flash the SD, App and BL with a few simple steps.

Reply
  • Ok, I got this to work and it ended up pretty easy in the end.

    Here are the steps (for nRF52, pca10040):

    1. Using RKNRFGO set the Softdevice as "dfu_dual_bank_ble_s132_pca10040.hex" . Since we know this includes the SoftDevice, you don't flash a SoftDevice separately and RKNRFGO doesn't seem to mind that it has a Bootloader in it, although it does give a warning - but ignore it for these purposes. Don't add anything else (i.e., do not tick Use Code and do not tick Use Bootloader).

    2. Hit "Both" and RKNRFGO will wipe and install. If you just wanted the Bootloader up and running, then you can stop here. But if you have an app, keep going.

    3. Go to Segger Embedded Studio and your app. Set the memory Section Placement Macros as normal (so FLASH_START=0x1c000 and RAM_START=0x20002080).

    4. DO NOT specify a SoftDevice in Loader Options, remember we have already added that with RKNRFGO.

    5. However DO specify "bootloader_settings_nrf52.hex" in Loader Options which writes the flag to tell the device an app is present (more on this here -> devzone.nordicsemi.com/.../). This step is not strictly necessary, it just means that on each boot, the Bootloader will start and not the app, but if that is what you want you could stop at Step 2 above.

    6. Make sure you have done all the other steps for SES (i.e, deleting duplicate SEGGER_RTT files, etc) as outlined in the blog post here -> devzone.nordicsemi.com/.../.

    7. Then "Build and Run" and, as usual, your app will be running on the board.

    8. Now if you hit Boot/Reset on the DK while holding down Button 4, viola, the board will go into Bootloader mode. If you want to restart your app, just hit Boot/Reset again (without holding down Button 4) and your app will run once more.

    So now without leaving the comfort of your Mac, SES and RKNRFGO you can flash the SD, App and BL with a few simple steps.

Children
No Data
Related