Connect RTEMS with Arduino Serial Port

César Rodríguez Cerro ces.rodriguez.c at gmail.com
Tue Jul 25 12:02:47 UTC 2017


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

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);

printf("fd = %i\n",fd);

if(fd < 0){
           printf("CAN NOT OPEN SERIAL PORT\n");
   perror(fd);
   exit(-1);
        }

        .......

}

#define CONFIGURE_APPLICATION_NEEDS_CONSOLE_DRIVER
#define CONFIGURE_APPLICATION_NEEDS_CLOCK_DRIVER
#define CONFIGURE_MAXIMUM_POSIX_TIMERS    10
#define CONFIGURE_MAXIMUM_POSIX_THREADS                             10
#define CONFIGURE_MAXIMUM_POSIX_CONDITION_VARIABLES    10
#define CONFIGURE_MAXIMUM_POSIX_MUTEXES                             10
#define CONFIGURE_MAXIMUM_POSIX_QUEUED_SIGNALS            10
#define CONFIGURE_POSIX_INIT_THREAD_TABLE
#define CONFIGURE_INIT

#define CONFIGURE_LIBIO_MAXIMUM_FILE_DESCRIPTORS             10
#define CONFIGURE_NUMBER_OF_TERMIOS_PORTS                        10
#include <rtems/confdefs.h>

RTEMS can´t find Arduino´s Serial Port.

Please, could anyone help me? I´m starting with RTEMS.

Thanks in advance.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.rtems.org/pipermail/users/attachments/20170725/de2792db/attachment-0002.html>


More information about the users mailing list