[imx6ull 14x14 evk] Modifying dts to use arduino pins for GPIO LEDs

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

[imx6ull 14x14 evk] Modifying dts to use arduino pins for GPIO LEDs

Jump to solution
1,342 Views
namnguyenao
Contributor I

I am currently trying to use the arduino headers on the evalkit to control LEDs via the generic leds-gpio driver. My problem is, that I can not use most of the pins and I don't know why.

What I did:

I changed the imx6ull-14x14-evk.dts to include the following:

leds {
compatible = "gpio-leds";
my_red_led {
label = "rgb_r";
gpios = <&gpio1 20 GPIO_ACTIVE_HIGH>;
};
my_green_led {
label = "rgb_g";
gpios = <&gpio1 21 GPIO_ACTIVE_HIGH>;
};
my_blue_led {
label = "rgb_b";
gpios = <&gpio1 24 GPIO_ACTIVE_HIGH>;
};
my_white_led {
label = "white_led";
gpios = <&gpio1 25 GPIO_ACTIVE_HIGH>;
};
};

In addition to that, I commented out the following sections: 

pinctrl_uart2: uart2grp{...};

&uart2 {...};

What works:

All 4 LEDs show up under /sys/class/leds/

When I call 

echo 255 > /sys/class/leds/{name_of_led}/brightness

the LEDs on pin 20, 21 and 25 can be turned on.

The pins 30,31 also work when I take out I2C (but I need it so I can not use those pins).

What doesn't work:

The LED on pin 24 can not be turned on.

I put some printk()-calls in the kernel module to check for errors, but the driver is working correctly.

I also tried some other arduino pins (those named GPIO0-4, SD1_DATA0-3, SD1_CLK, SD1_CMD and ECSPI4_* on the schematics) but they also don't work.

I always took out the components that use the pins in the dts-file to make sure the drivers don't re-configure the pins.

I also tried manually setting the pins using the following (adapted to each individual pin)

gpioset gpiochip0 24=1

When I call:

gpioinfo

I can see that the pin is configured as "output" with "active-high" value.

 

My question:

What do I have to do/change in the dts-file in order to use pin 24 (or one of the other pins mentioned)?

Labels (1)
0 Kudos
Reply
1 Solution
1,217 Views
namnguyenao
Contributor I

So I just found out where my problem was. the resistor r1732 is not installed so the pin header is not connected and thus the pin was not connected to anything. pin 24 also works just like the others. I just had so manually connect the pin with the pin header.

View solution in original post

2 Replies
1,218 Views
namnguyenao
Contributor I

So I just found out where my problem was. the resistor r1732 is not installed so the pin header is not connected and thus the pin was not connected to anything. pin 24 also works just like the others. I just had so manually connect the pin with the pin header.

1,217 Views
gusarambula
NXP TechSupport
NXP TechSupport

Hello Stefan Mayrhofer, 

Thank you for updating this thread with your findings! I'm sure they will help other community users.

Regards,

0 Kudos
Reply