Projects Forum
Download latest build of this project:
Size: 10.50kb
| Revision | Operations | |
|---|---|---|
| 16/07/2010 - 16:11 by snowman | current revision | |
Description:
This program is a Linux shell script will listen on a UART device (configured as default 115200/n/8/1) on a Linux machine.
See also PC UART Listener (Windows), which is a C program for Windows of equivalent functionality.
Usage:
$ ./xrun.sh test.xe
$ ./PollConsole.sh
Using default /dev/ttyUSB1
Polling every 1 sec
Console open
foo
foo
.
.
The "foo" lines come from the test.xe program.
FTDI UART is supported on Linux via the ftdi_sio kernel module. When properly detected, the FTDI chip appears as:
/dev/ttyUSB0 and /dev/ttyUSB1
Unfortunately each time xgdb accesses FTDI, these devices disappear. This means that with a third party RS232 console programme like GTKterm, you will lose connection each time xrun is called.
When it happens, the connection must be restored. GTKterm needs to reopen the port via the GUI or one can use modprobe:
sudo modprobe -r ftdi_sio && sudo modprobe ftdi_sio
i.e. restart ftdi_sio.
This is a known issue with the FTDI drivers and we have filed support requests with FTDI on it. Inside XMOS, we either debug in Windows (using virtual COM ports), or restart ftdi_sio after each xrun:
xrun program.xe && sudo modprobe -r ftdi_sio && modprobe ftdi_sio
This is exactly what the xrun.sh script does.
The PollConsole.sh script polls the /dev/ttyUSB1 device (or any other specified) and displays output when ready.

So does the script poll after
So does the script poll after it looses connection?
Fantastic
Thanks Larry, much appreciated!
For those on Linux who wanna use their XC-1A kits, this is very useful.