ST-Link V2 on Linux/OSX/Windows

This forum is about you. Feel free to discuss anything is related to embedded and electronics, your awesome projects, your ideas, your announcements, not necessarily related to ChibiOS but to embedded in general. This forum is NOT for support.
Post Reply
User avatar
Badger
Posts: 346
Joined: Mon Apr 18, 2011 6:07 pm

Re: ST-Link V2 on Linux/OSX/Windows

Post by Badger »

The OSX package didn't work for me, looks like the Qt library isn't included with it:

Code: Select all

Process:         qstlink2 [82023]
Path:            /Users/USER/Downloads/qstlink2.app/Contents/MacOS/qstlink2
Identifier:      com.yourcompany.qstlink2
Version:         ??? (???)
Code Type:       X86-64 (Native)
Parent Process:  launchd [312]

Date/Time:       2011-12-13 08:23:02.823 +0000
OS Version:      Mac OS X 10.7.2 (11C74)
Report Version:  9

Interval Since Last Report:          1036298 sec
Crashes Since Last Report:           41
Per-App Crashes Since Last Report:   1
Anonymous UUID:                      9ED4E3BB-ADE5-4EEF-9E6C-64790A28A774

Crashed Thread:  0

Exception Type:  EXC_BREAKPOINT (SIGTRAP)
Exception Codes: 0x0000000000000002, 0x0000000000000000

Application Specific Information:
dyld: launch, loading dependent libraries

Dyld Error Message:
  Library not loaded: /opt/local/lib/QtXml.framework/Versions/4/QtXml
  Referenced from: /Users/USER/Downloads/qstlink2.app/Contents/MacOS/qstlink2
  Reason: image not found

Binary Images:
       0x108566000 -        0x1085a8fef +com.yourcompany.qstlink2 (??? - ???) <4CB1375F-347C-33FE-89C8-AE7EB9E0FF58> /Users/USER/Downloads/qstlink2.app/Contents/MacOS/qstlink2
       0x1085ca000 -        0x1085ccfff +libusb-0.1.4.dylib (9.4.0 - compatibility 9.0.0) <5F02B138-D391-3751-8A9A-EEF18A7577B4> /usr/local/lib/libusb-0.1.4.dylib
    0x7fff68166000 -     0x7fff6819aac7  dyld (195.5 - ???) <4A6E2B28-C7A2-3528-ADB7-4076B9836041> /usr/lib/dyld

Model: MacBookPro5,5, BootROM MBP55.00AC.B03, 2 processors, Intel Core 2 Duo, 2.26 GHz, 4 GB, SMC 1.47f2
Graphics: NVIDIA GeForce 9400M, NVIDIA GeForce 9400M, PCI, 256 MB
Memory Module: BANK 0/DIMM0, 2 GB, DDR3, 1067 MHz, 0x029E, 0x434D33583247534431303636202020202020
Memory Module: BANK 1/DIMM0, 2 GB, DDR3, 1067 MHz, 0x029E, 0x434D33583247534431303636202020202020
AirPort: spairport_wireless_card_type_airport_extreme (0x14E4, 0x8D), Broadcom BCM43xx 1.0 (5.100.98.75.18)
Bluetooth: Version 4.0.1f4, 2 service, 11 devices, 1 incoming serial ports
Network Service: AirPort, AirPort, en1
Serial ATA Device: INTEL SSDSA2CW120G3, 120.03 GB
Serial ATA Device: ST9500420ASG, 500.11 GB
USB Device: Built-in iSight, apple_vendor_id, 0x8507, 0x24400000 / 2
USB Device: Internal Memory Card Reader, apple_vendor_id, 0x8403, 0x26500000 / 2
USB Device: STM32 STLink, 0x0483  (STMicroelectronics), 0x3748, 0x04100000 / 3
USB Device: Apple Internal Keyboard / Trackpad, apple_vendor_id, 0x0237, 0x04600000 / 4
USB Device: IR Receiver, apple_vendor_id, 0x8242, 0x04500000 / 2
USB Device: BRCM2046 Hub, 0x0a5c  (Broadcom Corp.), 0x4500, 0x06100000 / 2
USB Device: Bluetooth USB Host Controller, apple_vendor_id, 0x8213, 0x06110000 / 3
noether
Posts: 91
Joined: Wed Nov 16, 2011 3:18 pm

Re: ST-Link V2 on Linux/OSX/Windows

Post by noether »

Tested on Debian Testing.

Compiled without any problems and it works fine for programming the Discovery with the M4F.
mobyfab
Posts: 484
Joined: Sat Nov 19, 2011 6:47 pm
Has thanked: 21 times
Been thanked: 31 times

Re: ST-Link V2 on Linux/OSX/Windows

Post by mobyfab »

Badger wrote:The OSX package didn't work for me, looks like the Qt library isn't included with it:

Code: Select all

Process:         qstlink2 [82023]
Path:            /Users/USER/Downloads/qstlink2.app/Contents/MacOS/qstlink2
Identifier:      com.yourcompany.qstlink2
Version:         ??? (???)
Code Type:       X86-64 (Native)
Parent Process:  launchd [312]

Date/Time:       2011-12-13 08:23:02.823 +0000
OS Version:      Mac OS X 10.7.2 (11C74)
Report Version:  9

Interval Since Last Report:          1036298 sec
Crashes Since Last Report:           41
Per-App Crashes Since Last Report:   1
Anonymous UUID:                      9ED4E3BB-ADE5-4EEF-9E6C-64790A28A774

Crashed Thread:  0

Exception Type:  EXC_BREAKPOINT (SIGTRAP)
Exception Codes: 0x0000000000000002, 0x0000000000000000

Application Specific Information:
dyld: launch, loading dependent libraries

Dyld Error Message:
  Library not loaded: /opt/local/lib/QtXml.framework/Versions/4/QtXml
  Referenced from: /Users/USER/Downloads/qstlink2.app/Contents/MacOS/qstlink2
  Reason: image not found

Binary Images:
       0x108566000 -        0x1085a8fef +com.yourcompany.qstlink2 (??? - ???) <4CB1375F-347C-33FE-89C8-AE7EB9E0FF58> /Users/USER/Downloads/qstlink2.app/Contents/MacOS/qstlink2
       0x1085ca000 -        0x1085ccfff +libusb-0.1.4.dylib (9.4.0 - compatibility 9.0.0) <5F02B138-D391-3751-8A9A-EEF18A7577B4> /usr/local/lib/libusb-0.1.4.dylib
    0x7fff68166000 -     0x7fff6819aac7  dyld (195.5 - ???) <4A6E2B28-C7A2-3528-ADB7-4076B9836041> /usr/lib/dyld

Model: MacBookPro5,5, BootROM MBP55.00AC.B03, 2 processors, Intel Core 2 Duo, 2.26 GHz, 4 GB, SMC 1.47f2
Graphics: NVIDIA GeForce 9400M, NVIDIA GeForce 9400M, PCI, 256 MB
Memory Module: BANK 0/DIMM0, 2 GB, DDR3, 1067 MHz, 0x029E, 0x434D33583247534431303636202020202020
Memory Module: BANK 1/DIMM0, 2 GB, DDR3, 1067 MHz, 0x029E, 0x434D33583247534431303636202020202020
AirPort: spairport_wireless_card_type_airport_extreme (0x14E4, 0x8D), Broadcom BCM43xx 1.0 (5.100.98.75.18)
Bluetooth: Version 4.0.1f4, 2 service, 11 devices, 1 incoming serial ports
Network Service: AirPort, AirPort, en1
Serial ATA Device: INTEL SSDSA2CW120G3, 120.03 GB
Serial ATA Device: ST9500420ASG, 500.11 GB
USB Device: Built-in iSight, apple_vendor_id, 0x8507, 0x24400000 / 2
USB Device: Internal Memory Card Reader, apple_vendor_id, 0x8403, 0x26500000 / 2
USB Device: STM32 STLink, 0x0483  (STMicroelectronics), 0x3748, 0x04100000 / 3
USB Device: Apple Internal Keyboard / Trackpad, apple_vendor_id, 0x0237, 0x04600000 / 4
USB Device: IR Receiver, apple_vendor_id, 0x8242, 0x04500000 / 2
USB Device: BRCM2046 Hub, 0x0a5c  (Broadcom Corp.), 0x4500, 0x06100000 / 2
USB Device: Bluetooth USB Host Controller, apple_vendor_id, 0x8213, 0x06110000 / 3


You have to install the libraries yourself, same on Linux.

Can you retry with the libraries ?

Thanks for testing. :)
mobyfab
Posts: 484
Joined: Sat Nov 19, 2011 6:47 pm
Has thanked: 21 times
Been thanked: 31 times

Re: ST-Link V2 on Linux/OSX/Windows

Post by mobyfab »

Latest update: (you asked for that Giovanni :) )

Code: Select all

$ ./qstlink2 --help
Missing parameters, help below:
"

This application can be used through the GUI or via the command line. (CLI)

Command line usage:
qstlink2 [-hqvcwreV] [path]

-h, --help: shows this help
-q, --quiet: Quiet output (Nothing)
-v, --verbose: Verbose output (Debug)
-c,--cli: Enable command line mode
-w,--write: Enable write mode - Needs Path
-r,--read: Enable read mode - Needs Path
-e,--erase: Flash will be completely erased
-V, --verify: When used with write, the file will be verified against flash
-R, --reset: will reset the MCU

Example to write and verify the device:
qstlink2 -cwV /home/me/myfile.bin (you can also use relative paths like ./test.bin)
or
qstlink2 --cli --write --verify /home/me/myfile.bin


Please note that verify and reset are not implemented yet.
If you perform flash operations the device will be reseted anyways.

There is a Windows CLI version as well in the download area.
JetForMe
Posts: 99
Joined: Mon Jan 31, 2011 8:12 am

Re: ST-Link V2 on Linux/OSX/Windows

Post by JetForMe »

I'm going to develop a board around the STM32F417x part family. I have a couple of the STM32F4-Discovery boards, and I'm glad to see you got it working under Linux. I'm using Mac OS X. Next week, I'll try to reproduce your efforts there. Thanks for the work!
carnecro
Posts: 10
Joined: Sun Mar 04, 2012 8:03 pm

Re: ST-Link V2 on Linux/OSX/Windows

Post by carnecro »

Anybody got qstlink2 running under Mac OSX? I try to make the project, ending with error 'missing usb.h', referenced from LibUsb.h. When I have a look at libusb project sources there is no usb.h. Any hint?
chrisjensen
Posts: 10
Joined: Tue Feb 28, 2012 9:53 pm

Re: ST-Link V2 on Linux/OSX/Windows

Post by chrisjensen »

carnecro wrote:Anybody got qstlink2 running under Mac OSX? I try to make the project, ending with error 'missing usb.h', referenced from LibUsb.h. When I have a look at libusb project sources there is no usb.h. Any hint?


I have used it before on my home computer, and just installed it on my portable (both are macs running 10.7.3). In order to make it work I installed qt-mac-opensource-4.8.0.dmg and qt-mac-opensource-4.8.0-debug-libs.dmg from

http://qt.nokia.com/downloads/qt-for-open-source-cpp-development-on-mac-os-x/

and then I installed the libUSB from a package 0.1.13beta (I couldn't get to the libusb site right now)

I was then able to load the qstlink program, and upload a precompiled binary. It seems to be working pretty well as far as I can tell. Let me know if you need me to link the libUSB file or send it to you just let me know.

-Chris
carnecro
Posts: 10
Joined: Sun Mar 04, 2012 8:03 pm

Re: ST-Link V2 on Linux/OSX/Windows

Post by carnecro »

OK, seems the project uses the old and since 3 or 4 years no more supported libUSB version 0.1.x instead of the new 1.0.x. Note both releases are not compatible, 1.0.x is the fork and the project is active. I do not understand why new projects like this one does not take the official trunk, maybe the maintainer has any reason. There is another project mapping the 0.1.x calls to 1.0.x calls but it is terrible hack.
mobyfab
Posts: 484
Joined: Sat Nov 19, 2011 6:47 pm
Has thanked: 21 times
Been thanked: 31 times

Re: ST-Link V2 on Linux/OSX/Windows

Post by mobyfab »

I had to use the old one since libusb-win32 uses this version, same for osx, the binary package is 0.1, plus it's more stable.

I don't think a port to 1.0 would be hard to do.
mobyfab
Posts: 484
Joined: Sat Nov 19, 2011 6:47 pm
Has thanked: 21 times
Been thanked: 31 times

Re: ST-Link V2 on Linux/OSX/Windows

Post by mobyfab »

Why do you want 1.0?
Post Reply