Hi, I am trying to blink an led connected to EXP_IO9 pin on j1003 connector on imx8mnano evk.
I have followed kernal device tree configuration in the following linkhttps://variwiki.com/index.php?title=MX8M_GPIO .
I have found gpio definition #define MX8MN_IOMUXC_GPIO1_IO09_GPIO1_IO9 in imx8mn-pinfunc.h and added the definition MX8MN_IOMUXC_GPIO1_IO09_GPIO1_IO9 in the iomuxc node edited arch/arm64/boot/dts/freescale/fsl-imx8mn-evk.dtsi, for verifying whether the correct .dtsi file I have edited "yellow:status" default led on imx8mn evk to "yellow1:status" and done bitbake imx-image-multimedia then flashed the image in imx8mnano evk. Then checked the gpioinfo command but there "yellow:status" is not changed to "yellow1:status", tried gpioset gpiochip1 9=0/1 and gpioget gpiochip1 9, but there is no change in status its always '1'.
I would like to know whether the above approach is correct ?..if no suggest the approach to access the gpio's on j1003 pin header
Solved! Go to Solution.
Hello,
You can use the GPIO on our demo image without modify the device tree.
The GPIO pins of RPI connector are connected to a I2C port expander on I2C3.
Using gpioinfo you can see it on gpiochip5:
EXP_IO9 is on line 11 and you need to use the next command:
gpioset -c gpiochip5 11=1
or
gpioset -c gpiochip5 11=0
Also, this link could be helpful.
Best regards.
Hello @JorgeCas ,
may ask you where you find this information "EXP_IO9 is on line 11" please?
I don't find the relation between EXP_IO9 and (gpiochip5, line 11)
Regards
Hello Jorge,
Thanks for the post, I followed it and able to control the led on j1003 with gpioset commands. I would like to know the procedure by writing a recipe c code to control led for the same gpio(EXP_IO 09). I have added the c code mentioned in the link mentioned by you and done bitbake, but getting errors. can you suggest the procedure to control led in c or python(tried to install python libgpiod package but failed with errors).