Tuesday, October 18, 2011

Getting UART 1, 2 and 3 to work in the IGEPv2


I had quite a struggle getting all three of the UARTs to work under linaro on my IGEPv2. I was originally using linaro-media-create to make my microSD card image. The problem is that this seems to use the linaro kernel, rather than the IGEP kernel. As such, I would recommend first following the steps on my previous post to get the IGEP kernel, with a linaro head on it. This will make getting all of the peripherals to work much easier.

Specifically, here is what I did to get UART 1, 2 and 3 working:


Add the following line to igep.ini. For a distribution running off an SD card, this is found in the 'boot' partition of the card.


This stops UART 1 being use for RS485 and makes it available to you on J960 at RS232 instead. Note that what is happening here, is that you are disabling RS485 converter, so the RS232 port will looking like it sort of works without it, but only in one direction.

For me, UART1 did not work after the following change, so I also had to follow the instructions in the hardware manual and execute the following commands from within the loaded operating system.

sudo su 
mount -t debugfs none /sys/kernel/debug
echo 0x007 > /sys/kernel/debug/omap_mux/uart1_rts 
echo 0x007 > /sys/kernel/debug/omap_mux/uart1_cts 

For me, the 'none' was already mounted, but it can't hurt to run it again.

Note that the above line 'sudo su' makes you the root user. To get back to being yourself, use 'su USERNAME', where USERNAME is the user you were logged on as.


Add the following lines to igep.ini.


This enables UART 2 over J990.


Comment out the following line in igep.ini by placing a semicolon before it.


This disables the serial debug output over UART3 on J960, and makes it available for use by you. This may not be needed, depending on which rootfs you are using. Try joining TX and RX together (pin 2 and 3 on J960). Then open /dev/ttyS2 (say using minicom) and copy and paste a big chunk of data into it. If the screen goes crazy, it is because you are not the only one using UART2, so you have to comment out the above line.

You should now have:

UART 1 over pin 8/9 of J960 at RS232 levels

UART 2 over pin 6/8 of J990 at 1V8 CMOS levels (DO NOT EXPOSE TO ABOVE 1V8!)

UART 3 over pin 2/3 of J960 at RS232 levels

No comments: