Connect RTEMS with Arduino Serial Port

Chris Johns chrisj at rtems.org
Tue Jul 25 23:22:55 UTC 2017


On 25/07/2017 22:02, César Rodríguez Cerro wrote:
> 
> Sorry, I´ve made some changes.
> 
> Hi everyone,
> 
> I built RTEMS in Ubuntu for a pc386 bsp with POSIX. I´m trying to connect RTEMS
> with Arduino Serial Port and then emulate it with Qemu.
> 
> Here is my code:
> 
> Qemu command line:
> 
> sudo qemu-system-i386 -serial /dev/ttyACM0 -hda controladorA 
> 

Is '/dev/ttyACM0' a device on your host?

> myProgram.c
> 
> #include <pthread.h>
> #include <signal.h>
> #include <stdio.h>
> #include <string.h>
> #include <unistd.h>
> #include "displayA.h"
> 
> #include <time.h>
> #include <sched.h>
> #include <bsp.h>
> #include <stdlib.h>
> 
> #include <uart.h>
> #include <termios.h>
> #include <rtems.h>
> #include <rtems/libio.h>
> #include <rtems/console.h>
> 
> #include <fcntl.h>
> #include <sys/types.h>
> #include <sys/stat.h>
> 
> int *POSIX_Init()
> {
> 
> int fd = open("/dev/ttyACM0",O_RDONLY);

The serial devices on the PC BSP are '/dev/com1', '/dev/com2', etc for legacy
serial ports and '/dev/pcicom1' and so on for PCI UART boards.

The source references are:

https://git.rtems.org/rtems/tree/c/src/lib/libbsp/i386/pc386/console/conscfg.c
https://git.rtems.org/rtems/tree/c/src/lib/libbsp/i386/pc386/console/uart_bus_pci.c#n387

Chris



More information about the users mailing list