I have an own bootloader software which starts from FLASH memory and copies itself to RAM memory. How could I debug such applications?

There are several main approaches in general

  1. Develop and debug FLASH and RAM code separately. For that you need two different build variants, one for located to flash and one located to RAM. The Flash variant should be the final release variant running without UDE. If the development and test is done the Flash variant should be used as the final image.
  2. Locate FLASH and RAM to different sections. For that FLASH code and RAM code should be located to different section. For example locate FLASH code to .text_flash and RAM code to .text section. At the same time you need to create a ROM copy of that section which is copied during bootup of the application. For setting breakpoints in RAM code you have to enable the Set hardware breakpoint by default option located in menu Config - Debug Server Configuration-Debug Server because software breakpoints get lost after copy of RAM code. That is almost the best solution because debug information are available for both, FLASH and RAM code.