imported from https://codeberg.org/Riku_V/stm32-vserprog
Riku Viitanen 8fcf0a4d41 Add phony rule to just make libopencm3 | hai 1 ano | |
---|---|---|
boards | hai 1 ano | |
flashrom @ 554a01f9a6 | %!s(int64=3) %!d(string=hai) anos | |
libopencm3 @ 458250dc61 | %!s(int64=3) %!d(string=hai) anos | |
pcb | %!s(int64=7) %!d(string=hai) anos | |
.gitignore | %!s(int64=7) %!d(string=hai) anos | |
.gitmodules | %!s(int64=3) %!d(string=hai) anos | |
.travis.yml | %!s(int64=6) %!d(string=hai) anos | |
LICENSE | %!s(int64=9) %!d(string=hai) anos | |
Makefile | hai 1 ano | |
README.md | %!s(int64=6) %!d(string=hai) anos | |
serprog.h | hai 1 ano | |
spi.c | %!s(int64=3) %!d(string=hai) anos | |
spi.h | %!s(int64=6) %!d(string=hai) anos | |
usbcdc.c | hai 1 ano | |
usbcdc.h | %!s(int64=8) %!d(string=hai) anos | |
vserprog.c | hai 1 ano |
This project deprecates previous serprog-stm32vcp
project,
which uses STMicro's proprietary firmware library. Most functions are the same.
libopencm3
instead of STMicro's proprietary firmware library.flashrom
"serprog" protocol:
flashrom
wiki)..inf
file of other CDC drivers, not confirmed).flashrom
's calibration time).stm32flash
and the gcc-arm-none-eabi
toolchain.On Debian, simply do the following:
sudo apt-get install stm32flash gcc-arm-none-eabi
NOTE: some systems may require installing newlib
(e.g. libnewlib-arm-none-eabi
) manually. See #27.
Simply type (change the board name accordingly, for details see the header of the Makefile
or just type make
):
git clone --recurse-submodules https://github.com/dword1511/stm32-vserprog.git
make BOARD=stm32-vserprog-v2
Connect the USB-to-UART bridge to your computer first. Then connect TXD and RXD lines to your STM32 board with wires. On V2 or V3 boards mentioned above, connect BOOT0 (labeled BT0 on boards) to the 3.3V output of the USB-to-UART bridge. For other boards, find the BOOT0 jumper or ISP switch, put it into high or enabled. On some boards, you will also need to ensure BOOT1 is pulled low. Then, connect your STM32 board to your computer via USB to power it up. Finally, type:
make BOARD=stm32-vserprog-v2 flash-uart
Throw the USB-to-UART bridge away and enjoy. Do not forget to pull BOOT0 low before resetting or replugging the board.
The following assumes Linux platform, and that the programmer appears as /dev/ttyACM0
.
flashrom -p serprog:dev=/dev/ttyACM0:4000000 -r file-to-save.bin
flashrom
will ask you to choose a chip, add something like: -c SST25VF040B
This is because sometimes different devices with distinct timing requirements can only be distinguished by the device code,
however currently flashrom
will not read it as it is not returned by the RDID
command.
flashrom -p serprog:dev=/dev/ttyACM0:4000000 -E
flashrom
version,
but if you try a second pass, everything will be alright. Seems that the first block needs more delay to be erased. flashrom -p serprog:dev=/dev/ttyACM0:4000000 -w file-to-load.bin
Error: Cannot open serial port: Device or resource busy
", please try to stop or remove ModemManager
.flashrom
version. Do not forget to power the flash chip itself if operating on a breadboard or prototype board.flashrom
's output. I appreciate your feedback.