Hello,
Talking about bare metal STM32L1xxx MCU, The most confusing thing to me is the programming and debugging interface.
I know that it supports multiple interfaces for programming, but what else is needed for programming?
For example if I want to use SWD, do I need only the 4 pins (SWCLK, SWDIO, GND and VCC) ? This makes no sense, since logically I need a way to make the MCU go into "programming" mode or "debugging" mode, let a lone another pin to reset/restart the MCU.
There's also "Boot loader activation" mentioned in ST documentation, and it mentions BOOT0 and BOOT1, and yet I keep reading that "can be implemented with as few as 4 pins: SWCLK, SWDIO, GND and VCC.".
The docs also mentions "Bootloader identification" which is all about the interfaces used for programming, I don't see USB mentioned.
This is all confusing to me.

My precise questions are:
1) Can I use USB for programming?
2) What other pins do I need other than the interface itself?
3) What is the difference between bootloader and the application/program running on the MCU? When I flash an MCU do I replace the bootloader or not?
4) how to enter the "programming" stage in terms of electrical signals (ex: signal x goes HIGH , signal y goes LOW, etc)
Thanks.