how to program an stm32
programming over USB
what youll need
- USB C
- computer with stm32CubeIDE or stm32cubeprogrammer
- plug stm32 data logger board in to the computer with a USB c cable
- switch the boot mode switch to
prog - press the reset button, you should hear a usb connect sound
- open up STM32CubeProgrammer
- within STM32CubeProgrammer select this drop down menu, and select usb
- hit the refresh button on the port line, and something like USB1 will apper
- after that click the connect, and you will be connected to the stm32 usb bootloader
- now click the download button on the other side of the window, this will bring you to erasing and programming
-
next you will want to browse for the create
.elffile that stm32cubeIDE spat out -
then you hit program and then your new code will be uploaded

-
switch boot mode back to flash
-
hit reset
-
profit?
programming over swd
what youll need
- 6 pin plug-o-nails
- stlink
- computer with stm32CubeIDE or stm32cubeprogrammer
- plug in the stlink to the computer with the 6 pin plug-o-nails connects
- plug in a usb c cable (this is only for power as swd techanlly shouldnt be sending power to the board)
- boot up either STM32cubeIDE or programmer, if you boot up programmer you can follow the same steps as USB but with swd instead
- if you used STM32CubeIDE, you should just be able to click the build and upload button and it will be done (i have only done this method once, i suggest looking at the stm32g4 documentaion for exact details)
Description








