0

I have an embedded Atmel ARM926 board that I created a usb serial ko to get data from an FTDI as USBtty0. This board also has a serial port DBGU which is used as the console terminal that normally runs at 230kb. When I config the USBtty0 port to the required 115kb, DBGU apparently changes to 115kb as well.

if( m_fdELMdev = open(m_ELMdevice, O_RDWR | O_NOCTTY )< 0)  
{//error
}
else
{
// Configure the port
tcgetattr(m_fdELMdev, &dev_settings);
dev_settings.c_cflag |= B115200;
cfmakeraw(&dev_settings);
 }

Can someone please tell me what I might be doing wrong? This is snippet of my devices.tab

/dev/tty         c     640     0     0        4      0       0      1      4
/dev/tty         c     640     0     0        5      0       -      -      -
/dev/ttyGS       c     640     0     0      252      0       -      -      -
/dev/ttyS        c     640     0     0        4     64       0      1      3
/dev/watchdog    c     640     0     0       10    130       -      -      -
/dev/zero        c     640     0     0        1      5       -      -      -
/dev/ttyACM0     c     640     0     0      166      0       -      -      -
/dev/ttyUSB0     c     640     0     0      188      0       -      -      -

Also, I occasionally see some 'Interrupted System Calls' from select. How do I need to handle these? Do I retry the select until I get some data? Then what if I never get any data?

enter code here
do
{
iret = select(m_fdELMdev + 1, &fdrefid, NULL, NULL, &porttime);
switch(iret)
{
case READ_TIMEOUT:
ierr = -1;
break;

case READ_ERROR:
g_dbg->debug("CACS_Elm327::Select error:%s (%d)\n",strerror(errno), errno);
ierr = -1; 
break;

default:
iret = read(m_fdELMdev, data, ilen);    
g_dbg->debug("CACS_Elm327::Readport_ELM:read %s %d\n", data, iret );
break;
}
}while((ierr == 0) && (iret<ilen) );      
dsolimano
  • 8,870
  • 3
  • 48
  • 63
  • Have you inspected the datasheet for that chip, so your sure the UARTs can run at independent speeds ? – nos Jun 16 '14 at 20:24
  • Just to clarify: DBGU is a UART on-board. ttyUSB0 is serial over USB from an FTDI chip. I do not have full source to rebuild the kernel. The ko is built using the correct source tree from kernel.org by building USB Serial and FTDI as kernel objects and loaded in that order at startup. – Steve Young Jun 17 '14 at 12:12
  • *"serial port DBGU which ... normally runs at 230kb"* -- The RomBOOT of an Atmel AT91SAM9 SoC initializes that port to 115200 baud. You had to change the baud rate somewhere to make a new "normal" value. *"When I config the USBtty0 port..."* -- You seem to have a problem using the correct device names. Your "configure the port" code is either incomplete or it's broken – sawdust Jun 18 '14 at 08:26

0 Answers0