Accessing serial ports on Coldfire
chrisj at rtems.org
Fri Oct 2 03:34:59 UTC 2009
Andrei Chichak wrote:
> Okay, I don't seem to be understanding something very basic.
> Do you mean checking the /dev directory on my embedded system?
> If so, I've missed the big pink elephant in the room. How do I fire up a
> shell? I thought that I fire up processes and send messages.
The header file shell.h has the interface. You can fire up a shell with
printf ("Starting shell....\n\n");
sc = rtems_shell_init ("fstst", 60 * 1024, 150,
"/dev/console", 0, 1, NULL);
if (sc != RTEMS_SUCCESSFUL)
printf ("error: starting shell: %s (%d)\n",
rtems_status_text (sc), sc);
The shell is only to provide an 'ls' command to find the names of the
device nodes for your BSP. You could write code to readdir the /dev
directory and print the contents rather than use the shell.
My Coldfire target is currently not running so I cannot provide what I
have on the 5235 BSP.
The UART driver normally creates a /dev device node in the IMFS file
system so the code following can work in a standard manner:
struct termios term;
int uart = open ("/dev/uart1", O_RDWR);
if (tcgetattr(uart, &term) < 0)
printf ("error: cannot get terminal attributes: %s\n",
cfsetispeed (&term, B38400);
cfsetospeed (&term, B38400);
if (tcsetattr (uart, TCSADRAIN, &term) < 0)
printf ("error: cannot set terminal attributes: %s\n",
More information about the users