stlink-org/stlink

[doc] Provide access to the UART via virtual com port

srobertjames opened this issue · 10 comments

  • I made serious effort to avoid creating duplicate or nearly similar issue

In order to allow developers to isolate and target your respective issue, please take some time to select the check boxes below and fill out each of the following items appropriate to your specific request.

  • Programmer/board type: [V2-1] (e.g STLINK /V1, /V2, /V2-onboard, /V2-clone, /V3)
  • Operating system an version: [Linux Ubuntu] (e.g Linux, Windows)
  • stlink tools version and/or git commit hash: [v1.7.0] (e.g v1.6.1/git-d0416149)
  • stlink commandline tool name: [st-util] (e.g st-info, st-flash, st-trace, st-util)
  • Target chip (and board, if applicable): [STM32F446RE NUCLEO-F446] (e.g STM32F103C8T6 (NUCLEO-F103RB))

Is it possible to use st-link to access the virtual COM (serial) port provided by STLink? If so, how do I do that? I do not see any /dev/ttyS being created by st-util, and tio is not able to find it either.

No, this is currently not possible.

I see. What would be involved in implementing this? I may be able to help, but can find no docs on the ST-Link virtual com port implementation.

@srobertjames I found this link that may help. As far as I can see, there is no need for any specific implementation.

My personal two cents:

...so they tell you to uninstall modemmanager, which is almost always a good idea. But depending on your distro you won't have that problem anyway.
Imo, the more relevant hint hidden in that stackexcahnge was the fact that you need the USB ACM driver.

@neithernut Have you been able to test the latter? Does this likely provide a solution from your point of view?

@neithernut Have you been able to test the latter? Does this likely provide a solution from your point of view?

I've confirmed that, if I plug in my (dated) STM32F411 nucleo board, the device does show up (according to dmesg) with the USB ACM driver. I planned playing around with it a bit on the weekend. When I do, I'll report back here, maybe with proposed changes to documentation.

Update: got to play around with my board, and everything works just fine. The device pops up as /dev/ttyACM0 on my machine and at least 9600 8N1 works both ways (I used minicom and a simple toy example on the nucleo board).

But now I struggle a bit with where to put this information. Serial communication doesn't concern any of the tools provided in this repo. Maybe we could add some hints to doc/tutorial.md? Maybe a new file in doc/? Will users even look there?

@neithernut Thanks for the update. I'll think about how to deal with the documentation-related part soon.

@neithernut We can add a new section to our tutorial.md under "Solutions to common problems" and extend the title to "How-To's & Solutions to common problems" or anything alike. Could you knock-up a draft for such a section with your original thoughts?

You may also have a look at cutecom which might be a bit more attractive for some users.
For windows users I'd recommend to use Teraterm.

I've added a description to our project tutorial in order to resolve this issue which is now closed.