<?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>nrf51 and VL53L0X</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/43179/nrf51-and-vl53l0x</link><description>Hi everybody! 
 I hope I am not too late to jump on the nrf51 train, but I had the ability to get a great deal on them so I really want to use them for a project we have. We need to connect the chip to a VL53L0X Time-of-Flight sensor and I found this</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Tue, 05 Feb 2019 14:49:30 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/43179/nrf51-and-vl53l0x" /><item><title>RE: nrf51 and VL53L0X</title><link>https://devzone.nordicsemi.com/thread/169564?ContentTypeID=1</link><pubDate>Tue, 05 Feb 2019 14:49:30 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:aa135e49-4059-4841-8199-d156d72e5240</guid><dc:creator>mrono</dc:creator><description>&lt;p&gt;&lt;pre class="ui-code" data-mode="c_cpp"&gt;        uint8_t buffer[5]; /* Addr + data */
        buffer[0] = index;
        buffer[1] = data &amp;gt;&amp;gt; 24;
        buffer[1] = data &amp;gt;&amp;gt; 16;
        buffer[1] = data &amp;gt;&amp;gt; 8;
        buffer[1] = data;
        ret = nrf_drv_twi_tx(&amp;amp;m_twi_master, address &amp;gt;&amp;gt; 1, buffer, 2, false);
&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;I was going to say that you can use the official library provided by ST and just implement the I2C communication layer to it. Then I had a quick look at that library, and it does just that.&lt;/p&gt;
&lt;p&gt;But the implementation seems to have some issues... Such as the one I pasted above, which is surely wrong.&lt;/p&gt;
&lt;p&gt;If you want to use this library, I&amp;#39;d suggest you focus on&amp;nbsp; the file that has the I2C routines in it. Fixing that should be sufficient, as the rest is provided by the chip manufacturer.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nrf51 and VL53L0X</title><link>https://devzone.nordicsemi.com/thread/169540?ContentTypeID=1</link><pubDate>Tue, 05 Feb 2019 14:18:33 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:57e10080-777e-46db-9712-b2547a2ef255</guid><dc:creator>Edvin</dc:creator><description>&lt;p&gt;Ok, so then&amp;nbsp;&lt;span&gt;VL53L0X_GetMeasurementDataReady() is probably never returning true. What HW are you using? The nRF51 DK?&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;Try to debug inside&amp;nbsp;VL53L0X_GetMeasurementDataReady() inside&amp;nbsp;vl53l0x_api.c to see if you can figure out why it returns this. This is not our libraries, and I don&amp;#39;t have the correct HW to test it, unfortunately. Maybe you can check with the author of the project whether he knows why your project doesn&amp;#39;t work.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;But regarding the debugger, what HW do you use?&amp;nbsp;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;Best regards,&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;Edvin&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nrf51 and VL53L0X</title><link>https://devzone.nordicsemi.com/thread/168908?ContentTypeID=1</link><pubDate>Thu, 31 Jan 2019 14:47:42 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:ec95f392-9c58-4632-8386-2b8bf79597a4</guid><dc:creator>Teecup</dc:creator><description>&lt;p&gt;Thank you for the response! I am using Keil. I actually narrowed down some things and now I am stuck in the do {} while (!isMeasurementReady()); loop from the github example. Polling the API version and product revision work fine now, but I can&amp;#39; t get any readings since the code is stuck in this loop forever.&lt;/p&gt;
&lt;p&gt;I don&amp;#39;t know if I understand the debugger. I turned off optimizations and enabled debugging via preprocessor, but when I run the application in debug mode, it breaks right at the beginning of main(), although I can clearly see some Info logs beyond that point.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nrf51 and VL53L0X</title><link>https://devzone.nordicsemi.com/thread/168881?ContentTypeID=1</link><pubDate>Thu, 31 Jan 2019 13:18:30 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:5100d080-7a7a-4f6b-9cae-07feb0fd72e9</guid><dc:creator>Edvin</dc:creator><description>&lt;p&gt;Hello Simon,&lt;/p&gt;
&lt;p&gt;Can you try the following for me:&lt;/p&gt;
&lt;p&gt;In your project in SDK12.3.0, go to your preprocessor defines. This is usually found in your project settings. Let me know what IDE (Segger embedded studio, Keil or IAR) you are using, and I can show you how to change them.&lt;/p&gt;
&lt;p&gt;1. Add &amp;quot;DEBUG&amp;quot; to your preprocessor defines.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;2. Turn off optimization for your project (also done in your project settings). Set it to (-O0).&lt;/p&gt;
&lt;p&gt;3. Set a breakpoint on line 76 in app_error.c.&lt;/p&gt;
&lt;p&gt;4. Start debugging your project.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Does the application stop at your breakpoint at any point in time? If so, study the .line_num, .error_code and .p_file_name variables, and locate what APP_ERROR_CHECK(err_code) that received an err_code != NRF_SUCCESS (== 0).&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Best regards,&lt;/p&gt;
&lt;p&gt;Edvin&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>