ST-Link V2 Virtual COM Port Not Working - Page 1
Forum section: electronics / general

author: T3sl4co1l
author_rank: Super Contributor
timestamp: October 03, 2021, 11:24:59 am
content: Anyone had this? Windows 7, driver's installed, it's assigned a port number (as seen in Device Manager, show hidden devices) but doesn't show up (not present). Neither standalone ST-LINK dongle nor Discovery board work. Up to date drivers, and firmware (version V2J37S0).Tim

author: PKTKS
author_rank: Super Contributor
timestamp: October 03, 2021, 05:29:36 pm
content: Quote from: T3sl4co1l on October 03, 2021, 11:24:59 amFirst the 2 cents disclaimer:i do not use windooze for nothing these days..But i just follow the comedy show their shitty products provide...The folk here on this channel provides some interesting STM32 hints and tips..Reason some times i enjoy listening his ideas...One ancient one shows some bizarre tricks needed to workaround the buggy lib-usb in windooze...Fast forward to about 8minutes.Portugues (galicia style) spoken but youtube provides translation in english reasonable audible..About Maple and STM32 transition he has some interesting commentsPaul

author: T3sl4co1l
author_rank: Super Contributor
timestamp: October 03, 2021, 05:54:46 pm
content: It is not a libusb device.(I do have a libusb device, which works fine, namely via avrdude.)Tim

author: PKTKS
author_rank: Super Contributor
timestamp: October 03, 2021, 09:49:26 pm
content: Fast forward to about 13 minutes when he presents the solution by device itselfIt is written on the board.. and spokenIn case of trouble drop a note may i can translate the board to helpPaul

author: SiliconWizard
author_rank: Super Contributor
timestamp: October 03, 2021, 11:05:12 pm
content: What happens when you plug the dongle in? Does Windows enumerate it? Does it show a message about the device having malfunctioned?

author: T3sl4co1l
author_rank: Super Contributor
timestamp: October 04, 2021, 06:57:09 am
content: Quote from: PKTKS on October 03, 2021, 09:49:26 pmUnfortunately the translation doesn't cover onscreen content, and the CC translation is far too spotty to find something so specific. Could you summarize the video's situation and resolution?Quote from: SiliconWizard on October 03, 2021, 11:05:12 pmThe Link part works as normal. The VCOM doesn't seem to show up at all, like it's not enumerating it. I don't see anything about settings to activate it or anything, I assume it should Just Work(TM).Tim

author: PKTKS
author_rank: Super Contributor
timestamp: October 04, 2021, 08:53:57 am
content: Give me some hours i will see if i can post a suitable translation...

author: PKTKS
author_rank: Super Contributor
timestamp: October 04, 2021, 12:16:09 pm
content: I will not enter details on how to display SUBs (in particular the ASS style here)IN *NIX any decent player will open the SUB as long as it has the same name as the video selected.. VLC MPlayer and a dozen others..Hence you need to download the video locally (youtubedl) and do thatCode:ï»¿[Script Info]Title: MapleMiniHackScriptType: v4.00+WrapStyle: 0ScaledBorderAndShadow: yesYCbCr Matrix: TV.601PlayResX: 1280PlayResY: 720[V4+ Styles]Format: Name, Fontname, Fontsize, PrimaryColour, SecondaryColour, OutlineColour, BackColour, Bold, Italic, Underline, StrikeOut, ScaleX, ScaleY, Spacing, Angle, BorderStyle, Outline, Shadow, Alignment, MarginL, MarginR, MarginV, EncodingStyle: Default,Arial,20,&H00FFFFFF,&H000000FF,&H00000000,&H00000000,0,0,0,0,100,100,0,0,1,2,2,2,10,10,10,1Format: Layer, Start, End, Style, Name, MarginL, MarginR, MarginV, Effect, TextDialogue: 0,0:07:07.38,0:07:10.02,Default,,0,0,0,,{\fscx297\fscy246}... Arduino IDE installation ...Dialogue: 0,0:07:10.25,0:07:14.18,Default,,0,0,0,,{\fscx297\fscy246}....which is an important issue...\Nconsidering many could not install itDialogue: 0,0:07:14.18,0:07:16.18,Default,,0,0,0,,{\fscx297\fscy246}... and then I would like to consider....Dialogue: 0,0:07:16.18,0:07:18.18,Default,,0,0,0,,{\fscx297\fscy246} I would like to make a consideration...Dialogue: 0,0:07:18.18,0:07:24.01,Default,,0,0,0,,{\fscx297\fscy246}This type of installation considered hereDialogue: 0,0:07:24.01,0:07:26.01,Default,,0,0,0,,{\fscx297\fscy246}.. is more or less the standard default installation...Dialogue: 0,0:07:26.01,0:07:30.53,Default,,0,0,0,,{\fscx297\fscy246} but there are cases where you can buy a CHIP...Dialogue: 0,0:07:30.53,0:07:33.57,Default,,0,0,0,,{\fscx297\fscy246}that will be easier to install than this one here.Dialogue: 0,0:07:33.57,0:07:39.44,Default,,0,0,0,,{\fscx297\fscy246}Why? Because depending on the manufacturer it can have a different boot loaderDialogue: 0,0:07:39.56,0:07:48.00,Default,,0,0,0,,{\fscx297\fscy246}It happens, and I myself own an STM32 which did not required this.Dialogue: 0,0:07:48.00,0:07:51.92,Default,,0,0,0,,{\fscx297\fscy246}The button press procedure explained here will not be necessary...ok?Dialogue: 0,0:07:51.92,0:07:55.17,Default,,0,0,0,,{\fscx297\fscy246}Before starting, it is even noted here...Dialogue: 0,0:07:55.17,0:07:58.49,Default,,0,0,0,,{\fscx297\fscy246}Make sure that all drivers are installed...Dialogue: 0,0:07:58.49,0:08:04.29,Default,,0,0,0,,{\fscx297\fscy246}...and if not...we need to install the Serial Upload and DFU driversDialogue: 0,0:08:04.29,0:08:08.24,Default,,0,0,0,,{\fscx297\fscy246}Here I left the URL to Windows drivers installationDialogue: 0,0:08:08.24,0:08:15.40,Default,,0,0,0,,{\fscx297\fscy246}and here when you insert Maple Mini into USB....Dialogue: 0,0:08:15.40,0:08:18.38,Default,,0,0,0,,{\fscx297\fscy246}You should see Maple DFU here...Dialogue: 0,0:08:18.38,0:08:24.80,Default,,0,0,0,,{\fscx297\fscy246}So you open Device Manager and see device has been recognizedDialogue: 0,0:08:24.80,0:08:33.68,Default,,0,0,0,,{\fscx297\fscy246}I can tell just for Windows 10.. may be some odds are found on previous versions...Dialogue: 0,0:08:33.68,0:08:43.02,Default,,0,0,0,,{\fscx297\fscy246}More updated Windows versions can recognize a weider range of devicesDialogue: 0,0:08:43.02,0:08:45.97,Default,,0,0,0,,{\fscx297\fscy246}... and some devices are even built in pre installed. ok?Dialogue: 0,0:08:45.97,0:08:53.34,Default,,0,0,0,,{\fscx297\fscy246}Then we have a pitfall and lot of people make a mistake.. when you will compile Maple MiniDialogue: 0,0:08:53.34,0:09:09.88,Default,,0,0,0,,{\fscx297\fscy246}even though MapleMini comes from ST, it is kinda genetic brother of Arduino DueDialogue: 0,0:09:09.88,0:09:16.80,Default,,0,0,0,,{\fscx297\fscy246}Hence, you need here in Arduino IDE select DueDialogue: 0,0:09:16.88,0:09:28.20,Default,,0,0,0,,{\fscx297\fscy246}Select Board Manager, Select Due and make sure to install itDialogue: 0,0:09:28.20,0:09:37.02,Default,,0,0,0,,{\fscx297\fscy246}If you don't do this it will not work. This a very common mistake made by manyDialogue: 0,0:09:37.02,0:09:52.17,Default,,0,0,0,,{\fscx297\fscy246}It will not compile, gcc will only use the proper instruction set when it is installedDialogue: 0,0:09:52.17,0:10:03.42,Default,,0,0,0,,{\fscx297\fscy246}I know that for many this is overwhelming and some day I will explain the Arduino IDE under the hood detailsDialogue: 0,0:10:03.42,0:10:08.94,Default,,0,0,0,,{\fscx297\fscy246}We will speak the truth about Arduino IDE - not bad at all - just the factsDialogue: 0,0:10:08.94,0:10:15.17,Default,,0,0,0,,{\fscx297\fscy246}Arduino is gcc underneath and we are required to install Due.Dialogue: 0,0:10:15.17,0:10:17.17,Default,,0,0,0,,{\fscx297\fscy246}shall we continue...Dialogue: 0,0:10:17.17,0:10:44.20,Default,,0,0,0,,{\fscx297\fscy246}Acess Github download this file here and put it on this folderDialogue: 0,0:10:44.20,0:11:01.15,Default,,0,0,0,,{\fscx297\fscy246}Those who installed the IDE using MS defaults..should desinstall itDialogue: 0,0:11:01.15,0:11:16.50,Default,,0,0,0,,{\fscx297\fscy246}Because the folders used have unadequate properties, may cause issuesDialogue: 0,0:11:16.50,0:11:33.14,Default,,0,0,0,,{\fscx297\fscy246}The point is Arduino has it's own defaults and is better to use them than MS defaultsDialogue: 0,0:11:33.14,0:11:44.62,Default,,0,0,0,,{\fscx297\fscy246}Hence it is better to download and install it directly instead MS methodsDialogue: 0,0:11:44.62,0:11:55.85,Default,,0,0,0,,{\fscx297\fscy246}If needed we create a new STM32 folder and install it. No troubles.Dialogue: 0,0:11:55.85,0:12:07.48,Default,,0,0,0,,{\fscx297\fscy246}We get used to the folder Arduino hardware, like Heltek. WTF is Heltek?Dialogue: 0,0:12:07.48,0:12:18.42,Default,,0,0,0,,{\fscx297\fscy246}.. I have spoken about it in other videos.. so we create folders here and drop new hardware...Dialogue: 0,0:12:19.92,0:12:30.12,Default,,0,0,0,,{\fscx297\fscy246}Then we should restart the IDE and select MapleMini as shown hereDialogue: 0,0:12:30.12,0:12:37.98,Default,,0,0,0,,{\fscx297\fscy246}or others like ... blah blahhDialogue: 0,0:12:37.98,0:12:51.94,Default,,0,0,0,,{\fscx297\fscy246}then we adjust the parameters here...blah blah blahDialogue: 0,0:12:51.94,0:13:01.62,Default,,0,0,0,,{\fscx297\fscy246}so here you choose our board...Dialogue: 0,0:13:01.62,0:13:13.12,Default,,0,0,0,,{\fscx297\fscy246}Now we should talk about an issue - we live in an imperfect worldDialogue: 0,0:13:13.12,0:13:26.36,Default,,0,0,0,,{\fscx297\fscy246}If the MapleMini does not show up on the COM port you should do the followingDialogue: 0,0:13:26.36,0:13:38.92,Default,,0,0,0,,{\fscx297\fscy246}This issue is here because I received tons of this issue upon STM flashingDialogue: 0,0:13:38.92,0:13:54.62,Default,,0,0,0,,{\fscx297\fscy246}And to complicate further this issue appears on some chips but not others.Dialogue: 0,0:13:54.62,0:14:00.10,Default,,0,0,0,,{\fscx297\fscy246}But several batches purchased required this hack...Dialogue: 0,0:14:00.10,0:14:19.92,Default,,0,0,0,,{\fscx297\fscy246}Open a program sketch (any one fits even blink) then click upload WITHOUT even setting the COM portDialogue: 0,0:14:19.92,0:14:41.40,Default,,0,0,0,,{\fscx297\fscy246}Don't even bother .. and this messages should appear blah blahhDialogue: 0,0:14:41.40,0:14:52.38,Default,,0,0,0,,{\fscx297\fscy246}This would be done JUST A SINGLE TIME - not every timeDialogue: 0,0:14:52.38,0:15:04.82,Default,,0,0,0,,{\fscx297\fscy246}This board has 2 buttons - one is USERDialogue: 0,0:15:04.82,0:15:24.18,Default,,0,0,0,,{\fscx297\fscy246}If each fab respected the names... but sometimes they change names...Dialogue: 0,0:15:24.18,0:15:35.44,Default,,0,0,0,,{\fscx297\fscy246}But the button itself is the same across boards regardless names and I call the external USER and the other RESETDialogue: 0,0:15:35.44,0:15:45.30,Default,,0,0,0,,{\fscx297\fscy246}Then **WHILE** we are **LOADING** we hold USER button... this is the HACK!!!Dialogue: 0,0:15:45.30,0:15:59.55,Default,,0,0,0,,{\fscx297\fscy246}Important note in red - the USER button is used to initialize the board in proper modeDialogue: 0,0:15:59.55,0:16:07.75,Default,,0,0,0,,{\fscx297\fscy246}may be handy when installing drivers or on a complete freezed coreDialogue: 0,0:16:07.75,0:16:21.84,Default,,0,0,0,,{\fscx297\fscy246}After finishing this procedure we must press RESET and the COM port should appear as usual...Save the script as the same name of the video with ( .ass ) extension (substation subs)Did that in 10 minutes do not expect perfectionThe hack presented may worth the time wasted learning itPaul

author: T3sl4co1l
author_rank: Super Contributor
timestamp: October 04, 2021, 02:01:30 pm
content: Thanks, that was quite an effort!I don't see where he's doing anything that applies here though... it looks like he's working with a Maple board, using Arduino IDE or something like that? And you suppose the tools might be similar enough to ST-Link stuff that there's a procedure that might work?I don't need a DFU, that appears to be a USB bootloader thing. I guess that would be okay for updating the ST-Link, but I can already do that with the updater tool, at least with whatever firmware version it detects I should have. Maybe that's the problem, it doesn't know I can put a more functional version on here? (Can I?)The best I can figure right now, -- and I have no fucking clue how this isn't made clear anywhere in the documentation -- it seems that ONLY the ST-LINK V2.1, NOT the -A or -B, NOT the ST-LINK/V2 that's sold, NOT the STM32F429I-DISCO (but yes the -DISC1?), and probably so on with other boards (Nucleo etc.), support VCP and DFU (or some combination anyways). According to one hack, the difference is (also, apparently a couple pins got swapped around?) down to one singular character: the STM32F103C8T6 substituted by a STM32F103CBT6 (which happens to be double the Flash, a rather important difference).I'd understand if the random old "DISCO" board I have, doesn't support certain features, but I also have a brand new ST-LINK/V2,there isn't a /V2.1,and everyone seems to just be using whatever the new thing is that enables VCP. Which, somehow, isn't any of these things?Also the possibility that I'm trying too hard to avoid installing CubeIDE, and it Just Does Something Magical(TM) that happens to activate this functionality. I don't see any hint of that, no tools laying around to activate or serve or connect that up, even the incredibly terse (in comparison to most of the tools) CubeProgrammer_CLI doesn't seem to have any way to do that (but, god knows what kind of functionality is hidden inside that thing, maybe that's the trick after all).Tim

author: PKTKS
author_rank: Super Contributor
timestamp: October 04, 2021, 02:08:46 pm
content: Quote from: T3sl4co1l on October 04, 2021, 02:01:30 pmWelcome it just took me rough 10 minutes...He is using the so called BluePill generic vanilla STM32F103Using the arduino extensions for that board it is integrated along side all Atmel and etc others.Regarding the other comments I do use the ST-LIKN V2 clone using usb2ttl adapteron LINUX (STMVLINK works native on linux) (ST provide a UDEV script as well)Their comments hold as long as the chip refuses to enumerate..Regardingdon't needan alternate bootloader DFU this is not true..You do have an alternate method to upload a customized boot loader and Arduino IDE would not even bother to do that anymoreThere are 2 methods indeed.. STVLINK and SERIALthey differboth depend on the chip maker to be recognized though..Kinda adhoc thingthe HACK works and improve chances when chip is not enumerated by USB drivers..particular problem on windooze.. brain damaged products..Paul

author: Bassman59
author_rank: Super Contributor
timestamp: October 04, 2021, 04:57:58 pm
content: Quote from: PKTKS on October 03, 2021, 09:49:26 pmWho the hell wants to watch a video and wait for 13 minutes for what might be the solution?A web page one can scroll through is better in all respects: most of us can read faster than the person speaks on the video. We can print the relevant sections, or copy them to a text file.This fascination with everything being a YooToob video has to end.Yes, some things are best demonstrated with a video, like how to pull the side panel off of your car door to get to the window mechanism. But for the most part, gimme text and some useful screen shots or photos.

author: PKTKS
author_rank: Super Contributor
timestamp: October 04, 2021, 05:44:32 pm
content: indeed special long ones..But that was my best shot on this issue.. thanks to my memory..watched that months ago...The only other reference heard about this weird issue of NO COM PORT..is by not having the so called .INF windooze weirdos.On UNIX my STLINK clone works fine.Never failed using a USBtoTTL dongle.I have no other referencePaul

author: AndyC_772
author_rank: Super Contributor
timestamp: October 04, 2021, 06:06:37 pm
content: Just by way of a data point, though sadly, not a solution: I've been using the ST-Link V2 and various COM port adapters for years and, until I read this thread, had no idea at all that the ST-link itself could potentially support a virtual COM port.I think that means it's nothing specific to you or your PC, but maybe instead it's a feature that requires a driver to be explicitly installed - if, indeed, the V2 does actually support VCP.

author: T3sl4co1l
author_rank: Super Contributor
timestamp: October 04, 2021, 07:52:39 pm
content: I've certainly seen similar functionality before (i.e., in most relevant IDEs, getting a console along with your debug session), though those might be using ARM core debug/IO functions via SWD/JTAG, not a USART. But I noticed an example program using USART1 on this particular chip, which on this particular board, I noticed is routed to... the ST-LINK chip, almost as if... but wait, if it just......But no, it seems.But then why even bother!?There also seems to be a variant with RX/TX pins tossed into the 20-pin JTAG header (replacing a couple GNDs), but it also doesn't exist, or something.Tim

author: langwadt
author_rank: Super Contributor
timestamp: October 04, 2021, 10:11:27 pm
content: Quote from: T3sl4co1l on October 04, 2021, 07:52:39 pmthere's varius version of the software for stm32f103 that's used, the nucleo boards have swd +comport+mass storage, some are swd only and there is swd+comportwhen running the tool to update the software you can sometimes choose which on you want

author: Cerebus
author_rank: Super Contributor
timestamp: October 04, 2021, 11:27:22 pm
content: On ST-LINK/V2-B and later the virtual com port shows up on the host as a standard USB serial port (using the CDC USB profile). You shouldn't need a driver on any platform that supports the CDC serial port USB profile. And yes, the VCP is just a connection to a real pukka serial port on the MCU made via Tx and RX lines from the ST-LINK's own MCU.Also the ST-LINK/V2 shows up as a USB mass storage device on both ST-LINK/V2-A and ST-LINK/V2-B, you can program the part just by copying a file to the drive (again, no drivers needed).A useful document may be ST's Technical Note "TN1235 Overview of ST-LINK derivatives" to get to grips with which variant you are using.Also, ST provide the "STM32CubeProgrammer", a standalone application available for Linux, Mac, Win32 and Win64. What's useful here is that it will confirm that you can talk to the ST-LINK properly, find out what version you've got, and if necessary update the software on the ST-LINK.STM32 Cube Programmer here:https://www.st.com/en/development-tools/stm32cubeprog.html

author: AndyC_772
author_rank: Super Contributor
timestamp: October 05, 2021, 06:03:49 am
content: Quote from: Cerebus on October 04, 2021, 11:27:22 pmI thought that feature relied on a bootloader being installed in the target MCU? I've seen it on one or two Nucleo boards, but IIRC it stops working if the device is erased.

author: langwadt
author_rank: Super Contributor
timestamp: October 05, 2021, 09:03:13 am
content: Quote from: AndyC_772 on October 05, 2021, 06:03:49 amnope, dump a bin file on the drive and it programs the flash on the target via swd

author: T3sl4co1l
author_rank: Super Contributor
timestamp: October 05, 2021, 10:58:03 am
content: The trick is, the dev boards have two chips, one for LINK, one for target. So, if everything fits (and, it seems it doesn't sometimes, hence needing the 128k chip), the programmer can enumerate as a composite device with LINK, VCP and MSD functions. Pretty neat, almost feels too easy to reprogram that way honestly.And obviously, it takes some code to initialize and enumerate USB that way, and to implement the flashing function (which for the programmer, is SWD/JTAG/serial), so yeah, you need a bootloader to handle that with a single chip, but that is indeed a possible configuration.And it sounds like that's maybe the sort of configuration the above mentioned Maple device can use, so I can see the similarity.Tim

author: PKTKS
author_rank: Super Contributor
timestamp: October 05, 2021, 12:14:41 pm
content: Yes it does hold true..And you can get rid of that for Chips with such problem..The STMduino installation also provides a Github bootloader image repository.By following those steps you can install your own bootloader and never ever again will failPaul

author: Cerebus
author_rank: Super Contributor
timestamp: October 05, 2021, 01:40:25 pm
content: Quote from: AndyC_772 on October 05, 2021, 06:03:49 amNope, all part of the ST-LINK. It accesses the target MCU over the hardware debug interface so the target can be as blank as my expression when my other half asks if it was her or me who left the toilet roll in the holder with only 2 sheets left.

author: PKTKS
author_rank: Super Contributor
timestamp: October 08, 2021, 11:31:26 am
content: Fixed mistyped word on SUB translationNot Holtek ( iam a veteran) is Heltechttps://heltec.org/and can even be mistyped again.. in 2 secssorryPaul

author: DavidAlfa
author_rank: Super Contributor
timestamp: November 11, 2021, 05:52:48 pm
content: STlink v2 doesn't have serial port. Only v2.1.V2.1 uses 128KB stm32, while v2 uses 64KB only, so there wasn't enough space.Check the reported stlink version in stlink utility or similar.

author: PKTKS
author_rank: Super Contributor
timestamp: November 12, 2021, 05:02:10 pm
content: this folk also published a hack to workaround such odd error in windoooze...Never tried 'caus not using windooze w/my stlink..but the "solution" resembles the other..press reset push again.... etc etc..Paul