Olimex Support Forum

OLinuXino Android / Linux boards and System On Modules => A20 => Topic started by: jonas.dorel on February 06, 2019, 09:09:54 PM

Title: 0.5V on PG10
Post by: jonas.dorel on February 06, 2019, 09:09:54 PM
Hi,
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

gpio.init()

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.
Title: Re: 0.5V on PG10
Post by: LubOlimex on February 06, 2019, 09:45:28 PM
How do you use it? Have you noticed this: https://pypi.org/project/pyA20Lime2/ ?
Title: Re: 0.5V on PG10
Post by: jonas.dorel on February 08, 2019, 11:50:21 AM
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.
Title: Re: 0.5V on PG10
Post by: Jonathan Fether on February 13, 2019, 05:10:03 AM
Hello Jonas,

   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.

https://www.olimex.com/forum/index.php?topic=6688.msg26117#msg26117

   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 &reg_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:


/dts-v1/;
/plugin/;

/ {
    compatible = "allwinner,sun7i-a20";

    fragment@0 {
        target = <&reg_ldo4>;
        __overlay__ {
            regulator-always-on;
        };
    };
};


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.

Best regards,
-Jon
Title: Re: 0.5V on PG10
Post by: jonas.dorel on February 14, 2019, 04:11:57 PM
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.