<?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>nRF Connect SDK machine learning application simulated sensor build problem</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/82048/nrf-connect-sdk-machine-learning-application-simulated-sensor-build-problem</link><description>Hardware: nrf52840 DK. 
 Software: ncs version v1.7.0 and default SEGGER IDE for Nordic. 
 When I first build the machine learning application in nrf, there is no any problems. Because nrf52840 DK uses simulated sensor, so we want to add our own custom</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Mon, 29 Nov 2021 08:37:35 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/82048/nrf-connect-sdk-machine-learning-application-simulated-sensor-build-problem" /><item><title>RE: nRF Connect SDK machine learning application simulated sensor build problem</title><link>https://devzone.nordicsemi.com/thread/340999?ContentTypeID=1</link><pubDate>Mon, 29 Nov 2021 08:37:35 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:b6533b4a-5632-4bd2-917d-b39801c2cc65</guid><dc:creator>Marte Myrvold</dc:creator><description>&lt;p&gt;&lt;strong&gt;&lt;/strong&gt;Hi,&lt;/p&gt;
&lt;p&gt;In your overlay file you are using pins 19 and 22 for I2C0. These are by default used by QSPI on nRF52840 DK.&amp;nbsp;Is&amp;nbsp;QSPI disabled so that the pins are available? You must make sure to either use pins that are not used by anything else, by either using pins that are available or disabling whatever is already using them. You can see which pins are used and by what in the board file&amp;nbsp;zephyr/boards/arm/nrf52840dk_nrf52840/nrf52840dk_nrf52840.dts and here&amp;nbsp;&lt;a href="https://infocenter.nordicsemi.com/topic/ug_nrf52840_dk/UG/dk/connector_if.html"&gt;nRF52840 DK &amp;gt; Connector interface&lt;/a&gt;. If you want to use these pins and do not use QSPI you can disable it in your overlay file by adding the following:&lt;/p&gt;
&lt;div&gt;
&lt;div&gt;&lt;code&gt;&lt;span&gt;&amp;amp;&lt;/span&gt;&lt;span&gt;qspi&lt;/span&gt;&lt;span&gt;{&lt;/span&gt;&lt;/code&gt;&lt;/div&gt;
&lt;div&gt;&lt;code&gt;&lt;span&gt;&amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;span&gt;status&lt;/span&gt;&lt;span&gt;&amp;nbsp;=&amp;nbsp;&lt;/span&gt;&lt;span&gt;&amp;quot;disabled&amp;quot;&lt;/span&gt;&lt;span&gt;;&lt;/span&gt;&lt;/code&gt;&lt;/div&gt;
&lt;div&gt;&lt;code&gt;&lt;span&gt;};&lt;/span&gt;&lt;/code&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;Have you tested whether you are able to get the sensor to work and get correct sensor readings using a simpler example that just read and print the sensor values?&lt;/p&gt;
&lt;p&gt;Best regards,&lt;/p&gt;
&lt;p&gt;Marte&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nRF Connect SDK machine learning application simulated sensor build problem</title><link>https://devzone.nordicsemi.com/thread/340813?ContentTypeID=1</link><pubDate>Fri, 26 Nov 2021 01:01:33 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:f314b848-0e93-42ea-9bd0-e767e3f20d8e</guid><dc:creator>NanWang</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;I use following code to get the sensor data:&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="c_cpp"&gt;const struct device *accel;
        struct sensor_value accel_x;
        struct sensor_value accel_y;
        struct sensor_value accel_z;

        static uint8_t buf[BUF_SIZE];
        
        // Initialize the sensor
        accel = device_get_binding(&amp;quot;LIS2DW12&amp;quot;);
        if (accel == NULL)
        {
            LOG_ERR(&amp;quot;No device LIS2DW12 found, did initialization fail&amp;quot;);
        }
        else
        {
            LOG_INF(&amp;quot;Found device LIS2DW12&amp;quot;);
        }

        // Read from the sensor
        if(accel)
        {
            while (1) {
                sensor_sample_fetch(accel);
                sensor_channel_get(accel, SENSOR_CHAN_ACCEL_X, &amp;amp;accel_x);
                sensor_channel_get(accel, SENSOR_CHAN_ACCEL_Y, &amp;amp;accel_y);
                sensor_channel_get(accel, SENSOR_CHAN_ACCEL_Z, &amp;amp;accel_z);

                // Add more check
                LOG_INF(&amp;quot;LIS2DW12 Sensor data: X: %.2f, Y: %.2f, Z: %.2f&amp;quot;,
                        sensor_value_to_double(&amp;amp;accel_x),
                        sensor_value_to_double(&amp;amp;accel_y),
                        sensor_value_to_double(&amp;amp;accel_z));
                k_sleep(K_MSEC(100));
                }
        }&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;By the way, I don&amp;#39;t modify the simulated sensor configuration and its related code in this machine learning application and I just add a new acceleration sensor(&lt;span&gt;LIS2DW12&lt;/span&gt;) and use the above code to read sensor data. And I have already sent you new sensor configuration(&lt;span&gt;LIS2DW12&lt;/span&gt;). Thanks.&lt;/p&gt;
&lt;p&gt;BRs.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nRF Connect SDK machine learning application simulated sensor build problem</title><link>https://devzone.nordicsemi.com/thread/340715?ContentTypeID=1</link><pubDate>Thu, 25 Nov 2021 12:25:41 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:c4e1129a-4252-4c6d-a6e3-52220275091e</guid><dc:creator>Marte Myrvold</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;What are you using to get the data in main? If you test following the steps in the documentation (&lt;a href="https://developer.nordicsemi.com/nRF_Connect_SDK/doc/1.7.1/nrf/applications/machine_learning/README.html#testing-with-the-nrf52840-dk"&gt;Testing with the nRF52840 DK&lt;/a&gt;), just with your sensor instead of the simulated sensor, are the values still 0 in step 6?&lt;/p&gt;
&lt;p&gt;Best regards,&lt;/p&gt;
&lt;p&gt;Marte&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nRF Connect SDK machine learning application simulated sensor build problem</title><link>https://devzone.nordicsemi.com/thread/340660?ContentTypeID=1</link><pubDate>Thu, 25 Nov 2021 08:38:23 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:e6b00c53-775f-4b70-a001-e49a17e9273f</guid><dc:creator>NanWang</dc:creator><description>&lt;p&gt;Hi, Marte:&lt;/p&gt;
&lt;p&gt;Thank your for your quick response. After I delete the build folder completely, everything is OK. I want to add&amp;nbsp;&lt;span&gt;LIS2DW12 sensor and I add following configuration in app_ZDebug.conf:&lt;/span&gt;&lt;/p&gt;
&lt;p style="padding-left:30px;"&gt;&lt;span&gt;# Using lis2dw12 ST sensor&lt;br /&gt;CONFIG_LIS2DW12=y&lt;br /&gt;CONFIG_I2C=y&lt;br /&gt;CONFIG_I2C_NRFX=y&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;I also add following things in dts.overlay:&lt;/span&gt;&lt;/p&gt;
&lt;p style="padding-left:30px;"&gt;&lt;span&gt;&amp;amp;i2c0 {&lt;br /&gt; compatible = &amp;quot;nordic,nrf-twim&amp;quot;;&lt;br /&gt; status = &amp;quot;okay&amp;quot;;&lt;br /&gt; sda-pin = &amp;lt; 22 &amp;gt;;&lt;br /&gt; scl-pin = &amp;lt; 19 &amp;gt;;&lt;br /&gt; clock-frequency = &amp;lt;I2C_BITRATE_STANDARD&amp;gt;;&lt;br /&gt; &lt;br /&gt; lisdw12@31 {&lt;br /&gt; compatible = &amp;quot;st,lis2dw12&amp;quot;;&lt;br /&gt; reg = &amp;lt;0x19&amp;gt;;&lt;br /&gt; label = &amp;quot;LIS2DW12&amp;quot;;&lt;br /&gt; };&lt;br /&gt;};&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;Then I want get the sensor acceleration data of&amp;nbsp; LIS2DW12 sensor in main function, but I get the following output:&lt;/span&gt;&lt;/p&gt;
&lt;p style="padding-left:30px;"&gt;&lt;span&gt;[00:00:07.981,994] &amp;lt;inf&amp;gt; main: LIS2DW12 Sensor data: X: 0.00, Y: 0.00, Z: 0.00&lt;br /&gt;[00:00:08.083,099] &amp;lt;inf&amp;gt; main: LIS2DW12 Sensor data: X: 0.00, Y: 0.00, Z: 0.00&lt;br /&gt;[00:00:08.184,173] &amp;lt;inf&amp;gt; main: LIS2DW12 Sensor data: X: 0.00, Y: 0.00, Z: 0.00&lt;br /&gt;[00:00:08.285,247] &amp;lt;inf&amp;gt; main: LIS2DW12 Sensor data: X: 0.00, Y: 0.00, Z: 0.00&lt;br /&gt;[00:00:08.386,322] &amp;lt;inf&amp;gt; main: LIS2DW12 Sensor data: X: 0.00, Y: 0.00, Z: 0.00&lt;br /&gt;[00:00:08.487,396] &amp;lt;inf&amp;gt; main: LIS2DW12 Sensor data: X: 0.00, Y: 0.00, Z: 0.00&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;Is there any configuration missing for&amp;nbsp;LIS2DW12 sensor? Any good suggestions? Thanks&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;BRs.&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nRF Connect SDK machine learning application simulated sensor build problem</title><link>https://devzone.nordicsemi.com/thread/340549?ContentTypeID=1</link><pubDate>Wed, 24 Nov 2021 13:16:28 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:5a08402b-f6df-459a-a53b-159c33466497</guid><dc:creator>Marte Myrvold</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;Did you modify any other files in the project? Can you share your&amp;nbsp;app_ZDebug.conf file?&lt;/p&gt;
&lt;p&gt;Can you try to delete the build folder completely before building again?&lt;/p&gt;
&lt;p&gt;Best regards,&lt;/p&gt;
&lt;p&gt;Marte&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>