I'm aware I'm extremely late to the party here, but having just been through the same - this may help somebody.
In Studio, go to the application project's Properties
-> Tool
-> Programming Settings
, change from Erase entire chip
to Skip programming
.
Now, flash your bootloader and application manually through the Device Programming interface (Ctrl+Shift+P) or atprogram
, or whatever other means you're using, then simply start a debug session as normal. However, at this point you will not be able to debug the bootloader, only the application. To debug both in a single session, read on below.
Note, it's worth combining both the bootloader and application hex files into one single file, using srec-cat as an automated post-build action in Studio.
In the application project Properties
, go to Build Events
and add the following in the Post-build event command line
.
srec-cat <path_to_bootloader_outputs>\boot.hex -Intel <path_to_application_outputs>\app.hex -Intel -o <path_to_new_combined_image>\combined_image_name.hex -Intel
To be able to debug both the bootloader and application now in a single debug session, navigate to the application Properties
-> Advanced
-> Additional modules
, and add the .elf file for the bootloader, ensuring you tick Only debug symbols (no writing)
, whilst doing so.
If you now program the combined hex file containing both the bootloader and application, then start a debug session with Skip programming
enabled, you will be able to symbolically debug both the bootloader and application, as if they were one.