Bootloader Erased when Application is programmed
There are a couple of threads that end with the poster saying that their bootloader is being erased when the applications is programmed. I hope that by starting a new post, we can get this issue resolved.
If I program the bootloader and run it, it works fine. When I program the application using the SystemWorkbench Run command it overwrites the bootloader with the elf file header information. Re-programming the bootloader again, and everything works fine.
If I have the debugger loaded, and I run the debugger, then everything works fine.
I did another experiment, I programmed the bootloader and using the ST-Link Utility I protected sectors 0 & 1. When I tried to program the application, I get an error that OpenOCD could not erase sectors 0 & 1 when the program clearly, according to the map file, starts in sector 2 (0x08008000).
This looks to me as an OpenOCD configuration problem, so I made some bootloader version of the OpenOCD configuration files and modified the base address of the flash bank command. No change.
I am out of ideas on how to fix this. Has anyone gotten this work?