Page 3 of 12
Re: ST-Link V2 on Linux
Posted: Fri Dec 02, 2011 10:56 pm
by Jacon
And a good one - working like a charm here
(WinXP SP3)
Jacek
Re: ST-Link V2 on Linux
Posted: Sat Dec 03, 2011 10:50 am
by mobyfab
I still had a version of QT 4.7.3 I had compiled statically for MSVC 2010 so it took me like 20 minutes to modify the code.
libusb is compiled statically as well so no messing with DLLs, it's much easier.
I'll make a CLI version for windows since it's not possible to choose at runtime here.
Re: ST-Link V2 on Linux/OSX/Windows
Posted: Sat Dec 03, 2011 11:36 am
by Giovanni
May I suggest to use "normal" CLI parameters preceeded by '-' ?
For example
-e erase
-p program
-v verify (the exit code 0 would mean correct verification, 1 verify error).
-ln verbose level (0 = silent)
-r reset and run
This could become a good multi-platform tool for batch regression testing.
Giovanni
Re: ST-Link V2 on Linux/OSX/Windows
Posted: Sat Dec 03, 2011 11:45 am
by mobyfab
Yeah I can do this

Pushed a new version of the exe, there was a small error in the code that prevented the files to be written correctly to disk when dumping the content of the flash.
Also, there is no need to run the program as root anymore if you add the required udev rules (pushed to svn)
Re: ST-Link V2 on Linux/OSX/Windows
Posted: Sat Dec 03, 2011 4:48 pm
by Jacon
Hmm...
When I connect to my STM32F4-Discovery and make some tests on previously
downloaded firmware (get info, MCU halt-reset-run) everything seems to look
OK.
But when I Send new firmware, I must disconnect USB cable from PC to
recreate proper operation of Discovery board - it stops responding to anything,
hard Reset button included
None of possible operations from your application change state of the board!
It looks like bug in ending of firmware send.
Test firmware files checked with original ST-LinkV2 application - no problems
at all.
BTW - Receive worked & ended perfect.
Re: ST-Link V2 on Linux/OSX/Windows
Posted: Sat Dec 03, 2011 5:41 pm
by mobyfab
Yes my card has the same behavior, in most cases I need to replug it to have the board work with the new firmware.
Don't know how to "hard reset" it, seems like the reset System/Core doesn't work properly...
edit: It should work now

I have done some reverse engineering on the official tool.
Re: ST-Link V2 on Linux/OSX/Windows
Posted: Sat Dec 03, 2011 7:52 pm
by Jacon
Downloaded latest version 10 minutes ago - the same bad behaviour as before

Re: ST-Link V2 on Linux/OSX/Windows
Posted: Sat Dec 03, 2011 8:21 pm
by mobyfab
That's odd, I just tested and it worked fine...
Try to re-download the last version.
Re: ST-Link V2 on Linux/OSX/Windows
Posted: Sat Dec 03, 2011 10:00 pm
by Jacon
Nope - seems to me that STLink is steady connected to host MCU after Send,
because I can receive just sent firmware, disconnect, leave & restart your
application, connect back & receive again etc - everything here is OK.
But to start my host application, i must reconnect USB cable...
Re: ST-Link V2 on Linux/OSX/Windows
Posted: Sun Dec 04, 2011 6:22 pm
by mobyfab
I have done some modifications, it should work now.
I have done some tests on both Windows and Linux, it works fine.
I have uploaded the demonstration FW then the ChibiOS FW, both programs start right after writing to flash.