Skip to content

BurnFirmware

Bogdan Bogush edited this page Apr 18, 2021 · 1 revision

Burn firmware

The STM32 MCU firmware can be burned using ST-Link or USB-UART adapter. Programming via USB is not supported on STM32F103.

ST-Link (SWD)

The device firmware is burned using ST-Link V2.

ST-Link is connected to the board's SWD pins as shown below. Brand-new MCU may require to be powered on with connected BOOT0 pins and sometimes additionally with RST pins (available in new PCB). After programming BOOT0 and RST pins must be unconnected.

ST-Link Ubuntu software

  • sudo apt-get install libusb-1.0-0-dev
  • git clone https://github.com/texane/stlink.git
  • cd stlink/
  • mkdir -p build && cd build
  • cmake -DCMAKE_BUILD_TYPE=Release ..
  • sudo make install
  • sudo cp ../etc/udev/rules.d/* /etc/udev/rules.d/
  • sudo udevadm control --reload-rules
  • sudo udevadm trigger
  • Connect ST-Link to board.
  • Download firmware from Google Driver release directory.
  • st-flash write nando_fw.bin 0x8000000

ST-Link Ubuntu/Windows/Mac STM32CubeProgrammer software

  • Download and install STM32CubeProgrammer from https://www.st.com or Google Driver tools directory.
  • Download firmware from Google Driver release directory.
  • Write firmware using STM32CubeProgrammer programmer.

USB-UART adapter

USB-UART adapter is connected to the board's UART pins as shown below. The board needs to be powered on with connected BOOT0 pins and sometimes additionally with RST pins (available in new PCB). After programming BOOT0 and RST pins must be unconnected.

USB-UART adapter Ubuntu/Windows/Mac STM32CubeProgrammer software

  • Download and install STM32CubeProgrammer from https://www.st.com or Google Driver tools directory.
  • Download firmware from Google Driver release directory.
  • Write firmware using STM32CubeProgrammer programmer. On Linux permission for /dev/ttyUSBx must be granted (sudo chmod 777 /dev/ttyUSB0).