- September 24, 2015 at 11:40 pm #50947
Hi. I’m trying to use the 4 exposed UART’s on the creator ci20 v2 board.
I got UART0 working fine.
After I removed the agetty service for ttys4, UART4 is working fine.
I can’t get either UART1 or UART3 to work on loopback.
I configure all of the Uarts as
ttys -F /dev/ttySx raw
ttys -F /dev/ttySx 9600
ttys -F /dev/ttySx -echo -echoe -echok
then I connect their respective rx pin to the tx pin and run.
cat /dev/ttySx &
echo “hello” > /devttySx
As I mentioned. I see the Hello using 0 and 4, but not 1 or 3.
Also I’ve tried doing a loopback on gpio
when I echo 1 > gpio[whatever the tx pin#is]
I read back a 1 when I cat gpio[whatever the rx pin#is]
So the hardware seems fine.
Is there some service hogging the uart’s I want?September 30, 2015 at 6:52 pm #50991
Welcome to the Creator forums.
pinmuxing would be the obvious culprit.
Are you using kernel 3.0.8 or 3.18?
In 3.18, I think the pinmux hasn’t been defined for UART 1
But UART3 should work. Unless u-boot is perhaps configuring uart0/uart4 correctly. And something is missing in the uart1/3 driver side..
Which brings the question again. which kernel are you working on?
ZubairLKSeptember 30, 2015 at 8:40 pm #50993
Thanks for the reply.
I believe I’m using the 3.18 kernel as this was with the Debian 8 2015-09-09 Beta image.
I will give UART3 another attempt to make certain.
I remember seeing, in the uboot code, setup for UART 0 & 4. Then some setup for UART 3 as JTAG.
I wondered if the JTAG could be preventing me from using the pins. I seem to remember that if the JTAG is enabled on the pic32, all pin remapping and control gets ignored on those pins. I wasn’t sure if it was the same for the JZ4780.October 2, 2015 at 5:20 pm #51017
I have got all of the UARTs working on the board, aside from UART 3 (more on that later).
I’ve made some changes to device tree, you can find the fix on this branch: https://github.com/HarveyHunt/CI20_linux/tree/ci20-v3.18-enable-uarts
You’ll need to recompile your kernel with my fix applied.
UART 3 is trickier as it is on the same pins as EJTAG. There are some GPIO registers in the SoC that need setting, most likely from U-BOOT. Unfortunately the UART 3 GPIO doesn’t come out on any other pins, so I can’t give you a workaround for it.
I’ll continue working on UART 3 and keep you posted. 🙂October 11, 2015 at 5:07 am #51163
Thank you very much for this effort.
I could definitely see not putting the uart3 changes in anything mainline.
The project I’m working on for my company would benefit from using all 4 even if sacrificing jtag abilities.
Though in the long run it would be temporary since part of this is to eliminate boards with low cost MCU’s with one SOC. This would of course free up the UARTS that were being used to talk to these boards.October 15, 2015 at 4:27 pm #51280
Good news – I have got UART3 working and also updated the eLinux wiki with the details.
The original patch I sent you has been merged into the Ci20 kernel , so will be included in the next image release. Until then, you’ll need to compile the kernel yourself, using the linked github repository.
The instructions for enabling UART3 are now on the wiki , you will need to recompile UBOOT. All of the steps are detailed on the eLinux page.
HarveyNovember 2, 2015 at 5:38 pm #51686
In my projects the UARTs working on the board, aside from UART 3.
According to me you need to recompile your kernel with my fix applied.
UART 3 is trickier as it is on the same pins as EJTAG. There are some GPIO registers in the SoC that need setting, most likely from U-BOOT.
Unfortunately the UART 3 GPIO doesn’t come out on any other pins, so I can’t give you a workaround for it.