<?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 GPIO toggle gets interrupted in i.MX Processors</title>
    <link>https://community.nxp.com/t5/i-MX-Processors/GPIO-toggle-gets-interrupted/m-p/863738#M131690</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;We are using custom IMX6 board. We have a requirement of toggling a GPIO line at higher speed. We are using the the following code&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; volatile u32 *gpio_base_addr = (u32) ioremap_nocache(GPIO_ADDR,32);&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; spin_lock(&amp;amp;gpio_spinlock);&lt;BR /&gt;&amp;nbsp;&amp;nbsp; gpio_high_val = readl(gpio_base_addr) | 0x200;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;gpio_low_val = readl(gpio_base_addr) &amp;amp;&amp;nbsp; 0xFFFFDFF;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; gpio_base_addr = gpio_high_val;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; gpio_base_addr = gpio_low_val;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp; ...&lt;/P&gt;&lt;P&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;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ... for 20 times&lt;/P&gt;&lt;P&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;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ...&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; gpio_base_addr = gpio_high_val;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; gpio_base_addr = gpio_low_val;&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; spin_unlock(&amp;amp;gpio_spinlock);&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;We are able to get the twenty toggle cycles most of the time. Sometimes we are not getting the full toggle cycles, the line simply remains low&amp;nbsp; after 10 to 15 toggles. We want the complete cycles all the time.&lt;/P&gt;&lt;P&gt;We are using the GPIO (3, 14) and disabled the drivers which are using GPIOs from the bank 3 in the DTS, but still it gets interrupted.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Arvind&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 28 Mar 2019 16:24:35 GMT</pubDate>
    <dc:creator>arvindprakash</dc:creator>
    <dc:date>2019-03-28T16:24:35Z</dc:date>
    <item>
      <title>GPIO toggle gets interrupted</title>
      <link>https://community.nxp.com/t5/i-MX-Processors/GPIO-toggle-gets-interrupted/m-p/863738#M131690</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;We are using custom IMX6 board. We have a requirement of toggling a GPIO line at higher speed. We are using the the following code&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; volatile u32 *gpio_base_addr = (u32) ioremap_nocache(GPIO_ADDR,32);&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; spin_lock(&amp;amp;gpio_spinlock);&lt;BR /&gt;&amp;nbsp;&amp;nbsp; gpio_high_val = readl(gpio_base_addr) | 0x200;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;gpio_low_val = readl(gpio_base_addr) &amp;amp;&amp;nbsp; 0xFFFFDFF;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; gpio_base_addr = gpio_high_val;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; gpio_base_addr = gpio_low_val;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp; ...&lt;/P&gt;&lt;P&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;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ... for 20 times&lt;/P&gt;&lt;P&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;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ...&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; gpio_base_addr = gpio_high_val;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; gpio_base_addr = gpio_low_val;&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; spin_unlock(&amp;amp;gpio_spinlock);&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;We are able to get the twenty toggle cycles most of the time. Sometimes we are not getting the full toggle cycles, the line simply remains low&amp;nbsp; after 10 to 15 toggles. We want the complete cycles all the time.&lt;/P&gt;&lt;P&gt;We are using the GPIO (3, 14) and disabled the drivers which are using GPIOs from the bank 3 in the DTS, but still it gets interrupted.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Arvind&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 28 Mar 2019 16:24:35 GMT</pubDate>
      <guid>https://community.nxp.com/t5/i-MX-Processors/GPIO-toggle-gets-interrupted/m-p/863738#M131690</guid>
      <dc:creator>arvindprakash</dc:creator>
      <dc:date>2019-03-28T16:24:35Z</dc:date>
    </item>
    <item>
      <title>Re: GPIO toggle gets interrupted</title>
      <link>https://community.nxp.com/t5/i-MX-Processors/GPIO-toggle-gets-interrupted/m-p/863739#M131691</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Arvind&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;linux is mulitasking operating system so each process can interrupt gpio routine.&lt;/P&gt;&lt;P&gt;May be recommended to try processors with M4 core running freertos, like i.MX7.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Best regards&lt;BR /&gt;igor&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, 28 Mar 2019 23:38:44 GMT</pubDate>
      <guid>https://community.nxp.com/t5/i-MX-Processors/GPIO-toggle-gets-interrupted/m-p/863739#M131691</guid>
      <dc:creator>igorpadykov</dc:creator>
      <dc:date>2019-03-28T23:38:44Z</dc:date>
    </item>
    <item>
      <title>Re: GPIO toggle gets interrupted</title>
      <link>https://community.nxp.com/t5/i-MX-Processors/GPIO-toggle-gets-interrupted/m-p/863740#M131692</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Igor,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; Our device has only one core, and as per our understanding the usage of spinlock should avoid the&amp;nbsp;context switching. &lt;/P&gt;&lt;P&gt;we have tried &lt;EM&gt;spin_lock(), spin_lock_irqsave()&lt;/EM&gt; and &lt;EM&gt;spin_lock_irq()&lt;/EM&gt; but still the toggle cycles get interrupted.&lt;/P&gt;&lt;P&gt;we would like to know whether the issue is related to iomem access or GPIO bus(interrupts)&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;P&gt;Arvind&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 29 Mar 2019 11:52:42 GMT</pubDate>
      <guid>https://community.nxp.com/t5/i-MX-Processors/GPIO-toggle-gets-interrupted/m-p/863740#M131692</guid>
      <dc:creator>arvindprakash</dc:creator>
      <dc:date>2019-03-29T11:52:42Z</dc:date>
    </item>
  </channel>
</rss>

