0

IMAGE LINK: https://ibb.co/yfFvwQP

I am using Arch Linux as my main os. I have just started embedded dev and am setting up my env.

I am having an error connecting to my St Link V2 debugger as shown in the snapshot I included. I used Stm32CubeMx to generate the code and Atollic as my IDE. I can build the project fine, but when trying to connect and debug I get a message that no device target is found which leads me to think I am missing some drivers/libs. I am unsure how to proceed as this is my first time setting these things up..

The st link USB has a red light that then goes to blue/purple; all the wires are hooked up properly - the board has a solid red light and flashing green light the CPU is the STM32F103C8T6

ERROR MESSAGE FROM ATTOLIC

STMicroelectronics ST-LINK GDB server. Version 5.1.0 Copyright (c) 2018, STMicroelectronics. All rights reserved.

Starting server with the following options: Persistent Mode : Disabled Logging Level : 1 Listen Port Number : 61234 Status Refresh Delay : 15s Verbose Mode : Disabled SWD Debug : Enabled

Target no device found

Error in initializing ST-LINK device. Reason: No device found on target.

Invic18
  • 23
  • 1
  • 7
  • When I use the St-Link gui which can be found in the AUR ( arch linux repo ) the light on the usb debugger will go from red to blue and flash a few times in between the same thing occurs if I attempt to flash the device using the st link CLI ... it's odd because I don't think this would happen without the proper drivers? here is the application GUI I am referring to 1 aur/qstlink2-git 1:1.2.4.r244.24a687a-1 (+9 0.00%) (Installed: 1:1.2.4.r252.cd27f4b-1) A ST-Link V2 (Debugger/Programmer) client graphical user interface – Invic18 Jun 26 '19 at 00:30
  • I didn't realize there was an official solution for this on linux, vs. OpenOCD or texane/stlink. Anyway, first things to check are that it is visible in the output of `lsusb` and that you have a suitable udev rule granting access to non-root users. While I don't know exactly what ST or Atollic are doing, on Linux this type of thing doesn't generally use a "driver" so much as a userspace program which interacts with it. You could also see if the messages are any different with the target connected vs not connected to the stlink. – Chris Stratton Jun 26 '19 at 03:14
  • so running `lsusb`I can see the device connected : Bus 004 Device Bus 002 Device 006: ID 0483:3748 STMicroelectronics ST-LINK/V2 – Invic18 Jun 26 '19 at 03:26
  • unplugging the st link and running this in atollic there does indeed to be a different error : Persistent Mode : Disabled Logging Level : 1 Listen Port Number : 61234 Status Refresh Delay : 15s Verbose Mode : Disabled SWD Debug : Enabled ST-Link enumeration failed Error in initializing ST-LINK device. Reason: ST-LINK DLL error. – Invic18 Jun 26 '19 at 03:28
  • I was also continuing to play around and got a more detailed error message : https://ibb.co/dM07GhY – Invic18 Jun 26 '19 at 04:12
  • in addition to above - for the heck of it I just plugged in my other micro-controller which is the particle electron board and it's behaving in the exact same manner equipped with the same errors.. – Invic18 Jun 26 '19 at 04:18

1 Answers1

0

FOUND IT! this is the most insidious thing ever but the pin out was WRONG on the cover! I will include the link here from the amazon review I bought the product from, but in case it gets removed or something.. take the cover off and actually look at the pin out!! the cover was not correct the swc had to be swapped with the swio.

https://www.amazon.ca/gp/product/B07F84DKMP/ref=ppx_yo_dt_b_asin_title_o05_s00?ie=UTF8&psc=1#customerReviews

Invic18
  • 23
  • 1
  • 7
  • These are a handy but rather dodgy "ownerless" product that comes in multiple versions with indeed at least two common pinouts. Further pretty much *all* of them have do not have the firmware driving what is brought to the connector as NRST, meaning that regardless of settings you are operating without a reset and so unable to recover from situations where you need that to wake up or to connect under reset. Best to make sure the reset on your target is manually accessible. Also beware they can randomly stop working; best to have a spare or an alternative on hand. – Chris Stratton Jun 28 '19 at 17:12
  • can you provide me with a better product that I may purchase ? – Invic18 Jun 28 '19 at 18:41
  • Though it has a less convenient form factor you could buy an actual stlink from ST micro (get it from a real distributor with a chain of custody, not an ecommerce site). Or you could use the one built into a discovery or nucleo board. Or you could just get a few spares from of this one. Or you could get a variety of aftermarket adapters, including legitimately open source ones. But if you buy an illegitimate knock off of a name brand product (vs a legit open source design or a genuine name brand one), you do don't really know what you are getting. – Chris Stratton Jun 28 '19 at 19:47