Hello everybody!!

I have comunication problems with rt_com, My linux program writes in a
fifo, and
the module, read the fifo and sends with rt_com_write, but in the other
linux PC, with
miniterm appear nothing.

If I use miniterm in the two computers then is all Ok, 

In a Readme in rt_com coments is necesary do:  setserial /dev/ttyS1 uart
none,

If i do this, then miniterm doesn't work. 

I execute setserial /dev/ttyS1 uart none, before load rt_com module, i
check the fifo is Ok.

What is happing?

Can anyboy help me!

Thanks in advance!
------------------------------------------------------------
The rt_com_table in rt_com.c is:
#define RT_COM_CNT 0
struct rt_com_struct rt_com_table[ RT_COM_CNT ] =
{
        { 0, BASE_BAUD, 0x2f8, 3, STD_COM_FLAG, rt_com0_isr },
};  

the results of setserial /dev/ttyS1 (before setserial /dev/ttyS1 uart
none) are:
/dev/ttyS1, UART: unknown, Port: 0x02f8, IRQ: 3   

------------------------------------------------------------
The code of my module is :

#include <linux/config.h>
#include <linux/errno.h>
#include <linux/ioport.h>
#include <linux/kernel.h>
#include <linux/module.h>
#include <linux/version.h>

#include <rtl_conf.h>
#include <rtl_core.h>
#include <rtl_sync.h>
#include <rtl_fifo.h>
#include <rt_com.h>

static int _fifo_read  = 1;  /* default fifo used to read is 1 */
static int _port       = 0;

int read_handler(unsigned int fifo)
{
char c;
int err;

  err=rtf_get(_fifo_read,&c,1);
  if (err<0)
  {
    printk("read_handler: rtf_get error %d\n",err);
  }
  rt_com_write(_port,&c,1);
  return 0;
}

/* -------------------------------------------------- */
/* -                 init_module                    - */
/* -------------------------------------------------- */
int init_module( void )
{
int fifo_r;
int err;

  if( (fifo_r = rtf_create(_fifo_read,1000) ) <0)
  {
    printk("head: Error al crear la FIFO read,  error: %d\n",fifo_r);
    return -1;
  }

  /* when there is something in the fifo read, the read_handler is
executed*/
  if ( (err=rtf_create_handler(_fifo_read, &read_handler))<0)
  {
    rtf_destroy(_fifo_read);
    printk("head: Error al crear el handler,  error: %d\n",err);
    return -1;
  }

  /* configure /dev/ttyS1 port*/
  rt_com_setup(_port, 38400, RT_COM_PARITY_NONE, 1, 8);

  printk("head: Module head is loaded\n");
  return(0);
}

/* -------------------------------------------------- */
/* -                cleanup_module                  - */
/* -------------------------------------------------- */
void cleanup_module( void )
{
  rtf_destroy(_fifo_read);
}                                                     

--------------------------------------------------
And the linux program:

#include <unistd.h>
#include <stdio.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <fcntl.h>

int main()
{
int fd1;
unsigned char letra='1';
int err;

  fd1=open("/dev/rtf1",O_WRONLY);

  if (fd1!=0)
  {
    while(letra != '0')
    {
      printf("Write a char: (exit with: '0'):\n");
      letra=getchar();
      if((err=write(fd1,&letra,1))!=1)
      {
       // error
        printf("Error, %d\n",err);
      }

   }
  }
  return(0);
}
-- [rtl] ---
To unsubscribe:
echo "unsubscribe rtl" | mail [EMAIL PROTECTED] OR
echo "unsubscribe rtl <Your_email>" | mail [EMAIL PROTECTED]
---
For more information on Real-Time Linux see:
http://www.rtlinux.org/rtlinux/

Reply via email to