<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Configured GPIO interrupt but ISR is not hitting in i.MX Processors</title>
    <link>https://community.nxp.com/t5/i-MX-Processors/Configured-GPIO-interrupt-but-ISR-is-not-hitting/m-p/745124#M115963</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Phani,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;please be aware that interrupts are handled in kernel space.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In the following thread you can find the source code of a kernel module that handles an interrupt &lt;A href="https://community.nxp.com/thread/458270"&gt;Issue with configuring GPIO as an interrupt - i.MX6Q&lt;/A&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Please also refer to generic linux documentation on found on web, like Linux Device Drivers, 2nd Edition: Chapter 9: Interrupt Handling 4.6. Interrupt Handling - Understanding the Linux Kernel, 3rd Edition [Book] and sect.3.2 Interrupts (Operation) i.MX_Linux_Reference_Manual.pdf&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The following may also be helpful &lt;A href="https://community.nxp.com/thread/442814"&gt;How do I configure  the INT0-INT7 interrupt request of GPIO1 source?&lt;/A&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;Regards,&lt;BR /&gt;Carlos&lt;BR /&gt;NXP Technical Support&lt;BR /&gt;-----------------------------------------------------------------------------------------------------------------------&lt;BR /&gt;Note: If this post answers your question, please click the Correct Answer button. Thank you!&lt;BR /&gt;-----------------------------------------------------------------------------------------------------------------------&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 19 Apr 2018 20:23:10 GMT</pubDate>
    <dc:creator>Carlos_Musich</dc:creator>
    <dc:date>2018-04-19T20:23:10Z</dc:date>
    <item>
      <title>Configured GPIO interrupt but ISR is not hitting</title>
      <link>https://community.nxp.com/t5/i-MX-Processors/Configured-GPIO-interrupt-but-ISR-is-not-hitting/m-p/745123#M115962</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;I am using IMX6.ULL board, I have followed the thread &lt;A _jive_internal="true" href="https://community.nxp.com/thread/381277"&gt;381277&lt;/A&gt;&amp;nbsp;to configure a GPIO pin and to trigger isr when interrupt happened&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;DTS changes:&lt;/P&gt;&lt;P&gt;&lt;EM&gt;&amp;nbsp;&amp;amp;iomuxc {&lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt; pinctrl-names = "default";&lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt; pinctrl-0 = &amp;lt;&amp;amp;pinctrl_hog_1&amp;gt;;&lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt; pinctrl_hog_1: hoggrp-1 {&lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt; fsl,pins = &amp;lt;&lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt; &lt;SPAN style="color: #ff0000;"&gt;MX6UL_PAD_UART1_RTS_B__GPIO1_IO19 0x17059 &amp;nbsp;/* ADDED THIS LINE */&lt;/SPAN&gt;&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;driver:&lt;/P&gt;&lt;P&gt;&lt;EM&gt;#define IMX_GPIO_NR(bank, nr) (((bank) - 1) * 32 + (nr))&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;#define GPIO_PIN IMX_GPIO_NR(1, 19)&lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt;#define INPUT_PIN_DESC "gpio_pin_test"&lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt;#define GPIO_DEVICE_DESC "my_device"&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;gpio_request(gpio_pin, INPUT_PIN_DESC);&lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt;gpio_direction_output(gpio_pin, 0);&lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt;gpio_export(gpio_pin, false);&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;gpio_to_irq(gpio_pin);&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;request_irq(irq_input_pin, (irq_handler_t ) r_irq_handler, IRQF_TRIGGER_RISING | IRQF_TRIGGER_FALLING,&amp;nbsp;INPUT_PIN_DESC, GPIO_DEVICE_DESC);&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;static irqreturn_t r_irq_handler(int irq, void *dev_id) {&lt;/P&gt;&lt;P&gt;unsigned long flags;&lt;/P&gt;&lt;P&gt;local_irq_save(flags);&lt;/P&gt;&lt;P&gt;/* TODO: Need to blink a LED here */&lt;BR /&gt; printk(KERN_NOTICE "Interrupt [%d] for device %s was triggered !.\n", irq, (char *)dev_id);&lt;/P&gt;&lt;P&gt;local_irq_restore(flags);&lt;/P&gt;&lt;P&gt;return IRQ_HANDLED;&lt;BR /&gt;}&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;After loading driver I am able to see the registered interrupt(cat /sys/proc/interrupts) and I am able to change the value of the gpio(echo 1 &amp;gt; /sys/class/gpio/gpio19/value)&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #ff0000;"&gt;&lt;STRONG&gt;Here are my issues:&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #ff0000;"&gt;&lt;STRONG&gt;1. My ISR is not hitting when I set or clear the GPIO values&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #ff0000;"&gt;&lt;STRONG&gt;2. GPIO19 folder is not showing the direction interface.&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Could you anybody suggest what I am missing.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Phani Movva&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 18 Apr 2018 13:04:07 GMT</pubDate>
      <guid>https://community.nxp.com/t5/i-MX-Processors/Configured-GPIO-interrupt-but-ISR-is-not-hitting/m-p/745123#M115962</guid>
      <dc:creator>phaniteja</dc:creator>
      <dc:date>2018-04-18T13:04:07Z</dc:date>
    </item>
    <item>
      <title>Re: Configured GPIO interrupt but ISR is not hitting</title>
      <link>https://community.nxp.com/t5/i-MX-Processors/Configured-GPIO-interrupt-but-ISR-is-not-hitting/m-p/745124#M115963</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Phani,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;please be aware that interrupts are handled in kernel space.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In the following thread you can find the source code of a kernel module that handles an interrupt &lt;A href="https://community.nxp.com/thread/458270"&gt;Issue with configuring GPIO as an interrupt - i.MX6Q&lt;/A&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Please also refer to generic linux documentation on found on web, like Linux Device Drivers, 2nd Edition: Chapter 9: Interrupt Handling 4.6. Interrupt Handling - Understanding the Linux Kernel, 3rd Edition [Book] and sect.3.2 Interrupts (Operation) i.MX_Linux_Reference_Manual.pdf&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The following may also be helpful &lt;A href="https://community.nxp.com/thread/442814"&gt;How do I configure  the INT0-INT7 interrupt request of GPIO1 source?&lt;/A&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;Regards,&lt;BR /&gt;Carlos&lt;BR /&gt;NXP Technical Support&lt;BR /&gt;-----------------------------------------------------------------------------------------------------------------------&lt;BR /&gt;Note: If this post answers your question, please click the Correct Answer button. Thank you!&lt;BR /&gt;-----------------------------------------------------------------------------------------------------------------------&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 19 Apr 2018 20:23:10 GMT</pubDate>
      <guid>https://community.nxp.com/t5/i-MX-Processors/Configured-GPIO-interrupt-but-ISR-is-not-hitting/m-p/745124#M115963</guid>
      <dc:creator>Carlos_Musich</dc:creator>
      <dc:date>2018-04-19T20:23:10Z</dc:date>
    </item>
    <item>
      <title>Re: Configured GPIO interrupt but ISR is not hitting</title>
      <link>https://community.nxp.com/t5/i-MX-Processors/Configured-GPIO-interrupt-but-ISR-is-not-hitting/m-p/745125#M115964</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello Carlos Musich,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks for the response.&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am still facing some issues with GPIO interrupt. I am attaching the driver that I am using to register GPIO interrupt and dts changes as below&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="color: #ff0000;"&gt;File: "imx6ull-14x14-evk.dts"&lt;/STRONG&gt;&lt;BR /&gt;&amp;amp;gpiotest {&lt;BR /&gt; pinctrl-names = "default";&lt;BR /&gt; pinctrl-0 = &amp;lt;&amp;amp;pinctrl_gpio&amp;gt;;&lt;BR /&gt; status = "okay";&lt;BR /&gt;};&lt;/P&gt;&lt;P&gt;pinctrl_gpio: gpiogrp {&lt;BR /&gt; fsl,pins = &amp;lt;&lt;BR /&gt; MX6UL_PAD_UART5_RX_DATA__GPIO1_IO31 0xb0&lt;BR /&gt; &amp;gt;;&lt;BR /&gt; };&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #ff0000;"&gt;&lt;STRONG&gt;File: "imx6ull.dtsi"&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;BR /&gt;gpiotest: gpio@020b0000 {&lt;BR /&gt; compatible = "fsl,imx-gpiotest";&lt;BR /&gt; pinctrl-names = "default";&lt;BR /&gt; pinctrl-0 = &amp;lt;&amp;amp;pinctrl_key&amp;gt;;&lt;BR /&gt; gpios = &amp;lt;&amp;amp;gpio1 31 1&amp;gt;;&lt;BR /&gt; interrupts = &amp;lt;GIC_SPI 66 IRQ_TYPE_LEVEL_HIGH&amp;gt;;&lt;BR /&gt; interrupt-parent = &amp;lt;&amp;amp;gpio1&amp;gt;;&lt;BR /&gt; };&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;With the above changes and driver, following &amp;nbsp;are my observations:&lt;/P&gt;&lt;P&gt;1. The pin I selected is having always 3.3v and I am able to get interrupt for 5 times as soon as I load module and later if I do following steps:&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;$&lt;/SPAN&gt; echo out &amp;gt; direction&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;$ echo 1 &amp;gt;&amp;nbsp;value&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;$&amp;nbsp;echo in &amp;gt; direction&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Here I am getting interrupt when I am following above three steps.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #ff0000;"&gt;Question: &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #ff0000;"&gt;1.Is my pin(GPIO1_IO31) pad settings are correct ?&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #ff0000;"&gt;2. As the voltage on pin is always high, Why it is generating interrupt only when I change the direction ? Is this the correct way of testing for this particular pin?&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #000000;"&gt;2. If I select any other pin like&amp;nbsp;&lt;STRONG&gt;GPIO1_IO15&lt;/STRONG&gt; (MX6UL_PAD_JTAG_TRST_B__GPIO1_IO15) with pad value 0xb0, its not at all hitting the ISR. This pin default value is 0v and to generate interrupt I am shorting this pin with 3.3v. But its not generating any interrupt.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #ff0000;"&gt;Question: &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #ff0000;"&gt;1.Is my pin(&lt;STRONG style="color: #000000;"&gt;GPIO1_IO15&lt;/STRONG&gt; ) pad settings are correct ?&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #ff0000;"&gt;2.As the pin direction is configured as input, I am expecting a interrupt when ever I am giving voltage signal to the pin. Am I doing any wrong here in the hardware connection ?&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style=": ; color: #ff0000;"&gt;Could you please suggest the proper pin and simple procedure to test the interrupt?&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 27 Apr 2018 06:55:16 GMT</pubDate>
      <guid>https://community.nxp.com/t5/i-MX-Processors/Configured-GPIO-interrupt-but-ISR-is-not-hitting/m-p/745125#M115964</guid>
      <dc:creator>phaniteja</dc:creator>
      <dc:date>2018-04-27T06:55:16Z</dc:date>
    </item>
    <item>
      <title>Re: Configured GPIO interrupt but ISR is not hitting</title>
      <link>https://community.nxp.com/t5/i-MX-Processors/Configured-GPIO-interrupt-but-ISR-is-not-hitting/m-p/745126#M115965</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Phani,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You are changing the direction of GPIO pin as an output using sysfs. Interrupt can not be generate on output line of GPIO. You need to configure GPIO as an input line and trigger any key or change level of that line externally to generate a interrupt on that GPIO. Basically Interrupt generate when something happen on input line to let us know about the event. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You can find a good explanation of GPIO in&amp;nbsp;&lt;A href="https://www.kernel.org/doc/Documentation/gpio/gpio.txt"&gt;this&lt;/A&gt; link.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Here I have configured GPIO1_IO21 pin as an interrupt.&lt;/P&gt;&lt;P&gt;I have done the following changes in imx6ul-14x14-evk.dts file.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;TABLE class="j-table jiveBorder" style="border: 1px solid #c6c6c6; width: 49.7453%;"&gt;&lt;THEAD&gt;&lt;TR style="background-color: #efefef;"&gt;&lt;TH style="width: 100%;"&gt;Changes in imx6ul-14x14-evk.dts file&lt;/TH&gt;&lt;/TR&gt;&lt;/THEAD&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD style="width: 100%;"&gt;&lt;P&gt;&amp;nbsp;gpio-test {&lt;BR /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; compatible = "gpio-intr-key";&lt;BR /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; pinctrl-names = "default";&lt;BR /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; pinctrl-0 = &amp;lt;&amp;amp;pinctrl_gpio_keys&amp;gt;;&lt;BR /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; gpio = &amp;lt;&amp;amp;gpio1 21 GPIO_ACTIVE_LOW&amp;gt;;&lt;BR /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; interrupts = &amp;lt;21 0&amp;gt;;&lt;BR /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; interrupt-parent = &amp;lt;&amp;amp;gpio1&amp;gt;;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; };&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;pinctrl_gpio_keys: gpio_keysgrp {&lt;BR /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; fsl,pins = &amp;lt;&lt;BR /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; MX6UL_PAD_UART2_RX_DATA__GPIO1_IO21&amp;nbsp;&amp;nbsp; &amp;nbsp;0x1b0b0&lt;BR /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;gt;;&lt;BR /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; };&lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;With these changes, you need to give HIGH/LOW input externally on that pin then ISR is triggered on that pin.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have also attached the driver.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Shivani&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 14 May 2018 14:12:43 GMT</pubDate>
      <guid>https://community.nxp.com/t5/i-MX-Processors/Configured-GPIO-interrupt-but-ISR-is-not-hitting/m-p/745126#M115965</guid>
      <dc:creator>shivanipatel</dc:creator>
      <dc:date>2018-05-14T14:12:43Z</dc:date>
    </item>
    <item>
      <title>Re: Configured GPIO interrupt but ISR is not hitting</title>
      <link>https://community.nxp.com/t5/i-MX-Processors/Configured-GPIO-interrupt-but-ISR-is-not-hitting/m-p/745127#M115966</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello Shivan,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Is the "&lt;SPAN style="color: #51626f; background-color: #ffffff;"&gt;interrupts"&lt;SPAN&gt;&amp;nbsp;node really needed in the above example for dts ?&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="background-color: #ffffff; color: #51626f;"&gt;I think that if the gpio is configured as input and the driver request irq from gpio, than it should be sufficient&amp;nbsp;, Right ?&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="background-color: #ffffff; color: #51626f;"&gt;Thank you,&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="background-color: #ffffff; color: #51626f;"&gt;ran&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 19 Dec 2018 10:17:25 GMT</pubDate>
      <guid>https://community.nxp.com/t5/i-MX-Processors/Configured-GPIO-interrupt-but-ISR-is-not-hitting/m-p/745127#M115966</guid>
      <dc:creator>rans</dc:creator>
      <dc:date>2018-12-19T10:17:25Z</dc:date>
    </item>
  </channel>
</rss>

