Using iMX6ULL GPIO with Viola


I’m trying to use one GPIO on the X9 Extension Connector of Viola Carrier board, I choose to use pin 18 which contains SODIMM_63 with one pull up resistor. I try to do the following commands without success:

echo 63 > /sys/class/gpio/export
echo "out" > /sys/class/gpio/gpio63/direction
echo 1 > /sys/class/gpio/gpio63/value
echo 0 > /sys/class/gpio/gpio63/value    

After that I realized that 63 wasnt the right Linux number to activate, I’ve tried some other numbers and pins also without success. How can I find the correct number to activate? What am I doing wrong? I realized also that the WB version have some gpio not connected, can I use pin 18 (SODIMM_63)?



Hi @lcasagrande!

Basically, you have to refer to the module datasheet to find out which GPIO corresponds to the SODIMM pin you’re using. On the Colibri iMX6ULL datasheet, this is found on table 4.4.1.
In this case, SODIMM_63 corresponds to gpio2.IO1.

Then you can refer to this article about the pin numbering convention on Linux. You’ll use the pin bank number (2) and the pin index (1) to figure out the gpio number to be used on Linux. The article I linked provides a table with all the pin numbers and also the formula used to do this conversion.

In this case, SODIMM_63, which is GPIO2_IO01 is pin 33 on Linux, so you might do:

 echo 33 > /sys/class/gpio/export
 echo "out" > /sys/class/gpio/gpio33/direction
 echo 1 > /sys/class/gpio/gpio33/value
 echo 0 > /sys/class/gpio/gpio33/value