Hello,
I am using a Apalis imx6 Ixora Carrier board and I want to use led 4 and led 5. I tried with the sys interface as follows:
echo 33 > /sys/class/gpio/export
echo out > /sys/class/gpio/gpio33/direction
echo 1 > /sys/class/gpio/gpio33/value
cat /sys/class/gpio/gpio33/value
but it is not working.So I want to understand how to use/reconfigure pins and how to use LEDs from sys interface.
Because the led driver did already reserve the gpio your effort to export one of the gpio’s used for the LEDs fails.
If you want the pins to be exportable as gpios you would have to change the device tree so that the pins are muxed to be gpios but not used by any kernel driver.
Could you please check whether you’re loading imx6qdl-apalis-eval.dtsi dtb file??
if yes ,please chage/load imx6q-apalis-ixora-v1.1.dtb dtb file from u-boot.Please use below command for the same in u-boot terminal.
Thank you for your valuable reply. By default imx6qdl-apalis-eval.dtb was getting loaded. As you suggested I changed it to imx6q-apalis-ixora-v1.1.dtb by using setenv fdt_file imx6q-apalis-ixora-v1.1.dtb command. And I can see the leds are glowing.
Now I want to change the fdt_file to imx6q-apalis-ixora-v1.1.dtb from the source code so that I don’t have to manually change it every time I flash the image.