LIME:Using gpio, UART2 , UART3 and UART4 with linux and C [partly solved]

Started by harob, March 16, 2014, 11:58:36 AM

Previous topic - Next topic

harob

Hello,


I'm starting with the A10 lime board with debian image from Olimex.

I've change the fex file as followed:

[uart_para2]
uart_used = 1
uart_port = 2
uart_type = 4
uart_tx = port:PI18<3><1><default><default>
uart_rx = port:PI19<3><1><default><default>
uart_rts = port:PI16<3><1><default><default>
uart_cts = port:PI17<3><1><default><default>

[uart_para3]
uart_used = 1
uart_port = 3
uart_type = 4
uart_tx = port:PG06<4><1><default><default>
uart_rx = port:PG07<4><1><default><default>
uart_rts = port:PG08<4><1><default><default>
uart_cts = port:PG09<4><1><default><default>

[uart_para4]
uart_used = 1
uart_port = 4
uart_type = 2
uart_tx = port:PG10<4><1><default><default>
uart_rx = port:PG11<4><1><default><default>


I have disabled the gpio pins:

[gpio_para]
gpio_used = 0
gpio_num = 75
gpio_pin_1 = port:PG00<0><default><default><default>
....

Then I've build a new script.bin with fex2bin.

After reboot I started following commands:

root@a10Lime:/home/olimex/test# echo "123456789" > /dev/ttyS0
root@a10Lime:/home/olimex/test# echo "123456789" > /dev/ttyS2
root@a10Lime:/home/olimex/test# echo "123456789" > /dev/ttyS3
root@a10Lime:/home/olimex/test# echo "123456789" > /dev/ttyS4
root@a10Lime:/home/olimex/test# cat /proc/tty/driver/serial
serinfo:1.0 driver revision:
0: uart:U6_16550A mmio:0x01C28000 irq:1 tx:4036 rx:0 RTS|DTR
1: uart:U6_16550A mmio:0x01C28800 irq:3 tx:0 rx:0
2: uart:U6_16550A mmio:0x01C28C00 irq:4 tx:11 rx:0
3: uart:U6_16550A mmio:0x01C29000 irq:17 tx:11 rx:0
4: uart:U6_16550A mmio:0x01C29400 irq:18 tx:11 rx:0


While UART1 was not configured,
ttyS1 is mapped to UART2, ttyS2 to UART3  and so on and dmesg does not show this mapping. ???


lsmod shows a gpio_sunxi module. Is there a library which can use this module to modify the gpio's in C and C++ ?

Thanks