How can I use STM32 blue pill with external power source (like battery
$begingroup$ When you finish programming, you can use the USB port on a power bank to power the board. You can also cut a USB cable and route the red to the 5V pin and black to ground. Do not apply power to the 5V input while a USB connector is in use (computer damage is unlikely but possible).