uVision erases first page when flashing

Hello,

I have bootloader at page 0,1,2,3 in STM32C051F8P6.
uVision is configured to flash application from page 6.
uVision erases first page when flashing.
When I generate a hex file from uVision and uses STM32CubeProgrammer to flash then it does not erase the first page.

  • Page 0. 0x08000000. Problem here: uVision erases this. STM32CubeProgrammer does not erase this.
  • Page 1. 0x08000800. Not erased
  • Page 2. 0x08001000. Not erased
  • Page 3. 0x08001800. Not erased
  • Page 6. 0x08003000. Successfully puts application from here

What I always need to do now in uVision is to flash application first then bootloader because flashing the application destroys the first page of the bootloader.
How to prevent uVision erasing page 0 at 0x08000000 even though it is configured to flash from 0x08003000? 




0