SW4STM32 overwriting areas of flash outside ROM?
I am trying to debug an application with a bootloader on a F105RC.
Bootloader runs from 0x08000000 then jumps to main application at 0x08004000.
Both bootloader and main app are seperate projects and so flashed into the MCU seperately.
At the moment the bootloader is very simple - it just jumps to the reset handler in the main application by checking the vector table at 0x08004000. The main application changes the exception table offset and then runs as normal.
My problem is that, when I debug or run the main application from within SW4STM32 it over-writes the bootloader and so will not run. If I inspect the flash memory using stlink I find at 0x08000000 starts with 464C457F, (which spells ELF....) rather than 20010000, 080003ED etc which is the correct start to the bootloader vector table.
Is there anything I can do to stop the run/debug over-writing the start of the flash space like this?
fwiw, to relocate the main application to 08004000 all I did was modify the .ld script with
/* Memories definition */
MEMORY
{
RAM (xrw) : ORIGIN = 0x20000000, LENGTH = 64K
ROM (rx) : ORIGIN = 0x08004000, LENGTH = 240K /*this changed from default*/
}