VIM3 Cannot Access Physical Pins 22,23 (A15,A14) Ubuntu 22.04

Which Khadas SBC do you use?

VIM3 Basic

Which system do you use? Android, Ubuntu, OOWOW or others?

Ubuntu 22.04

Which version of system do you use? Khadas official images, self built images, or others?

Official vim3-ubuntu-22.04-server-linux-5.15-fenix-1.6.3-240112-emmc.img

Please describe your issue below:

I had some software running on 20.04 which changed the state of the GPIO physical 22 and 23. The software now does not work when the OS has been upgraded to 22.04.

  • The pins cannot be accessed via wiringpi

  • The pins cannot be exported using: echo 491 | sudo tee /sys/class/gpio/export
    491
    tee: /sys/class/gpio/export: Invalid argument

meson-g12a-pinctrl pinctrl@ff634480: pin GPIOX_15 already requested by ffd24000.serial; cannot claim for periphs-banks:491

This indicates that UART3 is using the pins, however I don’t have any overlays in /boot/dtb/amlogic/kvim3.dtb.overlay.env

  • I tried to create a device tree overlay called disable_uart3:
    /dts-v1/;
    /plugin/;

/ {
fragment@0 {
target = <&uart_C>;

	__overlay__ {
		status = "disabled";
	};
};

};
However adding this did not work either.

How can this be fixed?

Post a console log of your issue below:

Go back to the older version OS
or
Reconfigure the kernel to allow sys access to the ports, sys has been deprecated.
or

$sudo apt install gpiod libgpiod-dev libgpiod-doc

Then

$sudo gpioinfo

check

$groups

You should be a member of gpio
if not:

sudo usermod -aG gpio <your username>
1 Like

Hello @Ingeniero

@ivan.li will help you then.

Hello @Ingeniero
1.Create a device tree overlay to disable i2c3.

   /dts-v1/;                                                                                       
   /plugin/;
   
   / {
       fragment@0 {
           target = <&i2c3>;
   
           __overlay__ {
               status = "disabled";
          };
     };
  };
khadas@Khadas:~$ sudo vim /boot/dtb/amlogic/kvim3.dtb.overlay.env
fdt_overlays=

2.The corresponding GPIO numbers are 475 and 474 respectively.

khadas@Khadas:~$ echo 475 | sudo tee /sys/class/gpio/export
[sudo] password for khadas: 
475

1 Like

Hi @ivan.li

Thank you for your reply. As per my original post I did create an overlay to disable i2c3 however it didn’t work.

image

I am confused as to how the GPIO map could have changed between the 20.04 and 22.04? This is showing physical pin 22 as GPIO 491 whereas it used to be 475 as you mentioned.

Hello @Ingeniero
1.

The GPIO number shown by WiringPi is wrong, I will fix this as soon as possible.It should be 475 and 474.

2.Did you forget to add a node?

3.The reason for this problem is that the Ubuntu22.04 i2c3 node has TP chip mounted on it.

1026 &i2c3 {
1027     status = "okay";
1028     pinctrl-names="default";
1029     pinctrl-0=<&i2c3_master_pins2>;
1030     clock-frequency = <100000>; /* default 100k */
1031 
1032     ft5336@38 {
1033         compatible = "edt,edt-ft5336", "ft5x06";
1034         reg = <0x38>;
1035         interrupt_pin = <&gpio GPIOA_5 GPIO_ACTIVE_HIGH>;
1036         reset-gpios = <&gpio_expander 6 GPIO_ACTIVE_HIGH>;
1037         status = "okay";
1038     };
1039 
1040     gt9xx@5d {
1041         compatible = "goodix,gt9xx";
1042         status = "okay";
1043         reg = <0x5d>;
1044         reset-gpio = <&gpio_expander 6 GPIO_ACTIVE_HIGH>;
1045         tp-size = <89>;
1046         rotation = <1>;
1047         goodix,cfg-group0 = [
1048                 41 80 07 B0 04 0A 3D 00 01 08 28
1049                 05 64 50 03 05 00 00 00 00 23 13
1050                 00 17 19 1C 13 90 30 AA 17 15 31
1051                 0D 00 00 01 9B 03 24 00 00 00 00
1052                 00 00 00 00 00 00 00 0F 23 94 D5
1053                 02 07 00 00 04 A3 10 00 8C 13 00
1054                 7B 16 00 69 1B 00 5B 20 00 5B 00
1055                 00 00 00 00 00 00 00 00 00 00 00
1056                 00 00 00 00 00 00 00 00 00 00 00
1057                 00 00 00 00 00 00 00 00 00 00 00
1058                 00 00 00 01 04 05 06 07 08 09 0C
1059                 0D 0E 0F 10 11 14 15 16 17 18 19
1060                 FF FF FF FF FF FF FF FF FF FF 00
1061                 02 04 06 07 08 0A 0C 0D 0E 0F 10
1062                 11 12 13 14 19 1B 1C 1E 1F 20 21
1063                 22 23 24 25 26 27 28 29 2A FF FF
1064                 FF FF FF FF FF FF FF FF 6F 01];
1065     };
1066 };

1 Like