RSS YouTube LinkedIn Twitter XCore IRC

Search

Projects Forum

Enter your XCore Exchange username.
Enter the password that accompanies your username.

Forgot your password?

Sign up for an account

Things to do: Search all projects, Create a project

PC UART Listener (Linux)

by snowman

  • Status: Just an idea
  • Downloads: 71
  • Licence: BSD
  • Last updated: 16/Jul/2010 at 04:11 PM
  • Sponsors:
  • Wiki entry: View project wiki entry

Version 1

Size: 10.50kb

View older versions

Project Overview

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.

Verified to run on

Images and diagrams

Rate this project


5
Average: 5 (2 votes)
Your rating: None

Share this project!

Twitter Icon Share on Twitter

Twitter Icon Share on Facebook

submit to reddit Share on Reddit

Comments / Updates

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.

X
X