Hello all, I have mini2440, which i am using for communication with a serial printer and serial cheque reader. I tried serial communication with my local machine using gtkterm, i can send data from mini2440 to my machine but can not send data from my machine to mini2440. I also tried hyperterminal but still same results. I am setting the baud rate using a c program and confirming it with another program, so baud rate might not be the problem. When i used the "echo <some_text> /dev/ttyS0" command from my machine to send data to serial port i received some data on /dev/ttySAC0 but only once or twice, it didn't show any data after that. I can send data to my machine though but not vice versa. Can anybody please suggest what could be problem with serial communication? Thanks, -sameer
Serial port trouble
Hello all, I have resolved the problem. It was just that i had to direct the kernel debugging messages to other port than /dev/ttySAC0. Now i can do the serial communication both ways :) Now i am using mini2440's ttySAC2 with a serial cheque reader but all i am receiving is some garbage data. Does anybody have any idea about this? I have checked it for different baud rates, parity bits, stop bits. Please help Regards, sameer
A few questions please. Would you mind explaining what are all the changes needed in order to switch the debug channel to ttySAC2 or the USB? Is it possible to do this in user mode or only by way of a kernel recompile. I need to use the RS232 channel for project control. After the change, will it still be possible to update the kernel using the standard tool? Is it possible to update the kernel using only the USB and maybe the Ethernet channel?
Hi Lalitha, You can change it in serial port settings, there is a dropdown list of baudrates or u can use any small c program to change baud rate. Regards, sameer
Hi sameer, I m trying to use UART0(on mini2440 board) for interfacing the ARM board and a motor drive controller. For the same i have written UART driver which will be used by my application to transmit n receive data. But I m facing problem in intializing the UART0(serial port). I m receiving garbage on the minicom wen i transmit some data thro my application. can u let me no wat is the possible solution to this. or do i have to use other serial ports available on the board bcoz UART0 is already being used by the kernel. eagerly waiting for the reply....
Hi sameer can please brief me about how u actuaaly directed the kernel debugging messages on other port. i think I m having the same problem. wen i send data to minicom I receive garabage on the terminal..dat probably i think is the kernel debugging message bcoz I m using UART0... It would be great of u if you can help me out as early as possible... Thanks Indrajeet
Hi all, Is it possible to create a communauty project to share knowledge on the serial cheque reader program for mini2440 ? Thanks
Hi Sameer, can you share your code which working fine... Actually I have tried using termios but read is getting blocked for carriage return in Canonical mode and time & character limitation in raw mode ... so please send me how did u achieve serial communication for arm9 board in Linux..
Hi all, have you solved the problem, I am also facing the same problem. my setup is below, serial motor controller from sparkfun (http://www.sparkfun.com/commerce/product_info.php?products_id=9571) mini2440 com2 port connectivity is below : com2 port- TX(pin 1) to motordriver -RX com2 port - RX(pin 2) to motordriver-TX I am using termios library & using ttySAC2 driver(/dev/ttySAC2). Actually there is no /dev/ttyS0-S2 in the /dev folder. So ttySAC0-2 is the driver- is that correct? I dont know whats wrong in the program/connectivity, motor is not controlled. program is below. can someone help? #include <stdio.h> #include <string.h> #include <unistd.h> #include <fcntl.h> #include <errno.h> #include <termios.h> int fd,fd1,fd2,fd3; int openport(void) { fd1=open("/dev/ttySAC2",O_RDWR|O_NOCTTY|O_NDELAY); if (fd1==-1) { perror("open_port: unable to open port /dev/ttySAC2\n"); return -1; } else { printf("open_port: succesfully open port /dev/ttySAC2\n"); fcntl(fd1,F_SETFL,0); return 1; } } void closeport(void) { close(fd1); } void configport(void) { struct termios options; tcgetattr(fd1,&options); cfsetispeed(&options,B115200); cfsetospeed(&options,B115200); options.c_cflag |= (CLOCAL | CREAD); tcsetattr(fd1,TCSANOW,&options); options.c_cflag &= ~CSIZE; options.c_cflag |= CS8; options.c_cflag &= ~ PARENB; options.c_cflag &= ~CSTOPB; options.c_cflag &= ~CSIZE; options.c_cflag |= CS8; options.c_iflag &= ~(IXON|IXOFF|IXANY); } void writeport(int k) { char i[4]; i[0]='1'; i[1]='f'; i[2]='9'; i[3]=13; //sprintf(i,"2f9",k); write(fd1,i,sizeof(i)); //sleep(1); } int main() { int aa, k=0; aa=openport(); configport(); while(1) { writeport(k++); } closeport(); return 1; } thanks suresh
suresh, I would recommend you attach you ARM9 board to a PC with a straight serial cable from your ttySac2 adapter. Make sure the receiving terminal (Hyperterminal for PC or minicom for Linux) is set to 115200bps (8-N-1). Send the command and see what you get. An important thing to remember is that the FriendlyARM is a DCE device (like a modem) whereas the PC is a DTE device. This means that the serial cable from the PC to the ARM board is a straight cable versus the normal PC to PC null modem (crossover) cable. Along the same lines, if you would normally use a straight cable to control a device from the PC, you will need a crossover cable to control the same device from your ARM board. In other words, the cable supplied by the ARM board will not work because this is a straight cable to communicate with a PC. Also, the cable that came with the motor controller, although it will work with the PC, will not work with the ARM board, because it is also most likely a straight cable (DTE-DCE). Basically, whatever cable you would normally use to talk to a device from the PC, you use the opposite for the ARM board. Also you can check fd1 in your code. If it returns -1, the port never opened. James ----------------- david, Any luck finding out how to move the debug data to another port? I don't think that sameer nalawade knows how to do this. He only found out that it had to be done. His solution was to switch to the ttySAC2 port as have the rest of us. James
It has been almost two years that the above problem appeared. Has anybody found any solution for above problem? I mean I would like to use my ttySAC0. :-)
I have found the answer. You can find a file called inittab. In this file there is a line: “ttySAC0::respawn:/sbin/getty -L 115200 ttySAC0 vt100” which uses ttySAC0. You can replace it with this: ttySAC1::respawn:/sbin/getty -L 115200 ttySAC1 vt100. (or ttySAC2 so on.) This solve the problem. You can check whether it works or not with the following simple script: #/bin/bash while true do read LINE < /dev/ttySAC0 echo $LINE done It works me fine. Good luck, David
If you run initV on your system, "/etc/inittab" controls the startup of the system and also define possible login consoles.