Hello! Where can i find schematics to work with GPIO. I found this site (https://variwiki.com/index.php?title=MX8M_GPIO), but I could not find a diagram that describes which pin on gpio and its number.
@weidong_sun You can give a link to the manul? I could not find it anywhere.
And I have one more question, how can I control the pins from the GPIO comb (EXP CN, J1003)? I tried to do as described here:
https://community.nxp.com/t5/i-MX-Processors/Configuration-of-GPIO-of-expansion-connector-of-IMX8mm/...
But I get this:
root @ imx8mmevk: / # echo 505> / sys / class / gpio / export
[13964.387316] export_store: invalid GPIO 505
-sh: echo: write error: Invalid argument
Hello @SYakubson ,
Download the reference manual on the web link, please!
An example for you:
if you are using GPIO5_IO08, it's number in linux : (5-1)x32 + 8 = 136
you can get all GPIO list from reference manual.
Hope above is helpful to you.
Have a good day!
regards,
weidong
@weidong_sun
Ok, but what GPIO number will EXP_IO13 (and other EXP_IOs) have?
It is linux knowledge, technically, not a question for i.mx processors community strictly.
You should read the linux document. and document tells you everything.
linux/Documentation/driver-api/gpio/legacy.rst
GPIO controllers have paths like /sys/class/gpio/gpiochip42/ (for the
controller implementing GPIOs starting at #42) and have the following
read-only attributes:
/sys/class/gpio/gpiochipN/
"base" ... same as N, the first GPIO managed by this chip
"label" ... provided for diagnostics (not always unique)
"ngpio" ... how many GPIOs this manges (N to N + ngpio - 1)
for i in /sys/class/gpio/gpiochip* ; do echo $i ;echo label:$(cat $i/label);echo base: $(cat $i/base); echo ngpio $(cat $i/ngpio);done
confirmed by debugfs
cat /sys/kernel/debug/gpio
I am assuming that the dts file you are showing needs to be added to the yocto build, right? Because I don't have gpiochip5.
This is it, right?
https://source.codeaurora.org/external/imx/linux-imx/tree/arch/arm64/boot/dts/freescale/imx8mm-evk.d...
You don't have because the i.MX8MM EVK hardware is rohm bd71847 pmic.
but the BSP software is pca pmic. you change it to rohm pmic as previous.
will see the gpio, I have shown you.
You can see the current dts is using pca pmic not rohm pmic.
hardware is rohm pimc, bsp is pca pmic, so it has an error.
and the PCA6416APW is supplied by rohm, bd71847 buck 6 and buck7.
change is to rohm, you will see the PCA6416APW.
you can do backports the rohm pmic from L5.4.24.
It is very easy, just copy & paste.
root@imx8mmevk:~# dmesg|grep pca
[ 2.112946] nxp-pca9450 0-0025: Read device id error
&i2c1 { clock-frequency = <400000>; pinctrl-names = "default"; pinctrl-0 = <&pinctrl_i2c1>; status = "okay"; pmic_nxp: pca9450@25 { compatible = "nxp,pca9450a"; reg = <0x25>; pinctrl-0 = <&pinctrl_pmic>;
Okay so I have to change the PCA6416APW to bd71847 in dts file in the yocto build directory?
Or i can do this under build Linux image?
I already told you everything. If you cannot modify the device tree as backposts from L5.4.24.
You can download L5.4.24 binary demo image to try.
Hi @SYakubson ,
the driver of I2C IO expander is gpio-pca953x.c
open the file, you can find 'chip->gpio_start' in probe function, add prink() to print it's value, you will know the first GPIO number.
Regards,
weidong
@weidong_sun
Where i can find this file in Yocto build dir?
Or in builded Linux Files system?
Hi,
All Pins multiplexing are listed in 8.1.1.1 Muxing Options of reference manual
check it , please!
Regards,
weidong