Requirement: Keep BOOT0 held high, so the STM32 is in DFU mode upon initial connection to the computer. The computer software can either flash or leave immediately to 0x08000000, running the flash program.
Issue: The DFU leave command does not work while BOOT0 is held high.
Potential Solutions: Users have solved this issue on STMF4 products due to it having a Cortex-M3 or M4: Leave DFU while boot0 is high (STM32F4)
Uncommenting this lines solves the issue on those products as well:
#define USER_VECT_TAB_ADDRESS
However, I haven't found resources with a step-by-step solution for Cortex-M0 (STM32F072RBT).
I have tried relocating the vector tables and booting from SRAM. However, since I never found a clear way of doing this, I believe all my attempts had corrupted code.
Large Picture Motivation: Release a product (STM32F072RBT) without any buttons or toggles on the PCB and allow customers to flash and interact with their product over a USB serial interface.
Located in file system_stm32f0xx.c (or whatever your Cortex-M0 chip's name is):
void SystemInit(void) {
SYSCFG->CFGR1 &= ~(0x1 << 5);
}