This tutorial will explain step by step how to build and deploy MicroPython on STM32F407xx and STM32F411CEU boards, using both DFU mode over USB, as well as SWD with ST-Link and OpenOCD in case you can't get the board into DFU mode (happened to me with the "black pill").
It should be applicable to other boards, such as the other "black pill" STM32F401, Nucleo boards etc., provided you can find an appropriate board definition to build.