IMX6UL Change Pin Function

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

IMX6UL Change Pin Function

1,469 次查看
danielberhe
Contributor IV

I have a custom IMX6UL board running Linux 4.14. I configured GPIO1_IO29 and GPIO1_IO28 for I2C in the device tree and all is working well with that. What I am struggling to figure out is how I can momentarily change the function of the I2C pins to GPIO without having to modify the device tree and recompiling the kernel. The I2C slave connected to my board sometimes requires a specific re-sync sequence that I can't achieve if the pins are in I2C mode. 

Any help would be appreciated.

 

Daniel

标签 (1)
0 项奖励
回复
4 回复数

1,288 次查看
gusarambula
NXP TechSupport
NXP TechSupport

Hello Daniel,

There is no method to change the device tree on the fly as it is only loaded to setup the hardware variables. However, you may change the registers associated to the desired pins to change their functions on the fly. You would just need to be careful to make sure that there are no conflicts with the drivers or other functions.

I hope this helps!

Regards,

0 项奖励
回复

1,288 次查看
danielberhe
Contributor IV

Hi Gusarambula,

Thanks for your response. 

My intention wasn't to change the device tree on the fly. I managed to get around the problem by writing a misc device driver that changes the pin functions by using the Linux PINCTRL subsystem. 

Regards,

Daniel

0 项奖励
回复

1,268 次查看
jochenstehle
Contributor III

Hi Daniel,

i have a similar problem. Can you give me more Infos how you do it or where i can get more information how to change pin functionality for userspace.

 

I want to switch my main serial uart to gpio after the system is booted up (in userspace).

Regards,

Jochen

0 项奖励
回复

1,288 次查看
2046880190
Contributor III

你好:

       请问你解决这个问题了么?我在使用i.mx8,不希望更改设备树或者内核,但是我发现使用echo去驱动的时候,IO口没有电平变化。

0 项奖励
回复