Skip to content

Commit e5f88c2

Browse files
authored
Merge pull request #29 from lghty/serial-docs
docs: Add section for serial flashing
2 parents b35f636 + 2ec6ab0 commit e5f88c2

File tree

1 file changed

+18
-0
lines changed

1 file changed

+18
-0
lines changed

README.md

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ One of:
2727
- [dfu-util](http://dfu-util.sourceforge.net/)
2828
- [openocd for GD32VF103](https://github.com/riscv-mcu/riscv-openocd)
2929
- [RV-LINK](https://gitee.com/zoomdy/RV-LINK)
30+
- [stm32flash](https://sourceforge.net/projects/stm32flash/)
3031

3132
When using `dfu-util`, the entire RISC-V toolchain is not necessary. Only `objcopy` from [riscv-binutils-gdb](https://github.com/sifive/riscv-binutils-gdb.git) is needed.
3233

@@ -199,6 +200,23 @@ of the green LED:
199200
| Fast blinking, on for 100ms, off for 100ms | GDB is connected, and the debugged MCU is running |
200201
| Long pulse, on for 900ms, off for 100ms | RV-LINK has failed. Retry after resetting RV-LINK |
201202

203+
204+
## Using serial for Flashing
205+
206+
Using a TTL-to-USB adapter, one can flash the firmware to the device over a serial connection:
207+
208+
```
209+
$ stm32flash -g 0x08000000 -b 115200 -w firmware.bin /dev/ttyUSB0
210+
```
211+
212+
which sets the base address (`-g 0x08000000`) for the firmware to the start of main flash.
213+
214+
The baud rate (`-b 115200`), firmware image (`-w firmware.bin`), and serial port (`/dev/ttyUSB0`) are set next.
215+
216+
The serial port may vary machine to machine, so select the port that makes sense.
217+
218+
Make sure the device is writeable by the current user, or run `stm32flash` as root.
219+
202220
## License
203221

204222
Copyright 2019-2020 [RISC-V team][team]

0 commit comments

Comments
 (0)