GPIO interrupt on i.MX6

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

GPIO interrupt on i.MX6

跳至解决方案
11,774 次查看
nluca
Contributor III

Hi,

I'm trying to configure an interrupt on a GPIO of my board i.MX6, in order to toggle another GPIO once the first has changed its value (this is the first stage of a more complicated project). I want to build a module and insert it on the running kernel. Attached is the source code and the Makefile I'm using to compile it. I'm actually able to compile the source code in a linux x86 system, but once I try to insert it on the i.MX6 environment (using insmod), I get these errors:

 

luca_gpio: Unknown symbol gpio_free (err 0)

luca_gpio: Unknown symbol __gpio_to_irq (err 0)

luca_gpio: Unknown symbol gpio_direction_output (err 0)

luca_gpio: Unknown symbol __gpio_set_value (err 0)

luca_gpio: Unknown symbol gpio_request (err 0)

 

Could anyone give me any suggestion to solve this issue, please?

 

Thanks a lot,

Luca

Original Attachment has been moved to: sources.zip

标签 (2)
1 解答
5,607 次查看
nluca
Contributor III

Hi Igor,

Thanks for your support. Actually my original code was almost fine, I only missed to include the GPL licence.

Best regards,

Luca

在原帖中查看解决方案

0 项奖励
回复
7 回复数
5,607 次查看
phaniteja
Contributor II

Hello Luca,

I am trying to configure a GPIO pin and registered the ISR, (For more details please refer 474144). I have successfully registerd interrupt but my ISR is not getting hit.

Could you please share the DTS changes you have done and also updated source code, so that it will be helpful for us to resolve this issue.

Thanks,

Phani Movva

0 项奖励
回复
5,608 次查看
nluca
Contributor III

Hi Igor,

Thanks for your suggestions.

Actually I've already looked at the references you suggested and they have been very helpful as a start point. However, the method explained is working in polling mode and in user space: this means I'm not able to take a real-time action based on the state change of the input pin (e.g. change the state of another output pin). That's why I was asking about interrupts and kernel space modules. Any suggestion/explanation on how to achieve this?

Thanks guys,

Luca

0 项奖励
回复
5,608 次查看
igorpadykov
NXP Employee
NXP Employee

Hi Luca

one can look at sect.3.2.4 Interrupt Source Code Structure

attached Linux Manual.

Best regards

igor

0 项奖励
回复
5,608 次查看
nluca
Contributor III

Hi Igor,

Thanks for your suggestions. This is very interesting and a good starting point !

Just after having read the first pages, one more question is how to get all the starting point SW. I can download the 3.10.53 Linux kernel, but what about the BSP? And how should I combine the two software packages to get the full features OS for my i.MX6 Solo board? And what about the RFS?

Thanks a lot,

Luca

0 项奖励
回复
5,608 次查看
igorpadykov
NXP Employee
NXP Employee

Hi Luca

for SW starting point suggest to start with

https://community.freescale.com/docs/DOC-1616

Best regards

igor

0 项奖励
回复
5,608 次查看
nluca
Contributor III

Hi Igor,

Thanks for your support. Actually my original code was almost fine, I only missed to include the GPL licence.

Best regards,

Luca

0 项奖励
回复