<?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>NRF52840dk - Unable to get ism330dhcx on SPI working</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/98991/nrf52840dk---unable-to-get-ism330dhcx-on-spi-working</link><description>Hello. Im having some problems trying to read data from an IMU with the Sensor driver using the NRF52840 dev kit in SPI, with the Nordic 2.3 SDK. I use the NRF connect extension in vscode. 
 
 I believe my issue is with the device tree overlay, as once</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Mon, 08 May 2023 13:27:40 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/98991/nrf52840dk---unable-to-get-ism330dhcx-on-spi-working" /><item><title>RE: NRF52840dk - Unable to get ism330dhcx on SPI working</title><link>https://devzone.nordicsemi.com/thread/424304?ContentTypeID=1</link><pubDate>Mon, 08 May 2023 13:27:40 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:ddbe2ffe-bd16-4f24-a22a-e30988768210</guid><dc:creator>Jared</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;I see that you&amp;#39;ve posted the question in the discussion on Github, I think this issue is a driver issue.&amp;nbsp; Hopefully some of the developers can either provide a fix or explain why this happens.&lt;/p&gt;
&lt;p&gt;regards&lt;/p&gt;
&lt;p&gt;Jared&amp;nbsp;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: NRF52840dk - Unable to get ism330dhcx on SPI working</title><link>https://devzone.nordicsemi.com/thread/423614?ContentTypeID=1</link><pubDate>Wed, 03 May 2023 16:12:10 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:0156271f-1fec-48c6-8bfe-44aed53e09b8</guid><dc:creator>flamerten</dc:creator><description>&lt;p&gt;Hi Jared&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Thanks for helping with the issue. Although from an initial viewpoint the problem is fixed, I still run into a problem as the IMU does not pass the device_is_ready stage.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;[00:00:00.377,807] &amp;lt;inf&amp;gt; basic_IMU: Unable to retrieve IMU
[00:00:00.250,488] &amp;lt;inf&amp;gt; ISM330DHCX: chip id 0x0, chip id should be 0x6b
[00:00:00.250,518] &amp;lt;dbg&amp;gt; ISM330DHCX: ism330dhcx_init_chip: Invalid chip id 0x0
[00:00:00.250,549] &amp;lt;dbg&amp;gt; ISM330DHCX: ism330dhcx_init: failed to initialize chip
*** Booting Zephyr OS build v3.2.99-ncs2 ***
[00:00:00.250,640] &amp;lt;inf&amp;gt; basic_IMU: Error: Device &amp;quot;ism330dhcx@0&amp;quot; is not ready; check the driver initialization logs for errors.

[00:00:00.250,640] &amp;lt;inf&amp;gt; basic_IMU: Unable to retrieve IMU&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;I have looked deeper into the fix made and I have noticed that the user had an additional line at line 107 that my version of Zephyr does not have. This line fails compilation.&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;data-&amp;gt;ctx_spi.mdelay = (stmdev_mdelay_ptr) stmemsc_mdelay;&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;EDIT: To solve this, I updated the ST ISM330DHCX driver, specifically the one found at&amp;nbsp;&lt;a href="https://github.com/zephyrproject-rtos/hal_st/tree/master/sensor/stmemsc/ism330dhcx_STdC/driver"&gt;hal_st/sensor/stmemsc/ism330dhcx_STdC/driver at master &amp;middot; zephyrproject-rtos/hal_st (github.com)&lt;/a&gt;&amp;nbsp;and also updated the ISM drivers provided by Zephyr. So I&amp;#39;m not too sure why there is still the issue. I am able to use SPI with another microcontroller which eliminates any wiring issues&lt;/p&gt;
&lt;p&gt;I will request for more information from the user on the Github repo, and update if there was any fix made. Im not too sure why the line was not originally in my version of Zephyr. Can you confirm that this is a Zephyr Driver issue, and not solely restricted to the particular board I am using?&amp;nbsp;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: NRF52840dk - Unable to get ism330dhcx on SPI working</title><link>https://devzone.nordicsemi.com/thread/423524?ContentTypeID=1</link><pubDate>Wed, 03 May 2023 11:54:46 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:96a084ed-7f4e-4746-98a9-6887b9a11f4c</guid><dc:creator>Jared</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;There was a &lt;a href="https://github.com/zephyrproject-rtos/zephyr/pull/57406"&gt;new fix&lt;/a&gt; applied to the driver that seems to be directed to this bug, can you try to apply the fix and see if it fixed your issue? At my end it seems to have fixed the bug, but the program still doesn&amp;#39;t reach main(), I think it&amp;#39;s because I don&amp;#39;t have the sensor connected. Can you confirm?&lt;/p&gt;
&lt;p&gt;regards&lt;/p&gt;
&lt;p&gt;Jared&amp;nbsp;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: NRF52840dk - Unable to get ism330dhcx on SPI working</title><link>https://devzone.nordicsemi.com/thread/422780?ContentTypeID=1</link><pubDate>Thu, 27 Apr 2023 13:58:38 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:7e3936ef-841e-493e-b875-183d3fe6abcb</guid><dc:creator>Jared</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;For some reason only parts of the zip was downloaded last time, I now see that the whole project is already included. I&amp;#39;m able to reproduce your issue on my end.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Looks like some of the parameters that is passed to&amp;nbsp;transceive() in&amp;nbsp;spi_transceive() is causing the fault. I&amp;#39;m not entirely sure which, let me get back to you on this,&lt;/p&gt;
&lt;div&gt;
&lt;div&gt;&lt;span&gt;&amp;nbsp;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span&gt;regards&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span&gt;Jared&lt;/span&gt;&lt;/div&gt;
&lt;/div&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: NRF52840dk - Unable to get ism330dhcx on SPI working</title><link>https://devzone.nordicsemi.com/thread/422732?ContentTypeID=1</link><pubDate>Thu, 27 Apr 2023 12:14:23 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:d5e4947b-27b1-4653-a2c6-f91283a2983d</guid><dc:creator>flamerten</dc:creator><description>&lt;p&gt;Hi Jared, may i know what details of the project are needed? I have provided all the relevant files in the zip file in the comment above. The development board is the NRF52840DK and the exact sensor I was using is &lt;a href="https://www.adafruit.com/product/4502"&gt;Adafruit ISM330DHCX&lt;/a&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: NRF52840dk - Unable to get ism330dhcx on SPI working</title><link>https://devzone.nordicsemi.com/thread/422728?ContentTypeID=1</link><pubDate>Thu, 27 Apr 2023 12:01:51 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:2053592f-efe5-4319-8140-50e84b045888</guid><dc:creator>Jared</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;Could you share your project?&amp;nbsp;&lt;/p&gt;
&lt;p&gt;I would like to reproduce this on my end.&lt;/p&gt;
&lt;p&gt;regards&lt;/p&gt;
&lt;p&gt;Jared&amp;nbsp;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: NRF52840dk - Unable to get ism330dhcx on SPI working</title><link>https://devzone.nordicsemi.com/thread/422316?ContentTypeID=1</link><pubDate>Tue, 25 Apr 2023 13:32:58 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:a54823d2-daf1-447e-a26e-8444ab55b9d2</guid><dc:creator>flamerten</dc:creator><description>&lt;p&gt;Hi Jared&lt;/p&gt;
&lt;p&gt;Attached below is my project directory, with the latest build &lt;a href="https://devzone.nordicsemi.com/cfs-file/__key/communityserver-discussions-components-files/4/basic_5F00_imu.zip"&gt;devzone.nordicsemi.com/.../basic_5F00_imu.zip&lt;/a&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: NRF52840dk - Unable to get ism330dhcx on SPI working</title><link>https://devzone.nordicsemi.com/thread/422311?ContentTypeID=1</link><pubDate>Tue, 25 Apr 2023 13:18:01 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:d260611e-4b00-475a-ae03-97ff07194f90</guid><dc:creator>Jared</dc:creator><description>&lt;p&gt;Hi,&lt;br /&gt;&lt;br /&gt;Can you share your build folder?&lt;/p&gt;
&lt;p&gt;regards&lt;br /&gt;Jared&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: NRF52840dk - Unable to get ism330dhcx on SPI working</title><link>https://devzone.nordicsemi.com/thread/422077?ContentTypeID=1</link><pubDate>Mon, 24 Apr 2023 13:38:28 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:c26bb7b3-fca6-403d-ab32-cf98d1967b05</guid><dc:creator>flamerten</dc:creator><description>&lt;p&gt;Hi Jared&lt;/p&gt;
&lt;p&gt;In the main program, I only call printk()&lt;/p&gt;
&lt;p&gt;Yes I have tried using addr2line and I have found the issue, which looks like its from the SPI driver. For reference, I have include the link to these lines.&lt;/p&gt;
&lt;p&gt;&lt;a href="https://github.com/zephyrproject-rtos/zephyr/blob/63e7f106eac5047313b96bfe06377b54d450fd66/include/zephyr/drivers/spi.h#L595"&gt;https://github.com/zephyrproject-rtos/zephyr/blob/63e7f106eac5047313b96bfe06377b54d450fd66/include/zephyr/drivers/spi.h#L595&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&lt;a href="https://github.com/zephyrproject-rtos/zephyr/blob/63e7f106eac5047313b96bfe06377b54d450fd66/drivers/sensor/ism330dhcx/ism330dhcx_spi.c#L57"&gt;https://github.com/zephyrproject-rtos/zephyr/blob/63e7f106eac5047313b96bfe06377b54d450fd66/drivers/sensor/ism330dhcx/ism330dhcx_spi.c#L57&lt;/a&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Im trying to understand why this error is being caused, It seems&amp;nbsp;&lt;span&gt;spi_transceive_dt() is not successful due to a driver issue.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;PS C:\ncs\myapps\basic_imu\build&amp;gt; addr2line -e zephyr/zephyr.elf 0x0000d6d2
C:/ncs/v2.3.0/zephyr/include/zephyr/drivers/spi.h:595
PS C:\ncs\myapps\basic_imu\build&amp;gt; addr2line -e zephyr/zephyr.elf 0x0000d72f
C:/ncs/v2.3.0/zephyr/drivers/sensor/ism330dhcx/ism330dhcx_spi.c:57&lt;/pre&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: NRF52840dk - Unable to get ism330dhcx on SPI working</title><link>https://devzone.nordicsemi.com/thread/422060?ContentTypeID=1</link><pubDate>Mon, 24 Apr 2023 13:01:18 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:18b11ace-6ae0-47ba-a225-c6b3408592fe</guid><dc:creator>Jared</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;Are you only calling printk() in your program, nothing else?&lt;/p&gt;
&lt;p&gt;Could you try what my colleague Edvin is suggesting in &lt;a href="https://devzone.nordicsemi.com/f/nordic-q-a/84170/bus-fault---precise-data-bus-error/350217"&gt;this &lt;/a&gt;thread? Use&amp;nbsp;&lt;span&gt;addr2line&amp;nbsp;and the&amp;nbsp;Faulting instruction address to pinpoint what function is causing the assert in your code,&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;regards&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;Jared&amp;nbsp;&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: NRF52840dk - Unable to get ism330dhcx on SPI working</title><link>https://devzone.nordicsemi.com/thread/422016?ContentTypeID=1</link><pubDate>Mon, 24 Apr 2023 11:26:31 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:3a5b3e0b-aaa0-466e-bffa-bbe779b0b050</guid><dc:creator>flamerten</dc:creator><description>&lt;p&gt;Hello as an update, I enabled logging to see the output of the Sensor API and Sensor Driver.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Here are the results. It seems to go into an infinite loop, though Im not exactly sure where the error is coming from.&lt;/p&gt;
&lt;p&gt;[00:00:00.376,464] &amp;lt;err&amp;gt; os: ***** BUS FAULT *****&lt;br /&gt;[00:00:00.376,495] &amp;lt;err&amp;gt; os: Precise data bus error&lt;br /&gt;[00:00:00.376,495] &amp;lt;err&amp;gt; os: BFAR Address: 0xff4672b5&lt;br /&gt;[00:00:00.376,525] &amp;lt;err&amp;gt; os: r0/a1: 0x00005285 r1/a2: 0x00000010 r2/a3: 0xff4672b5&lt;br /&gt;[00:00:00.376,525] &amp;lt;err&amp;gt; os: r3/a4: 0x2000286c r12/ip: 0x20002884 r14/lr: 0x0000d71b&lt;br /&gt;[00:00:00.376,556] &amp;lt;err&amp;gt; os: xpsr: 0x01000000&lt;br /&gt;[00:00:00.376,556] &amp;lt;err&amp;gt; os: Faulting instruction address (r15/pc): 0x0000d6be&lt;br /&gt;[00:00:00.376,586] &amp;lt;err&amp;gt; os: &amp;gt;&amp;gt;&amp;gt; ZEPHYR FATAL ERROR 0: CPU exception on CPU 0&lt;br /&gt;[00:00:00.376,617] &amp;lt;err&amp;gt; os: Current thread: 0x200008d0 (main)&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: NRF52840dk - Unable to get ism330dhcx on SPI working</title><link>https://devzone.nordicsemi.com/thread/421844?ContentTypeID=1</link><pubDate>Fri, 21 Apr 2023 18:31:22 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:73a55f2d-2dca-4add-ac3c-0d6957336be8</guid><dc:creator>nordicator_prim3</dc:creator><description>&lt;p&gt;Perhaps the SPI driver for that device is getting hung somewhere. Have you tried reading the driver and placing some printk&amp;#39;s to see if it&amp;#39;s getting through the driver&amp;#39;s init function? If it were to hang in the init function, then the device would never boot, so you wouldn&amp;#39;t see your Hello World or anything else that happens in main.c.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>