Then I realize it only work for some pins with it turn on/off successfully. For those pin that are fail, it never turn on LED.
Conclusion is some pins work as expectation, but some pins don’t.
My connect is straightforward, I connect pin → LED (with a 330 ohm resistor) → GND
[upload|tSN2vOIJzaD3YkxJVtYzr0jsDf8=]
Everything is normal (success) if we check the status in terminal, the ‘value’ does show it is ‘1’ or ‘0’ for both success and fail pins after command ‘echo’ the value.
[upload|j3b14DRMakjbawP+0k7fgMnA58g=]
Below are the table for pass/fail pin:
[upload|0rPdFihsrJgRy9JEZpsO3Y6Bg8w=]
I need to make all the pins work as expectation, please help me on this, thank you very much.
Hi @alex.tx , based on the Apalis iMX8X datasheet, it seems like there are supposed to be 8 dedicated GPIO pins, GPIO1 to GPIO8 which correspond to the pins being tested above. Do we need to do additional pin muxing for them to work? As far as I can see, these pins are already configured to be GPIO in the device tree. I can see pinctrl_gpio1 to pinctrl_gpio6 assigned to pinctrl-0 of iomuxc here:
@alex.tx I understand that you obtained those GPIO numeric assignments based on the formula provided in this article? In our case, calculating the GPIO numeric value using the formula
480 - 32 x controller + gpio
as provided in the article did not work for us. Trying to export gpio-405, for example, resulted in a write error. Instead, we used the formula
controller x 32 + gpio
e.g. GPIO3.IO23 => (3 x 32) + 23 = gpio-119
and can confirm that this should be the correct formula to obtain the GPIO numeric values on the Apalis iMX8X (as we managed to correctly toggle GPIOs on MXM3 pins 5, 7 and 11).
This is what happens when I cat /sys/kernel/debug/gpio:
Another article where I have observed some conflict of information is GPIO (Linux), where the provided GPIO numerical value tallies with the ones in the table you provided, but not with the Apalis iMX8X SOMs we are currently working with.
We’ve built Toradex’s BSP 5 Reference Minimal Image based on the OpenEmbedded (core) guide. The machine name which was specified in local.conf is “apalis-imx8x”, which, according to the guide is meant for Apalis iMX8X V1.1B and newer (which is our case here). We have not made any changes to the device tree.