AnsweredAssumed Answered

Configuration of GPIO of expansion connector of IMX8mm

Question asked by Elise Becam on Aug 14, 2019
Latest reply on Aug 21, 2019 by jimmychan

Hello,

 

I'm working with the IMX8M Mini EVK and generate image with Yocto using the core-image-base.

I would like to use the GPIO of the expansion connector.

 

According to the schematics, 7 GPIOs are available on the expansion connector through the PCA6416 driver.

GPIO from this driver are available under sysfs:

root@imx8mmevk:~# cat /sys/class/gpio/gpiochip496/label
tca6416

root@imx8mmevk:~# cat /sys/class/gpio/gpiochip496/ngpio
16
root@imx8mmevk:~# cat /sys/class/gpio/gpiochip496/base  
496

 

I first try to use GPIO 9 of the expansion connector as as input GPIO:

root@imx8mmevk:~# echo 505 > /sys/class/gpio/export                                                                                           
root@imx8mmevk:~# echo in > /sys/class/gpio/gpio505/direction

 

Then I connect pin 13 of the expansion connector to 3.3V and read value:

root@imx8mmevk:~# cat /sys/class/gpio/gpio505/value
0

 

Value of GPIO stays to 0.

 

Moreover, when configuring GPIO as output, and measuring voltage of the GPIO, I always measure 0V even when value in set to 1.

 

I have checked that pca6416 driver is recognized on the i2c bus (bus #3, @ 0x20)

root@imx8mmevk:~# i2cdetect 2
WARNING! This program can confuse your I2C bus, cause data loss and worse!
I will probe file /dev/i2c-2.
I will probe address range 0x03-0x77.
Continue? [Y/n] Y
     0  1  2  3  4  5  6  7  8  9  a  b  c  d  e  f
00:          -- -- -- -- -- -- -- -- -- -- -- -- --
10: UU UU UU UU -- -- -- -- -- -- -- -- -- -- -- --
20: UU -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
30: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
40: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
50: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
60: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
70: -- -- -- -- -- -- -- --

 

 

Could you please help me configuring those GPIO ? Is there more checking I should make to assure everything is alright ? Am I missing some configurations to enable those GPIO ?

 

Thanks in advance

Outcomes