ConnectCard i.mx28 GPIOs as outputs

Hello,

I would like to use two GPIOs on a custom board that includes the Digi ConnectCard i.mx28 module; an output associated with pin 27 of the module and an input associated with pin 29 of the module. From the Digi hardware reference manual, these correspond to GPIO0_23 and GPIO0_22, respectively.

The GPIO as input (pin 27) works as expected when I configure it from the user space via sysfs. The GPIO as output (pin 29) does not report any errors when I set it up via sysfs, but I am unable to change the value. If I “cat” the value, it doesn’t follow what is assigned, and if I probe the pin with an oscilloscope, the signal shows no change either.

The documentation in the ConnectCard hardware reference manual is terse. From a literature review, it seems as if the issue might be related to a need to set up pin multiplexing to use the pin as GPIO and/or additionally configuring the GPIO in the device tree.

Any guidance on the details to do this within the framework of Digi Embedded Yocto is sincerely appreciated. I am working with the minimal, non-graphical build for the ConnectCard imx28js JumpStart platform as a baseline for Yocto.

1 Like

In case it might help others experiencing similar problems driving GPIO outputs, the issue in my particular case was related to pin multiplexing as suspected.

The baseline IMX28 device tree was assigning the pins of interest to the CAN0 in imx28.dtsi, which is included by imx28-ccardimx28js.dts.

To claim the pin for GPIO output, a custom imx28.dtsi, which removes the pin assignments from the CAN0 interface, is used. And references to those pins in a modified imx28-ccardimx28js.dts are also commented out. It was unnecessary to explicitly add new pin multiplexing definitions to explicitly assign the pins to the GPIOs (MUX selection 3).

~/workspace/ccardimx28js/tmp/work/ccardimx28js-dey-linux-gnueabi/linux-dey/3.10-r0/git/arch/arm/boot/dts $ diff imx28.dtsi imx28_jm.dtsi
805,815d804
< can0_pins_a: can0@0 {
< reg = <0>;
< fsl,pinmux-ids = <
< 0x0161 /* MX28_PAD_GPMI_RDY2__CAN0_TX /
< 0x0171 /
MX28_PAD_GPMI_RDY3__CAN0_RX */
< >;
< fsl,drive-strength = <0>;
< fsl,voltage = <1>;
< fsl,pull-up = <0>;
< };
<

1 Like