<?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: imx1050, 2 problems adding lpi2c driver and gpio interrupt for the fxos8700 in zephyr in i.MX Processors</title>
    <link>https://community.nxp.com/t5/i-MX-Processors/imx1050-2-problems-adding-lpi2c-driver-and-gpio-interrupt-for/m-p/733608#M114153</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I found the root cause of the 8700 issue, it looks like the hal lpi2c driver does not handle the missing stop flag. How do the supported RTOSes handle this?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This fixes it, but could cause other problems:&lt;/P&gt;&lt;P&gt;&lt;A class="jivelink2" href="https://github.com/zephyrproject-rtos/zephyr/compare/master...nathantsoi:upstream-zephyr-v1.11.0-mimxrt1050-lpi2c#diff-3c6a2c0da8e7f22a7762cc14dc31cb59R999" title="https://github.com/zephyrproject-rtos/zephyr/compare/master...nathantsoi:upstream-zephyr-v1.11.0-mimxrt1050-lpi2c#diff-3c6a2c0da8e7f22a7762cc14dc31cb59R999"&gt;https://github.com/zephyrproject-rtos/zephyr/compare/master...nathantsoi:upstream-zephyr-v1.11.0-mimxrt1050-lpi2c#diff-3c6a2c0da8e7f22a7762cc14dc31cb59R999&lt;/A&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 05 Apr 2018 21:23:08 GMT</pubDate>
    <dc:creator>natester</dc:creator>
    <dc:date>2018-04-05T21:23:08Z</dc:date>
    <item>
      <title>imx1050, 2 problems adding lpi2c driver and gpio interrupt for the fxos8700 in zephyr</title>
      <link>https://community.nxp.com/t5/i-MX-Processors/imx1050-2-problems-adding-lpi2c-driver-and-gpio-interrupt-for/m-p/733606#M114151</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I have added the lpi2c driver to the imx1050 board in Zephyr to support the fxos8700, however I have a few small issues.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;1. The first issues is that if I send a reset command to the 8700 (I have commented it out of the zephyr 8700 driver here:&amp;nbsp;&lt;A class="jivelink5" href="https://github.com/nathantsoi/zephyr/commit/cd5c79efb8f2857347cccd9e3d9bab71eb889009#diff-fa43f421b96ddd4836ff4c98de0dc796L298" title="https://github.com/nathantsoi/zephyr/commit/cd5c79efb8f2857347cccd9e3d9bab71eb889009#diff-fa43f421b96ddd4836ff4c98de0dc796L298"&gt;https://github.com/nathantsoi/zephyr/commit/cd5c79efb8f2857347cccd9e3d9bab71eb889009#diff-fa43f421b96ddd4836ff4c98de0dc796L298&lt;/A&gt;), the gyro no longer responds to commands and must be power cycled.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;2. Polling mode is working fine, with a few changes to the sensor sample. However interrupt mode is not working.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Here it is in polling mode:&lt;/P&gt;&lt;BLOCKQUOTE class="jive_macro_quote jive-quote jive_text_macro"&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier, monospace;"&gt;***** BOOTING ZEPHYR OS v1.11.0 - BUILD: Mar 24 2018 23:22:52 *****&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier, monospace;"&gt;sampling&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: 'courier new', courier, monospace;"&gt;AX= 0.009576 AY= -0.105345 AZ= 9.710881 MX= -0.100000 MY= -0.291000 MZ= 0.512000 T= 24.960000&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: 'courier new', courier, monospace;"&gt;sampling&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: 'courier new', courier, monospace;"&gt;AX= -0.019154 AY= -0.114922 AZ= 9.873687 MX= -0.095000 MY= -0.323000 MZ= 0.502000 T= 24.960000&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: 'courier new', courier, monospace;"&gt;sampling&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: 'courier new', courier, monospace;"&gt;AX= -0.038308 AY= -0.057461 AZ= 9.835380 MX= -0.107000 MY= -0.319000 MZ= 0.541000 T= 24.000000&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: 'courier new', courier, monospace;"&gt;sampling&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: 'courier new', courier, monospace;"&gt;AX= -0.057461 AY= -0.067038 AZ= 9.854534 MX= -0.083000 MY= -0.305000 MZ= 0.537000 T= 24.960000&lt;/SPAN&gt;&lt;/P&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;However, enabling interrupt mode (by defining this thread&amp;nbsp;&lt;A class="jivelink3" href="https://github.com/nathantsoi/zephyr/commit/cd5c79efb8f2857347cccd9e3d9bab71eb889009#diff-b510f9e7a2d4ac8272d7e86daa389732L9" title="https://github.com/nathantsoi/zephyr/commit/cd5c79efb8f2857347cccd9e3d9bab71eb889009#diff-b510f9e7a2d4ac8272d7e86daa389732L9"&gt;https://github.com/nathantsoi/zephyr/commit/cd5c79efb8f2857347cccd9e3d9bab71eb889009#diff-b510f9e7a2d4ac8272d7e86daa389732L9&lt;/A&gt;&amp;nbsp;and uncommenting the code here:&amp;nbsp;&lt;A class="jivelink4" href="https://github.com/nathantsoi/zephyr/commit/cd5c79efb8f2857347cccd9e3d9bab71eb889009#diff-ca6f35b80be714e06a27edab405f1e5cL53" title="https://github.com/nathantsoi/zephyr/commit/cd5c79efb8f2857347cccd9e3d9bab71eb889009#diff-ca6f35b80be714e06a27edab405f1e5cL53"&gt;https://github.com/nathantsoi/zephyr/commit/cd5c79efb8f2857347cccd9e3d9bab71eb889009#diff-ca6f35b80be714e06a27edab405f1e5cL53&lt;/A&gt;) results in a hard fault:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;BLOCKQUOTE class="jive_macro_quote jive-quote jive_text_macro"&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier, monospace;"&gt;***** MPU FAULT *****&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: 'courier new', courier, monospace;"&gt; Executing thread ID (thread): 0x200004b0&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: 'courier new', courier, monospace;"&gt; Faulting instruction address: 0x504c&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: 'courier new', courier, monospace;"&gt; Data Access Violation&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: 'courier new', courier, monospace;"&gt; Address: 0x0&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: 'courier new', courier, monospace;"&gt;Fatal fault in thread 0x200004b0! Aborting.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: 'courier new', courier, monospace;"&gt;***** HARD FAULT *****&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: 'courier new', courier, monospace;"&gt; Fault escalation (see below)&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: 'courier new', courier, monospace;"&gt;***** MPU FAULT *****&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: 'courier new', courier, monospace;"&gt; Executing thread ID (thread): 0x200004b0&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: 'courier new', courier, monospace;"&gt; Faulting instruction address: 0x4fa8&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: 'courier new', courier, monospace;"&gt; Data Access Violation&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: 'courier new', courier, monospace;"&gt; Address: 0x0&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: 'courier new', courier, monospace;"&gt;Fatal fault in ISR! Spinning...&lt;/SPAN&gt;&lt;/P&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This originates in&lt;SPAN style="font-family: 'courier new', courier, monospace;"&gt;&amp;nbsp;dlist.h&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;BLOCKQUOTE class="jive_macro_quote jive-quote jive_text_macro"&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier, monospace;"&gt;337 static inline void sys_dlist_append(sys_dlist_t *list, sys_dnode_t *node)&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: 'courier new', courier, monospace;"&gt;338 {&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: 'courier new', courier, monospace;"&gt;339 node-&amp;gt;next = list;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: 'courier new', courier, monospace;"&gt;340 node-&amp;gt;prev = list-&amp;gt;tail;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: 'courier new', courier, monospace;"&gt;341&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: 'courier new', courier, monospace;"&gt;342 list-&amp;gt;tail-&amp;gt;next = node;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: 'courier new', courier, monospace;"&gt;343 list-&amp;gt;tail = node;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: 'courier new', courier, monospace;"&gt;344 }&lt;/SPAN&gt;&lt;/P&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;list appears to be 0x0&lt;/P&gt;&lt;BLOCKQUOTE class="jive_macro_quote jive-quote jive_text_macro"&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier, monospace;"&gt;(gdb) p *list&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: 'courier new', courier, monospace;"&gt;$10 = {{head = 0x0 &amp;lt;isr_tables_syms&amp;gt;, next = 0x0 &amp;lt;isr_tables_syms&amp;gt;}, {tail = 0x0 &amp;lt;isr_tables_syms&amp;gt;, prev = 0x0 &amp;lt;isr_tables_syms&amp;gt;}}&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: 'courier new', courier, monospace;"&gt;(gdb) bt&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: 'courier new', courier, monospace;"&gt;#0 0x000050b0 in sys_dlist_append (node=0x200005ac &amp;lt;_main_thread_s&amp;gt;, list=0x2000008c &amp;lt;fxos8700_data+4&amp;gt;) at ../../../../include/misc/dlist.h:342&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: 'courier new', courier, monospace;"&gt;#1 _pend_thread (thread=0x200005ac &amp;lt;_main_thread_s&amp;gt;, wait_q=wait_q@entry=0x2000008c &amp;lt;fxos8700_data+4&amp;gt;, timeout=timeout@entry=-1)&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: 'courier new', courier, monospace;"&gt; at /Users/me/src/embedded/zephyr/kernel/sched.c:197&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: 'courier new', courier, monospace;"&gt;#2 0x000051f8 in _pend_current_thread (wait_q=0x2000008c &amp;lt;fxos8700_data+4&amp;gt;, timeout=-1) at /Users/me/src/embedded/zephyr/kernel/sched.c:215&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: 'courier new', courier, monospace;"&gt;#3 0x0000562c in _impl_k_sem_take (sem=sem@entry=0x2000008c &amp;lt;fxos8700_data+4&amp;gt;, timeout=timeout@entry=-1) at /Users/me/src/embedded/zephyr/kernel/sem.c:175&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: 'courier new', courier, monospace;"&gt;#4 0x000048d2 in k_sem_take (timeout=-1, sem=0x2000008c &amp;lt;fxos8700_data+4&amp;gt;) at zephyr/include/generated/syscalls/kernel.h:79&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: 'courier new', courier, monospace;"&gt;#5 fxos8700_trigger_set (dev=0x20001558 &amp;lt;__device_fxos8700&amp;gt;, trig=0x20000aec &amp;lt;_main_stack+916&amp;gt;, handler=0x1e89 &amp;lt;trigger_handler&amp;gt;)&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: 'courier new', courier, monospace;"&gt; at /Users/me/src/embedded/zephyr/drivers/sensor/fxos8700/fxos8700_trigger.c:149&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: 'courier new', courier, monospace;"&gt;#6 0x00001efa in sensor_trigger_set (handler=0x1e89 &amp;lt;trigger_handler&amp;gt;, trig=0x20000aec &amp;lt;_main_stack+916&amp;gt;, dev=0x20001558 &amp;lt;__device_fxos8700&amp;gt;)&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: 'courier new', courier, monospace;"&gt; at /Users/me/src/embedded/zephyr/include/sensor.h:341&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: 'courier new', courier, monospace;"&gt;#7 main () at ../src/main.c:60&lt;/SPAN&gt;&lt;/P&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;You can see my changes here:&lt;/P&gt;&lt;P&gt;&lt;A class="link-titled" href="https://github.com/nathantsoi/zephyr/commit/cd5c79efb8f2857347cccd9e3d9bab71eb889009" title="https://github.com/nathantsoi/zephyr/commit/cd5c79efb8f2857347cccd9e3d9bab71eb889009"&gt;wip, i2c driver and fxos8700 (non-triggered) support for the imx1050 · nathantsoi/zephyr@cd5c79e · GitHub&lt;/A&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Or checkout the whole branch to run it:&lt;/P&gt;&lt;P&gt;&lt;A class="link-titled" href="https://github.com/nathantsoi/zephyr/tree/upstream-zephyr-v1.11.0-mimxrt1050-lpi2c" title="https://github.com/nathantsoi/zephyr/tree/upstream-zephyr-v1.11.0-mimxrt1050-lpi2c"&gt;GitHub - nathantsoi/zephyr at upstream-zephyr-v1.11.0-mimxrt1050-lpi2c&lt;/A&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Any direction would be much appreciated.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 25 Mar 2018 06:32:53 GMT</pubDate>
      <guid>https://community.nxp.com/t5/i-MX-Processors/imx1050-2-problems-adding-lpi2c-driver-and-gpio-interrupt-for/m-p/733606#M114151</guid>
      <dc:creator>natester</dc:creator>
      <dc:date>2018-03-25T06:32:53Z</dc:date>
    </item>
    <item>
      <title>Re: imx1050, 2 problems adding lpi2c driver and gpio interrupt for the fxos8700 in zephyr</title>
      <link>https://community.nxp.com/t5/i-MX-Processors/imx1050-2-problems-adding-lpi2c-driver-and-gpio-interrupt-for/m-p/733607#M114152</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello &lt;A _jive_internal="true" data-content-finding="Community" data-userid="307200" data-username="natester" href="https://community.nxp.com/people/natester"&gt;Nathan&lt;/A&gt;,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; SDK and drivers for I.MXRT1050 we released are used for applications with non-OS or RTOS ( FreeRTOS), but for Zephyr RTOS, we also don't have corresponding materials for you reference.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Have a nice day!&lt;/P&gt;&lt;P&gt;TIC weidong sun&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 28 Mar 2018 02:19:55 GMT</pubDate>
      <guid>https://community.nxp.com/t5/i-MX-Processors/imx1050-2-problems-adding-lpi2c-driver-and-gpio-interrupt-for/m-p/733607#M114152</guid>
      <dc:creator>weidong_sun</dc:creator>
      <dc:date>2018-03-28T02:19:55Z</dc:date>
    </item>
    <item>
      <title>Re: imx1050, 2 problems adding lpi2c driver and gpio interrupt for the fxos8700 in zephyr</title>
      <link>https://community.nxp.com/t5/i-MX-Processors/imx1050-2-problems-adding-lpi2c-driver-and-gpio-interrupt-for/m-p/733608#M114153</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I found the root cause of the 8700 issue, it looks like the hal lpi2c driver does not handle the missing stop flag. How do the supported RTOSes handle this?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This fixes it, but could cause other problems:&lt;/P&gt;&lt;P&gt;&lt;A class="jivelink2" href="https://github.com/zephyrproject-rtos/zephyr/compare/master...nathantsoi:upstream-zephyr-v1.11.0-mimxrt1050-lpi2c#diff-3c6a2c0da8e7f22a7762cc14dc31cb59R999" title="https://github.com/zephyrproject-rtos/zephyr/compare/master...nathantsoi:upstream-zephyr-v1.11.0-mimxrt1050-lpi2c#diff-3c6a2c0da8e7f22a7762cc14dc31cb59R999"&gt;https://github.com/zephyrproject-rtos/zephyr/compare/master...nathantsoi:upstream-zephyr-v1.11.0-mimxrt1050-lpi2c#diff-3c6a2c0da8e7f22a7762cc14dc31cb59R999&lt;/A&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 05 Apr 2018 21:23:08 GMT</pubDate>
      <guid>https://community.nxp.com/t5/i-MX-Processors/imx1050-2-problems-adding-lpi2c-driver-and-gpio-interrupt-for/m-p/733608#M114153</guid>
      <dc:creator>natester</dc:creator>
      <dc:date>2018-04-05T21:23:08Z</dc:date>
    </item>
  </channel>
</rss>

