setting GPIO

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

setting GPIO

1,278 Views
ddeyo1
Contributor I

I am using an iMX8mm SOM from Boundary that initially had gpio2 configured for usdhc1  emmc interface and usdhc2 for the sdcard.  We are using emmc but not sdcard.

I have been able to reconfigure all of my other gpio ports and pins and all of them work except for all of the usdhc2 pins.  I've removed the usdhc2 node from my device tree and I no longer get a clock on SD2_CLK.

However when I export gpio 45 (gpio2 13), change the direction to output and set the value to 1, my pin stays low.

Is there anything that would prevent a pin mux change for usdhc?

 

I should add that I have also added gpio14 and gpio15 and my pinctrl settings are the same as my working pins.  None of the usdhc2 pins can be changed.

0 Kudos
6 Replies

1,143 Views
Kecy
Contributor I

ddeyo1

I have the same problem, have you solved it

0 Kudos

1,133 Views
ddeyo1
Contributor I

Yes, I solved it. I think it was in uboot.  I think I had to enable hog on the CONFIG for uboot.

file:  configs/nitrogen8mm_4g_defconfig b/configs/nitrogen8mm_4g_defconfig

change:  CONFIG_GPIO_HOG=y

I was told this was off by default.

 

Then, of course, I had to include the pinctrl settings for my pins in a hog node in my uboot dts file.

0 Kudos

1,130 Views
ddeyo1
Contributor I

This is my added node that goes under &iomuxc:

pinctrl_hog: hoggrp {
fsl,pins = <
MX8MMN(IOMUXC_SD2_CD_B_GPIO2_IO12, 0x16)
MX8MMN(IOMUXC_SD2_CLK_GPIO2_IO13, 0x16)
MX8MMN(IOMUXC_SD2_CMD_GPIO2_IO14, 0x16)
MX8MMN(IOMUXC_SD2_DATA0_GPIO2_IO15, 0x16)
MX8MMN(IOMUXC_SD2_RESET_B_GPIO2_IO19, 0x16)
MX8MMN(IOMUXC_NAND_ALE_GPIO3_IO0, 0x16)
MX8MMN(IOMUXC_ECSPI2_SS0_GPIO5_IO13, 0x16)
>;
};

0 Kudos

1,241 Views
disheng
Contributor III

Probably the pins are also configured in the uboot, there is a .c file for your board initialization, you can take a look there.

Tags (1)
0 Kudos

1,263 Views
josephzhou1
Contributor V

.

Best Regards,
Joseph Zhou Jianhui / Senior Embedded Software Engineer, Singapore
0 Kudos

1,259 Views
ddeyo1
Contributor I

Did you have a question or answer?

-dwd

0 Kudos