cancel
Showing results for 
Search instead for 
Did you mean: 

stlink virtual comm port example?

David Pekin
Senior
Posted on January 30, 2018 at 23:27

Hello. 

I was searching to find some example code showing the usage of the STLink Virtual comm port.  I couldn't find anything in the example projects (or was incompetent in my searching)...  I'd like to route printfs() to it for debugging. 

I'm also wondering if we could use it as a standard serial communication channel.  We're going to add RS-422 drivers and use a UART for the final product but I'd like to get a head start and was hoping to use the STLink to allow serial access prior to getting the H/W built.  

I've seen various threads on the forum of people having trouble w/ the STLink comm.  Does anyone have a simple example that works?   

Thanks!

1 ACCEPTED SOLUTION

Accepted Solutions
David Pekin
Senior
Posted on January 31, 2018 at 17:38

Thanks all!

View solution in original post

7 REPLIES 7
Jorge Calatayud Maeso
Associate II
Posted on January 31, 2018 at 00:08

Hi there, instead of using printfs i used uart transmitting, and getting the output from a COM port console.

Check this PDF:

https://drive.google.com/file/d/1Gb-a5WhrIFLIq3gKQSvVGM6xQdZJ9GSa/view?usp=sharing

 
Posted on January 31, 2018 at 03:13

The original post was too long to process during our migration. Please click on the provided URL to read the original post. https://st--c.eu10.content.force.com/sfc/dist/version/download/?oid=00Db0000000YtG6&ids=0680X000006I6so&d=%2Fa%2F0X0000000bxD%2FpXdVlpEl472EQwk3Ug5h5rclQAFrqGGgvIif7b3CGtQ&asPdf=false
Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..
Posted on January 31, 2018 at 03:25

The original post was too long to process during our migration. Please click on the provided URL to read the original post. https://st--c.eu10.content.force.com/sfc/dist/version/download/?oid=00Db0000000YtG6&ids=0680X000006I6ZJ&d=%2Fa%2F0X0000000bqs%2FKNADS3TtbXuLMvtC5q1rBN_Hpuo.Y6JpcbubwbZNnlM&asPdf=false
Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..
henry.dick
Senior II
Posted on January 31, 2018 at 04:05

you asked two questions:

1) how to communicate via vcp: you can simply use uart over whatever pins that go to the stlink, typically uart0 on most ST boards. here is a link to get you started: 

https://dannyelectronics.wordpress.com/2016/05/01/uart-debugging-over-st-link-v2-1/

 

2) how to use printf over uart: lots of tutorial on that, essentially you need to write a routine that transmit char over uart.

hope it helps.

Posted on January 31, 2018 at 04:22

Code posted but stuck in moderation.

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..
Posted on January 31, 2018 at 09:18

Is live now!

David Pekin
Senior
Posted on January 31, 2018 at 17:38

Thanks all!