I noticed that when trying to turn on the UART4 TX (PG10 / GPIO1 25), its voltage is 0.5V, instead of the 3.3V I see on other pins. Does anyone else have this issue ?
I am using the following code
# GPIO Control
from pyA20Lime2.gpio import gpio
from pyA20Lime2.gpio import port
from pyA20Lime2.gpio import connector
de = port.PC20
re = port.PC19
tx = port.PG10
rx = port.PG11
gpio.setcfg(de, 1) # 0 is INPUT, 1 is OUTPUT.
gpio.output(tx, 1) # 0 is LOW, 1 is HIGH.
How do you use it? Have you noticed this: https://pypi.org/project/pyA20Lime2/ ?
I don't understand the question as I am using the library from the link.
It also works fine when I put the TX pin to LOW, its voltage is 0v.
I had a similar problem with the A20-SOM204 which turned out to be a regulator not enabled that supplied the A20's ball E18 "VCC_CSI1/VCC-PG" which resulted in very low voltage levels on port G.
The fix was a change in the device tree that I pointed to in that message. Edit the device tree source of the board and add a "regulator-always-on;" clause to ®_ldo4, then recompile the device tree, back up the original, and replace the one in your /boot/dtb directory.
Probably easier, if you're using Armbian and have a working armbian-add-overlay command, is to just use this Device tree source file:
compatible = "allwinner,sun7i-a20";
target = <®_ldo4>;
Save that to a file such as "ldo4-always-on.dts" and use "armbian-add-overlay ldo4-always-on.dts" to compile it and add it to the U-Boot config file (/boot/armbianEnv.txt, the overlay would compile as /boot/overlay-user/ldo4-always-on.dts). Getting the armbian-add-overlay command to work has been a little tricky in my experience due to a kernel headers issue and a wrong version of the device tree compiler that doesn't support symbols (-@ flag). You may need to play with it a bit. That tells the AXP204 to enable 3.3V to the LDO4_3.3V power net and this supplies Port G.
Thanks, it worked like a charm. To be honest I would never have thought about this...
Note: for now, on Debian, the dtc version in the stable repos cannot compile symbols, so I add to get the latest version from the test repos.