LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Hardware > Linux - Embedded & Single-board computer
User Name
Password
Linux - Embedded & Single-board computer This forum is for the discussion of Linux on both embedded devices and single-board computers (such as the Raspberry Pi, BeagleBoard and PandaBoard). Discussions involving Arduino, plug computers and other micro-controller like devices are also welcome.

Notices


Reply
  Search this Thread
Old 04-03-2013, 12:24 AM   #1
biyabani
Member
 
Registered: Mar 2013
Posts: 65

Rep: Reputation: Disabled
How to enable all(7) uarts on lpc3250 board


Hi,
I am working on LPC3250 board on linux(3.0.10) ubuntu(11.10).Basically only one UART1 has been enabled for BOOTING Process.But,In this board i want to use total 7 UARTS at a time.Then i need any special drivers for that or is it enough to enable the Standard UARTS(3,4,5,6) and HIGH SPEED UARTS(1,2,7) in menuconfig option of kernel?Please help me.

Thanks & Regards,

MOHAMMAD BIYABANI.
 
Old 04-03-2013, 05:31 PM   #2
suicidaleggroll
LQ Guru
 
Registered: Nov 2010
Location: Colorado
Distribution: OpenSUSE, CentOS
Posts: 5,573

Rep: Reputation: 2142Reputation: 2142Reputation: 2142Reputation: 2142Reputation: 2142Reputation: 2142Reputation: 2142Reputation: 2142Reputation: 2142Reputation: 2142Reputation: 2142
"enable" them for what?

I have no experience with that board, but if I had to guess I'd say that all of them are probably "enabled" already, you just need to start using them. One of them (UART1) has been confiscated by the bootloader, and is probably hosting a TTY for the OS as well, but once you're in the OS the other 6 should be available in /dev/ like normal.
 
Old 04-03-2013, 11:29 PM   #3
biyabani
Member
 
Registered: Mar 2013
Posts: 65

Original Poster
Rep: Reputation: Disabled
Thanks for reply sir,

By default UART1 is displaying the booting messages But,Actually i want to display the booting messages with all UARTS at a time for my project requirement. How can i get that? Is any UART drivers are required to display booting messages by using all UARTS? I was also tried to enable them for displaying booting messages by enabling Standard and high speed UARTs in MENUCONFIG option of kernel but i didnt got it.I hope you understand what i want do sir.

Thanks & Regards,

Md.Biyabani.
 
Old 04-04-2013, 06:51 AM   #4
biyabani
Member
 
Registered: Mar 2013
Posts: 65

Original Poster
Rep: Reputation: Disabled
sorry for asked unrelated questions.Actually i have gone through the Lpc3250 manual and in that he told that by UART1 only we can display Booting messages and we cant display the booting messages using other UARTS.Actually i want to ask the thing is how to send and recieve the data using other UARTS in Linux kernel. I have idea about KEIL in windows. Is there any tool to execute serial communication programs in linux kernel?

Thanks & Regards,

Md.Biyabani.
 
Old 04-04-2013, 10:27 AM   #5
suicidaleggroll
LQ Guru
 
Registered: Nov 2010
Location: Colorado
Distribution: OpenSUSE, CentOS
Posts: 5,573

Rep: Reputation: 2142Reputation: 2142Reputation: 2142Reputation: 2142Reputation: 2142Reputation: 2142Reputation: 2142Reputation: 2142Reputation: 2142Reputation: 2142Reputation: 2142
Lots of tools exist. The driver is built into the kernel, so you can open up the device and read and write to it using nearly any programming language you want.

You can even run something like this from the command line to dump a message out over the serial line:
Code:
stty -F /dev/ttyS2 115200 cs8 -cstopb -parenb
echo "goodbye cruel world" > /dev/ttyS2
 
Old 04-04-2013, 11:51 PM   #6
biyabani
Member
 
Registered: Mar 2013
Posts: 65

Original Poster
Rep: Reputation: Disabled
Hi sir,Thanks for reply.

I have followed the commands what did you said like below procedure

root@mohan:/home/mohan# stty -F /dev/ttyS2 115200 cs8 -cstopb -parenb
root@mohan:/home/mohan# echo "goodbye cruel world" > /dev/ttyS2

But how can i know whether data is transmitted or not? Where can i see the data which is to be transmitted?

Thanks & Regards,

MOHAMMAD BIYABANI
 
Old 04-05-2013, 04:45 PM   #7
suicidaleggroll
LQ Guru
 
Registered: Nov 2010
Location: Colorado
Distribution: OpenSUSE, CentOS
Posts: 5,573

Rep: Reputation: 2142Reputation: 2142Reputation: 2142Reputation: 2142Reputation: 2142Reputation: 2142Reputation: 2142Reputation: 2142Reputation: 2142Reputation: 2142Reputation: 2142
You would see the message on whatever device is attached to the other end of that serial connection, or you could hook up a logic analyzer to the Tx line to capture the message.
 
Old 04-05-2013, 08:37 PM   #8
theNbomr
LQ 5k Club
 
Registered: Aug 2005
Distribution: OpenSuse, Fedora, Redhat, Debian
Posts: 5,399
Blog Entries: 2

Rep: Reputation: 908Reputation: 908Reputation: 908Reputation: 908Reputation: 908Reputation: 908Reputation: 908Reputation: 908
Use a terminal emulator such as C-Kermit or minicom. On the serial interface connector, connect the Tx pin the the Rx pin. With that done, everything you type in your terminal emulator should be echoed back to the screen. This is the simplest test of a serial interface possible to perform without any test equipment. A scope on the Tx pin should show the serial output data. Continuously transmitting the 'U' character will send a nice square wave, since the bit pattern of 'U' is alternating 1 & 0.
--- rod.
 
Old 04-05-2013, 11:29 PM   #9
biyabani
Member
 
Registered: Mar 2013
Posts: 65

Original Poster
Rep: Reputation: Disabled
Thanks for reply.

I tested with another PC which is attached to the UART5 of my LPC3250 and i have make echo then the data is recieved at that PC hyperterminal. But if i perform same operation with other UARTs like 2,3,4,6,7 of my board, then nothing is displayed on another end of PC hyperterminal.What may be the problem actually?


Thanks & Regards,

MOHAMMAD BIYABANI

Last edited by biyabani; 04-05-2013 at 11:34 PM.
 
Old 04-06-2013, 11:18 AM   #10
theNbomr
LQ 5k Club
 
Registered: Aug 2005
Distribution: OpenSuse, Fedora, Redhat, Debian
Posts: 5,399
Blog Entries: 2

Rep: Reputation: 908Reputation: 908Reputation: 908Reputation: 908Reputation: 908Reputation: 908Reputation: 908Reputation: 908
All kinds of potential problems. If you first perform the loopback test like I suggested, we can at east start to narrow down the possibilities. What does the datasheet for your board say about the nature of the UARTs in the system? Do you have a kernel with the correct drivers built in, or with the correct loadable modules installed? If you try to communicate through the serial interface, you need to have all of the communications parameters set in accordance with the peer host settings. Have you confirmed that this has been correctly done? Many devices use non-standard wiring of their connectors in order to save connector real-estate. How have you confirmed that your serial connectors are correctly connected to the peer PC?

--- rod.
 
Old 04-08-2013, 02:26 AM   #11
biyabani
Member
 
Registered: Mar 2013
Posts: 65

Original Poster
Rep: Reputation: Disabled
Hi,

The Datasheet states that we can load the loaders like kickstart and Stage1 using UART5 and we can boot the kernel messages using UART1 and it is not mentioned anything about other UARTs whether they are used for load and displaying purpose or not. I didnot performed loopback test but i am sure that all UARTs working properly in windows with KEIL but problem is when i am checking in LINUX KERNEL 2.6.34 version (I was installed this version on my host PC).is this version contains all UARTS drivers or not?If this version dont have all UART drivers then how can we install other drivers? If you idea please post the reply. I am waiting for reply.

Thanks & Regards,

MOHAMMAD BIYABANI
 
Old 04-08-2013, 09:44 AM   #12
theNbomr
LQ 5k Club
 
Registered: Aug 2005
Distribution: OpenSuse, Fedora, Redhat, Debian
Posts: 5,399
Blog Entries: 2

Rep: Reputation: 908Reputation: 908Reputation: 908Reputation: 908Reputation: 908Reputation: 908Reputation: 908Reputation: 908
Quote:
Originally Posted by biyabani View Post
Hi,

The Datasheet states that we can load the loaders like kickstart and Stage1 using UART5 and we can boot the kernel messages using UART1 and it is not mentioned anything about other UARTs whether they are used for load and displaying purpose or not. I didnot performed loopback test but i am sure that all UARTs working properly in windows with KEIL but problem is when i am checking in LINUX KERNEL 2.6.34 version (I was installed this version on my host PC).is this version contains all UARTS drivers or not?If this version dont have all UART drivers then how can we install other drivers? If you idea please post the reply. I am waiting for reply.

Thanks & Regards,

MOHAMMAD BIYABANI
The kernel uses one and only one UART for it's default console. I have never heard of having multiple kernel consoles running concurrently, and don't see this being any kind of standard that the kernel could accommodate without modification. The kernel can be told by the bootloader which serial port to use as the console, and there is probably a built in default that is used in the absence of any specified console.
How is it that you are sure that all UART's are working, by doing some kind of test from a completely different host? They may well be working, but without actually exercising them, you are only assuming that. Simply running a similar kernel version on some other hardware tells you absolutely nothing whatsoever. The driver(s) for the UARTs depends on the type of hardware that implements the UART. Without knowing the nature of that hardware, it is impossible to know whether the drivers are installed, or even exist at all. There are many kinds of UARTs, and on small ARM systems, it is not uncommon for there to be custom UART implementations done in on-board FPGAs. In that case, only the vendor knows for sure how to interface to them, and this should be documented.

I suggest a Google search for 'Linux serial console' as a jumping off point for further research. It will undoubtedly turn up a link to the Linux Serial Console HOWTO, among others.

--- rod.
 
Old 04-09-2013, 02:28 AM   #13
biyabani
Member
 
Registered: Mar 2013
Posts: 65

Original Poster
Rep: Reputation: Disabled
Thanks for reply sir,

Today i have tested my board with loopback method(i connected TX to RX of UARTs) when i enter the characters on keyboard using UART5 and UART2 but nothing displayed on console(i used minicom program)linux os. I was checked my code which is dumping into my board that contains all code related to UARTs. And i also cheched my linux kernel that also contains the TTY drivers. can i confirm that fault in hardware or we need any extra drivers for serial communication?

Thanks & Regards,

MOHAMMAD BIYABANI.

Last edited by biyabani; 04-09-2013 at 02:32 AM.
 
Old 04-09-2013, 10:35 AM   #14
theNbomr
LQ 5k Club
 
Registered: Aug 2005
Distribution: OpenSuse, Fedora, Redhat, Debian
Posts: 5,399
Blog Entries: 2

Rep: Reputation: 908Reputation: 908Reputation: 908Reputation: 908Reputation: 908Reputation: 908Reputation: 908Reputation: 908
If the loopback test fails, then either the drivers are not loaded (but this is probably not the case),the hardware is faulty, or your port require some related handshake pins to be enabled, such as CTS. On boot (or with dmesg), do you see log entries that show successful loading of drivers for all ports? you say you've found drivers built into your kernel, but have you verified that they are actually the correct drivers? Are you sure you're using device names correctly associated with the respective UARTS (e.g. /dev/ttySx)? When you run setserial against each serial port, what are the results? Are you certain that you've connected the proper port pins in the loopback test?

Since you're now talking about your own code, here are some links to augment your understanding of matters related to that. Also, a link to a superior IMHO serial communications package.

Serial Programming
Serial-Howto
Serial Programming Howto
Serial Programming Guide for POSIX OS's

C-Kermit
C-Kermit

--- rod.

Last edited by theNbomr; 04-09-2013 at 10:54 AM.
 
Old 04-10-2013, 12:13 AM   #15
biyabani
Member
 
Registered: Mar 2013
Posts: 65

Original Poster
Rep: Reputation: Disabled
Hi sir,
1.MY console displaying messages about serial ports at the time of booting in linux(minicom)

Serial: 8250/16550 driver, 4 ports, IRQ sharing disabled
serial8250.0: ttyS0 at MMIO 0x40090000 (irq = 9) is a 16550A
serial8250.0: ttyS1 at MMIO 0x40080000 (irq = 7) is a 16550A
serial8250.0: ttyS2 at MMIO 0x40088000 (irq = 8) is a 16550A
serial8250.0: ttyS3 at MMIO 0x40098000 (irq = 10) is a 16550A
lpc32xx_hsuart.0: ttyTX0 at MMIO 0x40014000 (irq = 26) is a lpc32xx_hsuart
console [ttyTX0] enabled
lpc32xx_hsuart.0: ttyTX1 at MMIO 0x40018000 (irq = 25) is a lpc32xx_hsuart
lpc32xx_hsuart.0: ttyTX2 at MMIO 0x4001c000 (irq = 24) is a lpc32xx_hsuart
brd: module loaded
loop: module loaded

2.In application the drivers i have are (in linux after booting)

~ # ls
bin etc home linuxrc sbin usr
dev ftp lib proc tmp var
~ # cd dev/
/dev # ls
console mtd0 mtdr10 ptypf
fb mtd1 mtdr11 ram
fb0 mtd10 mtdr12 ram0
flash_environment mtd11 mtdr13 ram1
flash_kernel mtd12 mtdr14 rtc
flash_monitor mtd13 mtdr15 tty
flash_reserved mtd14 mtdr16 tty0
flasha mtd15 mtdr2 tty1
flasha1 mtd16 mtdr3 tty2
flasha2 mtd2 mtdr4 tty3
flasha3 mtd3 mtdr5 ttyCPM0
flasha4 mtd4 mtdr6 ttyCPM1
flasha5 mtd5 mtdr7 ttyCPM2
flasha6 mtd6 mtdr8 ttyCPM3
flasha7 mtd7 mtdr9 ttyCPM4
flashb mtd8 nftla ttyCPM5
flashb1 mtd9 nftla1 ttyS0
flashb2 mtdblock0 nftla2 ttyS1
flashb3 mtdblock1 nftla3 ttyS2
flashb4 mtdblock10 nftla4 ttyS3
flashb5 mtdblock11 nftla5 ttyS4
flashb6 mtdblock12 nftla6 ttyS5
flashb7 mtdblock13 nftla7 ttyS6
full mtdblock14 nftlb ttyS7
hda mtdblock15 nftlb1 ttyp0
hda1 mtdblock16 nftlb2 ttyp1
hda10 mtdblock2 nftlb3 ttyp2
hda11 mtdblock3 nftlb4 ttyp3
hda12 mtdblock4 null ttyp4
hda13 mtdblock5 ptyp0 ttyp5
hda14 mtdblock6 ptyp1 ttyp6
hda15 mtdblock7 ptyp2 ttyp7
hda16 mtdblock8 ptyp3 ttyp8
hda2 mtdblock9 ptyp4 ttyp9
hda3 mtdchar0 ptyp5 ttypa
hda4 mtdchar1 ptyp6 ttypb
hda5 mtdchar2 ptyp7 ttypc
hda6 mtdchar3 ptyp8 ttypd
hda7 mtdchar4 ptyp9 ttype
hda8 mtdchar5 ptypa ttypf
hda9 mtdchar6 ptypb zero
kmem mtdchar7 ptypc
mem mtdr0 ptypd
mouse mtdr1 ptype

3.If i perform setserial then output is as follows (in linux terminal)
root@mohan:/home/mohan# setserial -g /dev/ttyS[0123]
/dev/ttyS0, UART: 16550A, Port: 0x03f8, IRQ: 4
/dev/ttyS1, UART: unknown, Port: 0x02f8, IRQ: 3
/dev/ttyS2, UART: unknown, Port: 0x03e8, IRQ: 4
/dev/ttyS3, UART: unknown, Port: 0x02e8, IRQ: 3

and i tested the all UARTS in windows without loopback that means normal data transmitting and recieving then i observed that all ports are working.

are these drivers and settings fine?


Thanks & Regards,

MOHAMMAD BIYABANI.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Mounting usb in lpc3250 board (ported with linux version 2.6.34) biyabani Linux - Newbie 8 04-09-2013 06:39 AM
How to execute the compiled snmp files on lpc3250 board with linux ubuntu host biyabani Linux - Newbie 2 04-03-2013 11:34 PM
How to execute the compiled snmp files on lpc3250 board with linux ubuntu host biyabani Linux - Newbie 1 04-02-2013 06:29 AM
Linux kernel debugging on ARM9 LPC3250 Raydan Linux - Embedded & Single-board computer 1 08-11-2009 10:08 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Hardware > Linux - Embedded & Single-board computer

All times are GMT -5. The time now is 08:12 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration