# STM32F0 boot0 pin and SWD programming

As I understand the datasheets boot0 pin and boot1 bit (in a register) control how the CPU boots up, which are Main Flash memory, System memory and Embedded SRAM. I honestly don't know the differences in functionality of these memory sections, nor do I want to care right now (feel free to tell me why I should).

My use-case requires programming it through SWD as needed (so not a one-time deal) and boot from it.

I'm not interested in various flash configurations or having bootloaders to program the chip over other protocols. I'm not going to mass-produce this.

Would pulling boot0 pin low through a resistor and simply connecting the SWD connector allow me to do this?

• FYI For my part STM32F030cc the truth table in the datasheet seems wrong. I wanted to do the same as you but it kept jumping to the system ROM bootloader instead of main flash until I zero'd the BOOT1 bit even though the datasheet stated BOOT1 is 'x' (dont care) when BOOT0 is grounded. Jul 13, 2021 at 13:40

SWD should work on an unlocked part regardless of the state of the boot0 pin, unless one state triggers the operation of code (or corrupt flash contents misinterpreted as code) which either re-purposes the SWD pins, or puts the chip into a suspend mode with SWD inactive.
A sometimes used shortcut however is to temporarily drive boot0 high which (when the chip is unlocked) causes booting from either the bootloader or the SRAM, with the idea that doing so will prevent the "problem" code in flash from running, and make it easier to get an SWD connection going.