setting GPIO

取消
显示结果 
显示  仅  | 搜索替代 
您的意思是: 

setting GPIO

1,309 次查看
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 项奖励
6 回复数

1,174 次查看
Kecy
Contributor I

ddeyo1

I have the same problem, have you solved it

0 项奖励

1,164 次查看
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 项奖励

1,161 次查看
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 项奖励

1,272 次查看
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.

标记 (1)
0 项奖励

1,294 次查看
josephzhou1
Contributor V

.

Best Regards,
Joseph Zhou Jianhui / Senior Embedded Software Engineer, Singapore
0 项奖励

1,290 次查看
ddeyo1
Contributor I

Did you have a question or answer?

-dwd

0 项奖励