STM32 gotchas
155. After programming/reset/power cycle, program does not work - and debugging ends up at 0x1FFFxxxx addresses

The common denominator of these problems is the built-in bootloader; however, there are several mechanisms involved.

The built-in bootloader is located to the so called system memory - an area of FLASH at 0x1FFFxxxx addresses, which is programmed at factory and locked, so that it can't be reprogrammed. When the entry mechanism is activated at mcu reset, this memory is mapped (aliased) by hardware at 0x0000'0000, from where the processor boots. The bootloader entry mechanisms for individual STM32 (sub)families differ, and they (together with other details) are described in AN2606.

If the user program after programming it into FLASH and subsequent reset, does not work, it may be that:

Common remedy to BOOT0-pin-related problems is to set the Option bytes so, that the hardware pin is not sampled at startup, effectively disabling the bootloader entirely.

In cases where the system memory (bootloader area) remains mapped at 0x0000'0000, before enabling any interrupt, the SCB_VTOR register has to be set to 0x0800'0000 to map properly the vector table to user FLASH. Alternatively, (e.g. in 'F0 based on Cortex-M0 which does not have SCB_VTOR), use the remapping mechanism (usually a MEM_MODE field in some of the SYSCFG registers) to map user FLASH to 0x0000'0000.