Connect RTEMS with Arduino Serial Port

César Rodríguez Cerro ces.rodriguez.c at gmail.com
Tue Jul 25 11:54:56 UTC 2017


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 stdio /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>


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

Thanks in advance.

-- 
*César Rodríguez Cerro (Ingeniería Informática Carlos III, Madrid)*
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.rtems.org/pipermail/users/attachments/20170725/de578a2b/attachment-0001.html>


More information about the users mailing list