Skip to content

Black Pill

Pasted image 20230316171955.png Pasted image 20230316172006.png Pasted image 20230316172015.png

Uploading Code

There are two ways to load code onto the board: 1. Upload via JTAG 2. Upload via DFU

Example: Uploading via JTAG

In this example, we'll compile the Arduino Blink example and upload it via the JTAG port using Segger Ozone.

  1. Compile 'Blink' sketch: Pasted image 20230316172100.png
  2. Upload and debug using Segger Ozone: Pasted image 20230316172112.png

Example: Uploading via DFU

Pasted image 20230316172133.png

Example: Using MicroPython

To flash the Micropython firmware, do the following: - git clone https://github.com/peddamat/micropython-stm32f407ve.git - ./build.sh - ./run.sh

The firmware files should now be in the 'output' subdirectory.

Pasted image 20230316172201.png

Power on the board in "DFU Mode", and then upload the 'firmware.elf' file using STM32CubeProgrammer.

Pasted image 20230316172206.png

After burning the firmware, move the Boot bin back to normal and reboot the board.

The board should now show up as a serial port and a disk drive:

Pasted image 20230316172214.png Pasted image 20230316172220.png

Connect to the REPL via Putty and type the following:

from machine import Pin
led = Pin("PA6", Pin.OUT)
led.low()

Last update: 2023-03-16