2017-05-26 07:25 AM
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.2017-05-29 05:09 AM
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.
2017-05-29 01:35 PM
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.
2017-05-30 12:47 AM
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.2017-05-30 05:01 AM
Is there any modem manager involved?
2017-05-31 11:12 AM
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!
2017-06-01 01:29 AM
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.
2017-06-01 06:56 AM
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.