Closed GoogleCodeExporter closed 9 years ago
Actually it does, you just have to be careful when using it.
The STLink USB firmware is very buggy. This causes several problems. It takes
5-10 seconds for the Linux kernel to decide that repeatedly resetting it won't
make it behave. Then you have to wait another 5 seconds or so before it
responds to commands, then close and re-open.
The older versions of stlink-download automated part of the waiting, but not
the full procedure. So after plugging it in, you both had to wait, and run it
once with a throw-away command.
The other issue is that it many commands attempt to do only what they say,
without changing the status. For instance the chip has to be stopped to read
CPU registers, but the "reg" command doesn't enforce this. Similarly you have
to explicitly stop the chip before erasing or writing the flash. So your
Makefile ends up looking like
$(STLINK-DOWNLOAD) /dev/stlink status
$(STLINK-DOWNLOAD) /dev/stlink debug reset erase=all flash:w:$<
This is fine for people that understand the chip details, but in retrospect not
the best approach.
I've updated the program to re-open until the status command works, and added a
few new commands.
The "erase" command does 'debug reset erase=all'.
The "program=<filename>" command does 'debug reset erase=all erase=all
flash:w:<filename>'
Hopefully these will make stlink-download easier to use.
Original comment by donald.b...@gmail.com
on 22 Jun 2011 at 2:50
Original comment by donald.b...@gmail.com
on 25 Jun 2011 at 4:44
Original issue reported on code.google.com by
ginniean...@gmail.com
on 11 Jun 2011 at 1:09