cancel
Showing results for 
Search instead for 
Did you mean: 

Nucleo F767 - Serial com. over virtual com port on Linux

Sebastian K.
Associate II
Posted on May 26, 2017 at 16:25

Hello,

I am having problems communicating with my NUCLEO-F767ZI board over the virtual COM port on Linux. The board uses USART3 to communicate via the ST-Link USB port with the PC.

The ST-Link connects fine to the PC on device /dev/ttyACM0 and I can program it fine. I can even mount its disk partition as a mass storage device.

I am using the re-routing of printf() to the USART interface to output debug text, as proposed in the ST examples, and this works fine on a Windows PC. On a Linux machine however, I don't get the output.

I have tried 'screen' to open a serial console, as well as an Arduino IDE serial console, no luck. I have added udev rules for the ST-Link device in /etc/udev to be able to access the device without being root. I can work with other, Arduino-compatible boards over the same /dev/ttyACM0 device just fine.

Does anyone have experience with these boards under Linux and can help me out? What am I missing here?

#serial-interface #nucleo-f767zi #linux

Note: this post was migrated and contained many threaded conversations, some content may be missing.
16 REPLIES 16
Posted on May 29, 2017 at 12:09

You could try to get hold of the Arduino serial terminal implementation (source code), perhaps it's helpful.

I never bothered to look into Arduino, and it's not soooo well received here in general.

Posted on May 29, 2017 at 20:35

Okay, I tried your code, but it doesn't seem to change anything either. Still can't get the slightest thing out of the F767's virtual com port. Thanks again for taking the time though.

Same with stty - tried to use it to set the corresponding port to raw, but receiving nothing, even with a simple 'cat /dev/ttyACM0'.

I looked at the Arduino implementation, but it goes really deep, beyond what I think I'm able to adapt. So I guess I will resort to using the ST-Link and making LEDs blink for debugging.

Posted on May 30, 2017 at 07:47

Have you checked the UART lines (TX) from the target to the ST-Link with a scope ?

You should see the serial traffic there.

I have not yet tested the VCP feature of the ST-Link V2.1 under Linux myself. Hope you can see the device at all (

lsusb

), and have proper user rights.

Posted on May 30, 2017 at 12:01

Is there any modem manager involved?

Sebastian K.
Associate II
Posted on May 31, 2017 at 20:12

Okay, I found out what the problem was. I had to include a file syscalls.c that declares an extern function that is used by printf(). I had it in my first project, but somehow forgot to carry it over to the new project. The code compiles and runs fine without it, it just doesn't work correctly. So it's actually not a Linux problem. With that compiled in I can see the outputs fine at least when I 'cat /dev/ttyACM0'.

Thanks again for everybody's suggestions!

Posted on June 01, 2017 at 08:29

Just to understand this correctly - this probably resulted in no serial output from the target at all.

In other words, the sender (your STM32 target) was mute.

Posted on June 01, 2017 at 13:56

Yes, that's what I figure. Somewhere in the code the string to be printed did not get carried through and thus did never reach the USART. It is the 'UART_printf' example that I used for this, but the one important additional file is somewhat hidden in a separate directory.