<?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>i.MX Processors中的主题 Accessing GPIO in the HAL</title>
    <link>https://community.nxp.com/t5/i-MX-Processors/Accessing-GPIO-in-the-HAL/m-p/767467#M119194</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I am trying to install a RIL into the android system and I am getting errors in the logcat -b radio that looks like this:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;08-08 18:23:28.383 696 696 E IccCardProxy: setExternalState: !override and newstate unchanged from NOT_READY&lt;BR /&gt;08-08 18:23:28.394 260 279 E RIL : EN_3V8 gpio error /sys/class/gpio/gpio66/value (Permission denied)&lt;BR /&gt;08-08 18:23:28.394 260 279 E RIL : EN_3V8 gpio write error 1sys/class/gpio/gpio66/value (Bad file descriptor)&lt;BR /&gt;08-08 18:23:28.395 260 279 E RIL : EN_3V3 lna gpio error /sys/class/gpio/gpio65/value (Permission denied)&lt;BR /&gt;08-08 18:23:28.896 260 279 E RIL : wwan igt gpio error /sys/class/gpio/gpio37/value (Permission denied)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;We used the gpio_export function to generate the gpios in sys devices with the symbolic links shown in the log.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;When I checked the permissions for "value" using ls -l, i saw that the permissions is set to&amp;nbsp;-rw-r--r--. I added code in init.rc&amp;nbsp;to change the permissions for the value of gpio66, gpio65 and gpio37 to&amp;nbsp;-rwxrwxrwx&amp;nbsp;(tried doing it as early as possible in init.rc), I flashed the changes, verified the new permissions took effect and retested. I still got the same error above.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;But this time, I got new errors in the serial trace:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;type=1400 audit(1312802732.420:4): avc: denied { write } for pid=263 comm="rild" name="value" dev="sysfs" ino=17824 scontext=u:r:rild:s0 tcontext=u:object_r:sysfs:s0 tclass=file permissive=0&lt;BR /&gt;type=1400 audit(1312802732.420:5): avc: denied { write } for pid=263 comm="rild" name="value" dev="sysfs" ino=17839 scontext=u:r:rild:s0 tcontext=u:object_r:sysfs:s0 tclass=file permissive=0&lt;BR /&gt;type=1400 audit(1312802732.920:6): avc: denied { write } for pid=263 comm="rild" name="value" dev="sysfs" ino=17855 scontext=u:r:rild:s0 tcontext=u:object_r:sysfs:s0 tclass=file permissive=0&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;These look like Selinux related errors. However, my code was built with "eng" set and I have set&amp;nbsp;androidboot.selinux=disabled in the kernel command line.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Not sure what the proble is. Maybe someone can help?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 05 Apr 2018 07:17:50 GMT</pubDate>
    <dc:creator>mdomondon</dc:creator>
    <dc:date>2018-04-05T07:17:50Z</dc:date>
    <item>
      <title>Accessing GPIO in the HAL</title>
      <link>https://community.nxp.com/t5/i-MX-Processors/Accessing-GPIO-in-the-HAL/m-p/767467#M119194</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I am trying to install a RIL into the android system and I am getting errors in the logcat -b radio that looks like this:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;08-08 18:23:28.383 696 696 E IccCardProxy: setExternalState: !override and newstate unchanged from NOT_READY&lt;BR /&gt;08-08 18:23:28.394 260 279 E RIL : EN_3V8 gpio error /sys/class/gpio/gpio66/value (Permission denied)&lt;BR /&gt;08-08 18:23:28.394 260 279 E RIL : EN_3V8 gpio write error 1sys/class/gpio/gpio66/value (Bad file descriptor)&lt;BR /&gt;08-08 18:23:28.395 260 279 E RIL : EN_3V3 lna gpio error /sys/class/gpio/gpio65/value (Permission denied)&lt;BR /&gt;08-08 18:23:28.896 260 279 E RIL : wwan igt gpio error /sys/class/gpio/gpio37/value (Permission denied)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;We used the gpio_export function to generate the gpios in sys devices with the symbolic links shown in the log.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;When I checked the permissions for "value" using ls -l, i saw that the permissions is set to&amp;nbsp;-rw-r--r--. I added code in init.rc&amp;nbsp;to change the permissions for the value of gpio66, gpio65 and gpio37 to&amp;nbsp;-rwxrwxrwx&amp;nbsp;(tried doing it as early as possible in init.rc), I flashed the changes, verified the new permissions took effect and retested. I still got the same error above.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;But this time, I got new errors in the serial trace:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;type=1400 audit(1312802732.420:4): avc: denied { write } for pid=263 comm="rild" name="value" dev="sysfs" ino=17824 scontext=u:r:rild:s0 tcontext=u:object_r:sysfs:s0 tclass=file permissive=0&lt;BR /&gt;type=1400 audit(1312802732.420:5): avc: denied { write } for pid=263 comm="rild" name="value" dev="sysfs" ino=17839 scontext=u:r:rild:s0 tcontext=u:object_r:sysfs:s0 tclass=file permissive=0&lt;BR /&gt;type=1400 audit(1312802732.920:6): avc: denied { write } for pid=263 comm="rild" name="value" dev="sysfs" ino=17855 scontext=u:r:rild:s0 tcontext=u:object_r:sysfs:s0 tclass=file permissive=0&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;These look like Selinux related errors. However, my code was built with "eng" set and I have set&amp;nbsp;androidboot.selinux=disabled in the kernel command line.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Not sure what the proble is. Maybe someone can help?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 05 Apr 2018 07:17:50 GMT</pubDate>
      <guid>https://community.nxp.com/t5/i-MX-Processors/Accessing-GPIO-in-the-HAL/m-p/767467#M119194</guid>
      <dc:creator>mdomondon</dc:creator>
      <dc:date>2018-04-05T07:17:50Z</dc:date>
    </item>
    <item>
      <title>Re: Accessing GPIO in the HAL</title>
      <link>https://community.nxp.com/t5/i-MX-Processors/Accessing-GPIO-in-the-HAL/m-p/767468#M119195</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Mike&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;one can look at hal usage on&lt;/P&gt;&lt;P&gt;&lt;A class="link-titled" href="https://de.slideshare.net/linaroorg/sfo15505-introducing-i2c-gpio-user-space-apis-for-android" title="https://de.slideshare.net/linaroorg/sfo15505-introducing-i2c-gpio-user-space-apis-for-android"&gt;SFO15-505: Introducing I2C &amp;amp; GPIO user space APIs for Android&lt;/A&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;and post issue on dedicated android forums&lt;/P&gt;&lt;P&gt;&lt;BR /&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, 12 Apr 2018 02:25:51 GMT</pubDate>
      <guid>https://community.nxp.com/t5/i-MX-Processors/Accessing-GPIO-in-the-HAL/m-p/767468#M119195</guid>
      <dc:creator>igorpadykov</dc:creator>
      <dc:date>2018-04-12T02:25:51Z</dc:date>
    </item>
  </channel>
</rss>

