You programmed STM32 microcontroller using Nucleo or Discovery boards. Those use Serial Wire Debug (SWD) for programming/debugging. Now you are designing a PCB with STM32 microcontroller on it which means you have to be able to program it. One of the solutions is uploading the code through a bootloader - small piece of software made by ST that’s in the protected memory of the microcontroller (read-only). It reads the data being sent from the PC and copies it into FLASH memory.
STM32 microcontroller system memory boot mode - this document describes hardware resources used by the bootloader and the bootloader activation pattern (what needs to be set to activate bootloader).
Lower-end micro’s can only use UART for flashing, higher-end can use:
To activate bootloader you often have to do it by pulling one or two pins (BOOT0 and/or BOOT1 high). You can for example:
core_cmX.h- X in the filename depends on the micro).
Be sure to:
On the PC side use stm32flash.