2018-01-30 02:27 PM
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!
Solved! Go to Solution.
2018-01-31 08:38 AM
Thanks all!
2018-01-30 03:08 PM
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
2018-01-30 06:13 PM
2018-01-30 06:25 PM
2018-01-30 07:05 PM
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.
2018-01-30 07:22 PM
Code posted but stuck in moderation.
2018-01-31 01:18 AM
Is live now!
2018-01-31 08:38 AM
Thanks all!