i am using imx8mplus custom board and build the yocto BSP 6.63 version
. i want to blink the led using gpio pins.
my leds are connected to GPIO3_19 ,GPIO3_20 ,GPIO3_21 ,GPIO3_25.
by default this pins are ouput direction .
i added the python3-gpiod package in local.conf.
i wriiten python program using gpiod to blink the leds . my program is running without errors but leds are not blinking.if anyone know how to blink leds please help me out.
Hello @srinivas_123
I hope you are doing very well!
It appears you did not modified your device tree, you can add the following to your device tree:
&gpio3 {
pinctrl-names = "default";
pinctrl-0 = <&pinctrl_gpio3>;
status = "okay";
};
Then, inside of the &iomuxc:
pinctrl_gpio3: gpio3grp {
fsl,pins = <
MX8MP_IOMUXC_SAI5_RXFS__GPIO3_IO19 0x40000
MX8MP_IOMUXC_SAI5_RXC__GPIO3_IO20 0x40000
MX8MP_IOMUXC_SAI5_RXD0__GPIO3_IO21 0x40000
MX8MP_IOMUXC_SAI5_MCLK__GPIO3_IO25 0x40000
>;
};
Then, you will be able to change the state of the pines with your code
Best regards,
Salas.
Hello @srinivas_123 ,
Sure, the register configured is SW_PAD_CTL_PAD_SAI5_RXFS SW PAD Control Register
(IOMUXC_SW_PAD_CTL_PAD_SAI5_RXFS):
You can find more information in reference manual.
Best regards,
Salas.
It seems that Linux already has such a function, and NXP engineers have written documents.
https://community.nxp.com/t5/i-MX-Processors-Knowledge-Base/GPIO-LEDs/ta-p/2009743 https://community.nxp.com/t5/i-MX-Processors-Knowledge-Base/iMX93-EVK-PWM-LED/ta-p/1978047