0
edits
Changes
no edit summary
= Overview =
<section begin=overview />
This How-To is meant to be a starting point for people to learn use UART for IGEP devices as quickly and easily as possible. In this How-To, we use [http://labs.isee.biz/index.php/Pre-installed_software_on_IGEP_Processor_Boards IGEP Firmware] and a program that use UART peripherals. This How-To was tested in:
*[[IGEP firmware Yocto|IGEP firmware Yocto]] and [[Linux_Kernel_2.6.37.y|Kernel 2.6.37.y]] with IGEPv2.
=== Configure UART1 and UART3 in IGEP with RS232 levels on J960 connector = Edit igep.ini file ====
To test UARTs we use UART1 (dev/ttyO0) and UART3 (dev/ttyO2) via J960 connector using RS232 standard.
<pre>;console=ttyO2,115200n8
;console=ttyO</pre>
==== Edit inittab file ====
Getty program uses /dev/ttyO2 in IGEP Firmware, disable it modifying /etc/inittab file:
*Comment next line:
<pre> #S:2345:respawn:/sbin/getty 115200 ttyO2</pre>
=== Check UARTs devices ===
=== Send some data ===
Use minicom microcom to prove it, open two terminals via SSH and log with root user:
Terminal 1:
Terminal 2:
<pre>microcom /dev/ttyO2 </pre>
Type something in one terminal. {| cellspacing="1" cellpadding="1" width="200" border="1" align="center"|-| style="text-align: left;" | [[Image:Minicom screenshot.png|640x400px]]|}
= Schematics =
= Compile and run program =
Download [http://labs.isee.biz/images/e/eeindex.php/File:Uart-test-beta22-beta1.tar.bz2 program source]and extract it. As explained above, Before compiling the program uses GPIO for debug option via oscilloscope, it is necessary install user-gpio-drv.ko driver inside Linux Kernel, more information [[How to use GPIOs|here]] . There there are some interesting things to configure, before compiling the program. Open it, program and seek next lines:
<pre>//Define Array char size
#define SIZE 30
//Define Debug mode:0==Disable
#define DEBUG 0
//Set GPIO Debugger port
//Be sure that mux is correctly configured and GPIOs are not used
#define GPIO1 136158#define GPIO2 137 162</pre> Constant SIZE: it determines the max number of char than chars sended. Constant DEBUG: it can be sent<br> break program infinite loop part, useful to debug errors: 0 (infinite loop) or positive number determines loop max entrances.
Constant DEBUGWAIT: it can break program infinite loop part, it can be useful to debug some errors, 0 (infinite loop) or positive number determine loop configures select max entrances time in seconds.
= Testing UART =