Page:
Building st flash
Pages
Board FreeSOC
Board Arduino Due
Board BLACK F407VE
Board BLACK F407ZE
Board BLACK F407ZG
Board Crazyflie2
Board Espruino Pico
Board FEZ Cerb40 II
Board FEZ Cerb40
Board FEZ Lemur
Board G30HDR
Board HydraBus V1.0
Board NUCLEO F401RE
Board NetduinoPlus2
Board Nucleo F767ZI
Board Olimex STM32 405STK
Board Olimex STM32 E407
Board OpenMV
Board STM32F401 Discovery
Board STM32F407 Discovery
Board STM32F429
Board STM32F746 Discovery
Board Teensy 3.1 3.5 3.6
Board Tiva TM4C123G Launchpad
Board VCC GND STM32F407VET6 Mini
Boards Summary
Build Troubleshooting
Building Micropython Binaries
Building st flash
Collections module
ContributorGuidelines
CrossBranch
Developing on a microcontroller
Differences
Examples
FAQ
Getting Started Compiling Micropython for Ubuntu 16.04
Getting Started STM
Getting Started
HY STM32F4xxCore144
Hardware API
Home
Instrumenting code using GPIOs
LCD driver
LTO
Learn MicroPython
Memory Manager
Micro Python on Mac OSX
MicroPythonVsELua
Micropython Git Development Workflow
PPP on ESP32
PWM Timers
Performance
Programming Debugging the pyboard using ST Link v2
ProjectsUsingMicroPython
Pyboard Firmware Update
STM32F405 Timer Triggering
STM32F405 pinouts
Securing a MicroPython System
Servos
Soft reset
Standard Library Coverage
Symbolic Debugging for STM32
Threads
Timebase calculation and Clock sources
Timer Implementation
Timer capture mode
Timer one shot
Tips and Tricks
VS Code
Watchdogs, Crash prevention, Crash recovery
1
Building st flash
Dave Hylands edited this page 2015-10-28 09:45:00 -07:00
This page gives a quick overview of how to build and install stlink (which includes st-flash).
These instructions were done under Ubuntu 14.04 LTS.
###Install Pre-requisites### You'll need some build tools. It's possible that there are some prerequisites missing here.
sudo apt-get install libusb-dev
sudo apt-get install autoconf
sudo apt-get install build-essential
###Build stlink###
git clone https://github.com/texane/stlink
cd stlink
./autogen.sh
./configure
make
sudo make install
###Install udev rules###
sudo cp 49*.rules /etc/udev/rules.d
udevadm control --reload-rules
udevadm trigger
###Flashing MicroPython using st-flash### I normally create a GNUmakefile (in the stmhal directory) which looks something like the following:
$(info Executing GNUmakefile)
BOARD = STM32F7DISC
$(info BOARD = $(BOARD))
include Makefile
.PHONY: stlink
stlink: $(BUILD)/firmware.elf
$(ECHO) "Writing flash"
$(Q)$(OBJCOPY) -O binary -j .isr_vector $^ $(BUILD)/firmware0.bin
$(Q)st-flash write $(BUILD)/firmware0.bin 0x08000000
$(Q)$(OBJCOPY) -O binary -j .text -j .data $^ $(BUILD)/firmware1.bin
$(Q)st-flash --reset write $(BUILD)/firmware1.bin 0x08020000
and then you can use make stlink
to flash the micropython image using st-flash