<?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: How to calculate the Linux GPIO number for a certain GPIO pin on i.MX8MQ platform in i.MX Processors</title>
    <link>https://community.nxp.com/t5/i-MX-Processors/How-to-calculate-the-Linux-GPIO-number-for-a-certain-GPIO-pin-on/m-p/2295433#M243454</link>
    <description>&lt;P&gt;Agree with you.&lt;/P&gt;&lt;P&gt;This program by machangbao does not reflect the right understanding of the Linux programming or the knowledge of GPIO. On the contrary, it reflects a completely incorrect understanding of Linux and a lack of proper knowledge about GPIO.&lt;/P&gt;</description>
    <pubDate>Sat, 17 Jan 2026 21:57:59 GMT</pubDate>
    <dc:creator>fepob</dc:creator>
    <dc:date>2026-01-17T21:57:59Z</dc:date>
    <item>
      <title>How to calculate the Linux GPIO number for a certain GPIO pin on i.MX8MQ platform</title>
      <link>https://community.nxp.com/t5/i-MX-Processors/How-to-calculate-the-Linux-GPIO-number-for-a-certain-GPIO-pin-on/m-p/1642010#M205012</link>
      <description>&lt;P&gt;How to calculate the Linux GPIO number for a certain GPIO pin on i.MX8MQ platform?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;For example, i.MX8MQ GPIO3_IO4=&amp;gt; What is GPIO number that I can export the GPIO and control pin direction and value, thanks.&lt;/P&gt;</description>
      <pubDate>Fri, 28 Apr 2023 06:11:23 GMT</pubDate>
      <guid>https://community.nxp.com/t5/i-MX-Processors/How-to-calculate-the-Linux-GPIO-number-for-a-certain-GPIO-pin-on/m-p/1642010#M205012</guid>
      <dc:creator>KyleChang</dc:creator>
      <dc:date>2023-04-28T06:11:23Z</dc:date>
    </item>
    <item>
      <title>Re: How to calculate the Linux GPIO number for a certain GPIO pin on i.MX8MQ platform</title>
      <link>https://community.nxp.com/t5/i-MX-Processors/How-to-calculate-the-Linux-GPIO-number-for-a-certain-GPIO-pin-on/m-p/1642145#M205032</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.nxp.com/t5/user/viewprofilepage/user-id/216520"&gt;@KyleChang&lt;/a&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;To&amp;nbsp;&lt;SPAN&gt;i.MX8MQ GPIO3_IO4: (3 - 1) * 32 + 4 = 68.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;Best regards&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;Harvey&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 28 Apr 2023 08:54:53 GMT</pubDate>
      <guid>https://community.nxp.com/t5/i-MX-Processors/How-to-calculate-the-Linux-GPIO-number-for-a-certain-GPIO-pin-on/m-p/1642145#M205032</guid>
      <dc:creator>Harvey021</dc:creator>
      <dc:date>2023-04-28T08:54:53Z</dc:date>
    </item>
    <item>
      <title>Re: How to calculate the Linux GPIO number for a certain GPIO pin on i.MX8MQ platform</title>
      <link>https://community.nxp.com/t5/i-MX-Processors/How-to-calculate-the-Linux-GPIO-number-for-a-certain-GPIO-pin-on/m-p/1642865#M205111</link>
      <description>&lt;P&gt;Thank you.&lt;/P&gt;</description>
      <pubDate>Tue, 02 May 2023 05:23:32 GMT</pubDate>
      <guid>https://community.nxp.com/t5/i-MX-Processors/How-to-calculate-the-Linux-GPIO-number-for-a-certain-GPIO-pin-on/m-p/1642865#M205111</guid>
      <dc:creator>KyleChang</dc:creator>
      <dc:date>2023-05-02T05:23:32Z</dc:date>
    </item>
    <item>
      <title>Re: How to calculate the Linux GPIO number for a certain GPIO pin on i.MX8MQ platform</title>
      <link>https://community.nxp.com/t5/i-MX-Processors/How-to-calculate-the-Linux-GPIO-number-for-a-certain-GPIO-pin-on/m-p/2295344#M243452</link>
      <description>&lt;DIV&gt;If you're having trouble figuring out how to calculate the GPIO numbers for i.MX series chips, I’d like to share a handy tool to simplify this process! It takes the hassle out of computing i.MX GPIO numbers, ensuring accuracy and saving time for your development work.&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;You can download it from here: &lt;A href="https://github.com/mgkiller7/GpioCalculator/releases/tag/v1.0" target="_blank" rel="noopener"&gt;https://github.com/mgkiller7/GpioCalculator/releases/tag/v1.0&lt;/A&gt;&lt;/DIV&gt;</description>
      <pubDate>Sat, 17 Jan 2026 09:43:21 GMT</pubDate>
      <guid>https://community.nxp.com/t5/i-MX-Processors/How-to-calculate-the-Linux-GPIO-number-for-a-certain-GPIO-pin-on/m-p/2295344#M243452</guid>
      <dc:creator>machangbao</dc:creator>
      <dc:date>2026-01-17T09:43:21Z</dc:date>
    </item>
    <item>
      <title>Re: How to calculate the Linux GPIO number for a certain GPIO pin on i.MX8MQ platform</title>
      <link>https://community.nxp.com/t5/i-MX-Processors/How-to-calculate-the-Linux-GPIO-number-for-a-certain-GPIO-pin-on/m-p/2295372#M243453</link>
      <description>&lt;P&gt;First, the new Linux programming guidelines recommend using libgpio to replace sysfs.&lt;BR /&gt;Because with the new libgpio, the user space acts as a consumer and has a busy state, preventing multiple applications from changing the GPIO state without mutual exclusion.&lt;/P&gt;&lt;P&gt;If you check the new imx linux bsp release, it has already been removed the gpio sysfs support.&lt;/P&gt;&lt;P&gt;Secondly, even the older sysfs has Linux documentation. Regardless of the chip vendor, the Linux BSP must comply with the Linux architecture and programming guidelines.&lt;/P&gt;&lt;P&gt;&lt;A href="https://github.com/nxp-imx/linux-imx/blob/lf-6.12.49-2.2.0/Documentation/admin-guide/gpio/sysfs.rst" target="_blank" rel="noopener"&gt;https://github.com/nxp-imx/linux-imx/blob/lf-6.12.49-2.2.0/Documentation/admin-guide/gpio/sysfs.rst&lt;/A&gt;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;/sys/class/gpio/gpiochipN/

"base" ...
same as N, the first GPIO managed by this chip
"label" ...
provided for diagnostics (not always unique)
"ngpio" ...
how many GPIOs this manages (N to N + ngpio - 1&lt;/LI-CODE&gt;&lt;P&gt;Furthermore, why write a program when an excel table can do the job? Calculating the GPIO number is a very simple task.&lt;BR /&gt;And if you use libgpio, the libgpio tools already help with the calculation.&lt;/P&gt;</description>
      <pubDate>Sat, 17 Jan 2026 10:45:52 GMT</pubDate>
      <guid>https://community.nxp.com/t5/i-MX-Processors/How-to-calculate-the-Linux-GPIO-number-for-a-certain-GPIO-pin-on/m-p/2295372#M243453</guid>
      <dc:creator>meketok</dc:creator>
      <dc:date>2026-01-17T10:45:52Z</dc:date>
    </item>
    <item>
      <title>Re: How to calculate the Linux GPIO number for a certain GPIO pin on i.MX8MQ platform</title>
      <link>https://community.nxp.com/t5/i-MX-Processors/How-to-calculate-the-Linux-GPIO-number-for-a-certain-GPIO-pin-on/m-p/2295433#M243454</link>
      <description>&lt;P&gt;Agree with you.&lt;/P&gt;&lt;P&gt;This program by machangbao does not reflect the right understanding of the Linux programming or the knowledge of GPIO. On the contrary, it reflects a completely incorrect understanding of Linux and a lack of proper knowledge about GPIO.&lt;/P&gt;</description>
      <pubDate>Sat, 17 Jan 2026 21:57:59 GMT</pubDate>
      <guid>https://community.nxp.com/t5/i-MX-Processors/How-to-calculate-the-Linux-GPIO-number-for-a-certain-GPIO-pin-on/m-p/2295433#M243454</guid>
      <dc:creator>fepob</dc:creator>
      <dc:date>2026-01-17T21:57:59Z</dc:date>
    </item>
    <item>
      <title>Re: How to calculate the Linux GPIO number for a certain GPIO pin on i.MX8MQ platform</title>
      <link>https://community.nxp.com/t5/i-MX-Processors/How-to-calculate-the-Linux-GPIO-number-for-a-certain-GPIO-pin-on/m-p/2299167#M243581</link>
      <description>&lt;P&gt;&lt;a href="https://community.nxp.com/t5/user/viewprofilepage/user-id/196155"&gt;@machangbao&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I think your tool is totally wrong.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="185505.png" style="width: 878px;"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/374082i7B36996BFB909B72/image-size/large?v=v2&amp;amp;px=999" role="button" title="185505.png" alt="185505.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;You cannot assume that the base value of GPIO1 on the chip is 0, or that the base value of GPIO2 is 32. This is assigned by the Linux driver, not determined by the chip itself. &lt;STRONG&gt;You can test that the base value of GPIO1 on iMX8MM and iMX93 is not 0. &amp;nbsp;Your tool will fail.&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;On iMX6 GPIO1, the base is 0, but this is a coincidence. And it should be done this way on 32-bit ARM Linux, but not on 64-bit ARM Linux such as i.MX8MM.&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;The calculation formula in the Linux documentation provided by &lt;a href="https://community.nxp.com/t5/user/viewprofilepage/user-id/255516"&gt;@meketok&lt;/a&gt;&amp;nbsp;@ is correct. It is based on the base value.&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;(N to N + ngpio - 1), in other words, you can not assume here base is 0 for GPIO1, base is 32 for GPIO2.&lt;/STRONG&gt;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;/sys/class/gpio/gpiochipN/

"base" ...
same as N, the first GPIO managed by this chip
"label" ...
provided for diagnostics (not always unique)
"ngpio" ...
how many GPIOs this manages (N to N + ngpio - 1)&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have replied to&amp;nbsp;&lt;a href="https://community.nxp.com/t5/user/viewprofilepage/user-id/192970"&gt;@Harvey021&lt;/a&gt;&amp;nbsp;. you are wrong.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 23 Jan 2026 11:21:55 GMT</pubDate>
      <guid>https://community.nxp.com/t5/i-MX-Processors/How-to-calculate-the-Linux-GPIO-number-for-a-certain-GPIO-pin-on/m-p/2299167#M243581</guid>
      <dc:creator>doyayax</dc:creator>
      <dc:date>2026-01-23T11:21:55Z</dc:date>
    </item>
    <item>
      <title>Re: How to calculate the Linux GPIO number for a certain GPIO pin on i.MX8MQ platform</title>
      <link>https://community.nxp.com/t5/i-MX-Processors/How-to-calculate-the-Linux-GPIO-number-for-a-certain-GPIO-pin-on/m-p/2299168#M243582</link>
      <description>&lt;P&gt;&lt;a href="https://community.nxp.com/t5/user/viewprofilepage/user-id/192970"&gt;@Harvey021&lt;/a&gt;&amp;nbsp; you&amp;nbsp;are&amp;nbsp;wrong.&lt;/P&gt;</description>
      <pubDate>Fri, 23 Jan 2026 11:18:52 GMT</pubDate>
      <guid>https://community.nxp.com/t5/i-MX-Processors/How-to-calculate-the-Linux-GPIO-number-for-a-certain-GPIO-pin-on/m-p/2299168#M243582</guid>
      <dc:creator>doyayax</dc:creator>
      <dc:date>2026-01-23T11:18:52Z</dc:date>
    </item>
    <item>
      <title>Re: How to calculate the Linux GPIO number for a certain GPIO pin on i.MX8MQ platform</title>
      <link>https://community.nxp.com/t5/i-MX-Processors/How-to-calculate-the-Linux-GPIO-number-for-a-certain-GPIO-pin-on/m-p/2300124#M243600</link>
      <description>&lt;a href="https://community.nxp.com/t5/user/viewprofilepage/user-id/256869"&gt;@doyayax&lt;/a&gt; Thanks for pointing out the issue!&lt;BR /&gt;I did assume the base value of GPIO1 on the chip is 0 and GPIO2 is 32 — this is because this was the actual case on the i.MX6ULL and i.MX8MP platforms I tested with, and the tool worked fine in all my test scenarios. I truly didn’t take into account the differences in GPIO base value allocations on the iMX8MM and iMX93 platforms, which is an oversight on my part. My apologies for any confusion this may have caused everyone.</description>
      <pubDate>Mon, 26 Jan 2026 04:43:28 GMT</pubDate>
      <guid>https://community.nxp.com/t5/i-MX-Processors/How-to-calculate-the-Linux-GPIO-number-for-a-certain-GPIO-pin-on/m-p/2300124#M243600</guid>
      <dc:creator>machangbao</dc:creator>
      <dc:date>2026-01-26T04:43:28Z</dc:date>
    </item>
  </channel>
</rss>

