A13-SOM: move UART1 from PG03/PG04 to PE10/PE11

Started by ulink, October 03, 2014, 01:42:44 PM

Previous topic - Next topic

ulink

Tried to move UART1 TxD/RxD from PG03/PG04 to PE10/PE11 pins using script.fex.

TxD (PE10) works, but RxD (PE11) never receives a byte.

Maybe someone can try this on a A13-Olinuxino Board to ensure this is not a SOM layout bug?

Maybe this is a a sunxi serial driver bug or a A13 CPU bug?


Stinde

Any update on this?

I have board using A13-SOM PE10 and PE11 for UART1. TX works and RX doesn't.


sarietta

Also interested in the answer to this. I am having exactly the same problem. I have even hooked up a scope to ensure the RX pin is being written to, and it is. Something in the OS must be preventing it.

sarietta

Just a little bit more information to help sort this issue out.

On the A13 SoM, there are 4 header pins on the side opposite where the actual MCU is located. These are the standard UART pins you can connect a USB Serial Cable F to for a serial console to the A13. In the datasheet for the A13, these are pins PG03 and PG04. Connecting the Cable F works as expected. You can both transmit and receive data.

Using the same A13 SoM, according to the documentation (and I have verified this with a trace test), GPIO-1 pin 12 and pin 14 are connected to the A13's PE11 and PE10 pins respectively.

Consider the following script.fex (in /opt/sunxi-tools):


;[uart_para]
;uart_debug_port = 0
;uart_debug_tx = port:PG03<4><1><default><default>
;uart_debug_rx = port:PG04<4><1><default><default>
...

[uart_para1]
uart_used = 1
uart_port = 0
uart_type = 2
uart_tx = port:PE10<4><1><default><default>
uart_rx = port:PE11<4><1><default><default>
...


(Notice the ';' before those first few lines indicating they will be ignored)

Using this script.fex, one would assume that you could simply connect the Red wire of the Cable F to pin 12 of GPIO-1, connect Green to pin 10 of GPIO-1, and connect Blue to GND to achieve exactly the same result as if you connected them to the headers as discussed above.

However, this is NOT the case. When you boot the system, you can see output (via the TX -- pin 10 on GPIO-1), but you cannot send any commands to the system. If you simply move the RX connection from pin 12 of GPIO-1 to the RX pin of the header from the original connection described above, voila, it works again.

This is a very confounding issue. It seems like you can change the TX pin for UART1 but not the RX pin. Any help on this topic would be greatly appreciated.

JohnS

I believe there are other .fex files on the net so maybe try looking at those for ideas.

At a guess you're confusing the fex parser / kernel support code / driver.

The console output / dmesg may help with some clues, too, but if need be you can add more by using printk and rebuilding the kernel.

John

sarietta

I've solved the issue thanks to the sunxi IRC channel and the help of "Turl".

It turns out that in uboot PG04 is being set to the RX line for UART0, and the OS does not override that setting if you simply leave it out in the script.fex file. The solution is to explicitly disable PG04 once the system has booted:


$> /opt/sunxi-tools/pio -m "PG04<0><0><1>"


This will enable you to use PE11 as the RX line for UART0.  8)