<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="https://devzone.nordicsemi.com/cfs-file/__key/system/syndication/rss.xsl" media="screen"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:wfw="http://wellformedweb.org/CommentAPI/" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>BMI160 sample on custom nRF9160</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/73433/bmi160-sample-on-custom-nrf9160</link><description>I&amp;#39;m trying to get the bmi160 sample to work with my custom nRF9160 board. I think the sample is quite old and not maintained. Unmodified (except fixing pure compilation errors, like k_sleep(300) / s32_t etc.), it does not automatically configure SPI to</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Thu, 15 Apr 2021 13:33:05 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/73433/bmi160-sample-on-custom-nrf9160" /><item><title>RE: BMI160 sample on custom nRF9160</title><link>https://devzone.nordicsemi.com/thread/305127?ContentTypeID=1</link><pubDate>Thu, 15 Apr 2021 13:33:05 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:2fa84f3a-fe3d-4e72-a62f-db66263f790c</guid><dc:creator>Hakon</dc:creator><description>[quote user="okwestern"]What would you think is the best route? To continue troubleshooting the driver I&amp;#39;ve enclosed above (which is a part of zephyr), or post the new driver&amp;nbsp;and get help correcting the driver/sensor api link?[/quote]
&lt;p&gt;&amp;nbsp;I think you should keep debugging the original code and try figuring out why it triggers MPU fault. There are a couple of things you can try.&lt;/p&gt;
&lt;p&gt;You should include the following lines in prj.conf&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;CONFIG_DEBUG=y
CONFIG_THREAD_NAME=y
CONFIG_EXTRA_EXCEPTION_INFO=y&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;for more detailed debug information.&lt;/p&gt;
&lt;p&gt;You can also look up the faulting instruction address, by running the command below,&lt;pre class="ui-code" data-mode="text"&gt;arm-none-eabi-addr2line 0x43204950 -e zephyr.elf&lt;/pre&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: BMI160 sample on custom nRF9160</title><link>https://devzone.nordicsemi.com/thread/304585?ContentTypeID=1</link><pubDate>Tue, 13 Apr 2021 13:46:43 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:ea456436-b17b-43e7-a069-03c883af69fc</guid><dc:creator>okwestern</dc:creator><description>&lt;p&gt;I completely re-wrote the SPI part of the bmi160 library to accept chip select based on the &amp;quot;lis2dh&amp;quot; driver, and now it completes the initiation and startup, and tries to read (fetch_sample), but it only gets static temp/acc/gyro data (doesn&amp;#39;t change with movement). And same exact&amp;nbsp;readings&amp;nbsp;for&amp;nbsp;three boards. I&amp;#39;m suspecting the link between my driver and the sensor API.&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;[00:00:00.402,191] [0m&amp;lt;inf&amp;gt; BMI160: Compiled: Apr  6 2021 05:40:23[0m
[00:00:00.402,191] [0m&amp;lt;inf&amp;gt; BMI160: master found: SPI_1[0m
[00:00:00.402,221] [0m&amp;lt;dbg&amp;gt; BMI160.bmi160_spi_init: SPI GPIO CS configured on GPIO_0:8[0m
[00:00:00.402,221] [1;31m&amp;lt;err&amp;gt; BMI160: gpio conf ok...[0m
[00:00:00.402,221] [0m&amp;lt;inf&amp;gt; BMI160: pins sat[0m
[00:00:00.502,349] [0m&amp;lt;dbg&amp;gt; BMI160.bmi160_init: reboot chip ok..[0m
[00:00:00.503,417] [0m&amp;lt;dbg&amp;gt; BMI160.bmi160_init: read from 0x7F ok..[0m
[00:00:00.503,570] [0m&amp;lt;dbg&amp;gt; BMI160.bmi160_init: read chip id ok..[0m
[00:00:00.503,570] [0m&amp;lt;dbg&amp;gt; BMI160.bmi160_init: chip id: d1[0m
[00:00:00.561,859] [0m&amp;lt;dbg&amp;gt; BMI160.bmi160_init: set power mode ok...[0m
[00:00:00.561,920] [0m&amp;lt;dbg&amp;gt; BMI160.bmi160_init: set default range for accelerometer ok...[0m
[00:00:00.561,981] [0m&amp;lt;dbg&amp;gt; BMI160.bmi160_init: set default range for gyroscope ok...[0m
[00:00:00.562,103] [0m&amp;lt;dbg&amp;gt; BMI160.bmi160_init: set accel&amp;#39;s default ODR ok...[0m
[00:00:00.562,225] [0m&amp;lt;dbg&amp;gt; BMI160.bmi160_init: set gyro&amp;#39;s default ODR ok...[0m
*** Booting Zephyr OS build zephyr-v2.5.0-352-gd96c517bab0d  ***

BMI160 driver/sample...

Gyro: Device found.

set accelerometer range ok.

set gyro range ok.

HW calibration ok.

Testing the polling mode.

Gyro (rad/s): X=2.596426, Y=0, Z=0

Acc (m/s^2): X=0, Y=0, Z=0

Temperature (Celsius): 33.038420

Gyro (rad/s): X=2.596426, Y=0, Z=0

Acc (m/s^2): X=0, Y=0, Z=0

Temperature (Celsius): 33.038420

Gyro (rad/s): X=2.596426, Y=0, Z=0

Acc (m/s^2): X=0, Y=0, Z=0

Temperature (Celsius): 33.038420&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;What would you think is the best route? To continue troubleshooting the driver I&amp;#39;ve enclosed above (which is a part of zephyr), or post the new driver&amp;nbsp;and get help correcting the driver/sensor api link?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: BMI160 sample on custom nRF9160</title><link>https://devzone.nordicsemi.com/thread/304579?ContentTypeID=1</link><pubDate>Tue, 13 Apr 2021 13:39:13 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:c04f0434-0367-4dcf-a09f-0aa6ba8448ad</guid><dc:creator>okwestern</dc:creator><description>&lt;p&gt;That didn&amp;#39;t help...&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;[00:00:00.754,821] .[0m&amp;lt;inf&amp;gt; BMI160: SPI master controller found: SPI_1..[0m
[00:00:00.754,913] .[0m&amp;lt;inf&amp;gt; BMI160: reboot OK..[0m
[00:00:00.755,981] .[0m&amp;lt;inf&amp;gt; BMI160: Can read from 0x7F...[0m
[00:00:00.756,134] .[0m&amp;lt;inf&amp;gt; BMI160: Read chip OK..[0m
[00:00:00.856,262] .[0m&amp;lt;inf&amp;gt; BMI160: CHIP_ID OK (0xd1)!.[0m
[00:00:01.014,953] .[0m&amp;lt;inf&amp;gt; BMI160: set power mode ok..[0m
[00:00:01.015,014] .[0m&amp;lt;inf&amp;gt; BMI160: set default accelerometer range ok..[0m
[00:00:01.015,075] .[0m&amp;lt;inf&amp;gt; BMI160: set default gyroscope range ok..[0m
[00:00:01.015,228] .[0m&amp;lt;inf&amp;gt; BMI160: set accel&amp;#39;s default ODR ok..[0m
[00:00:01.015,350] .[0m&amp;lt;inf&amp;gt; BMI160: set set gyro&amp;#39;s default ODR ok..[0m
[00:00:01.015,441] .[1;31m&amp;lt;err&amp;gt; spi_nrfx_spim: Slave mode is not supported on SPI_1.[0m
[00:00:01.015,441] .[1;31m&amp;lt;err&amp;gt; os: ***** MPU FAULT *****.[0m
[00:00:01.015,441] .[1;31m&amp;lt;err&amp;gt; os:   Instruction Access Violation.[0m
[00:00:01.015,472] .[1;31m&amp;lt;err&amp;gt; os: r0/a1:  0x20000140  r1/a2:  0x20000518  r2/a3:  0x00000001.[0m
[00:00:01.015,472] .[1;31m&amp;lt;err&amp;gt; os: r3/a4:  0x43204950 r12/ip:  0x00000000 r14/lr:  0x00004ea9.[0m
[00:00:01.015,472] .[1;31m&amp;lt;err&amp;gt; os:  xpsr:  0x08000000.[0m
[00:00:01.015,472] .[1;31m&amp;lt;err&amp;gt; os: Faulting instruction address (r15/pc): 0x43204950.[0m
[00:00:01.015,472] .[1;31m&amp;lt;err&amp;gt; os: &amp;gt;&amp;gt;&amp;gt; ZEPHYR FATAL ERROR 0: CPU exception on CPU 0.[0m
[00:00:01.015,502] .[1;31m&amp;lt;err&amp;gt; os: Current thread: 0x200002b8 (unknown).[0m
[00:00:01.137,115] .[1;31m&amp;lt;err&amp;gt; os: Halting system.[0m
&lt;/pre&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: BMI160 sample on custom nRF9160</title><link>https://devzone.nordicsemi.com/thread/304567?ContentTypeID=1</link><pubDate>Tue, 13 Apr 2021 13:21:57 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:fcbac227-211e-4859-b80e-c07d37b4a6d7</guid><dc:creator>Hakon</dc:creator><description>&lt;p&gt;Hello,&lt;/p&gt;
&lt;p&gt;can you try increasing the main stack size? You can set the stack size in prj.conf;&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;CONFIG_MAIN_STACK_SIZE=4096&lt;/pre&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>