<?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>Reading a Sensirion SGP30 sensor with nRF52840 via I2C/TWI</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/85311/reading-a-sensirion-sgp30-sensor-with-nrf52840-via-i2c-twi</link><description>After working with arduino&amp;#39;s and microprocessors like the ESP8266 and ESP32, I recently started toying around with a nRF52840 dev kit. After going through some tutorials, I wanted to see if I can get a SGP30 air quality sensor to work ( https://www.mouser</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Mon, 11 Apr 2022 11:37:46 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/85311/reading-a-sensirion-sgp30-sensor-with-nrf52840-via-i2c-twi" /><item><title>RE: Reading a Sensirion SGP30 sensor with nRF52840 via I2C/TWI</title><link>https://devzone.nordicsemi.com/thread/362827?ContentTypeID=1</link><pubDate>Mon, 11 Apr 2022 11:37:46 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:4dd14f4b-664f-4a70-b7d2-f932c8690335</guid><dc:creator>J&amp;#248;rgen Holmefjord</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;I followed your instructions, but I do not get the same error. I get a similar error, through:&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;C:/ncs/v1.8.0/zephyr/drivers/sensor/sgp30/sgp30.c:17:10: fatal error: drivers/sensor/sgp30.h: No such file or directory
   17 | #include &amp;lt;drivers/sensor/sgp30.h&amp;gt;
      |          ^~~~~~~~~~~~~~~~~~~~~~~~
compilation terminated.&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;This could be resolved by duplicating sgp40.h to sgp30.h in&amp;nbsp;C:\ncs\v1.8.0\zephyr\include\drivers\sensor\. I&amp;#39;m not sure if this is the issue in your case, as it is complaining about the include from main.c. I assume you did a pristine build/removed the build directory before building, after making the changes?&lt;/p&gt;
&lt;p&gt;Best regards,&lt;br /&gt;Jørgen&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Reading a Sensirion SGP30 sensor with nRF52840 via I2C/TWI</title><link>https://devzone.nordicsemi.com/thread/362446?ContentTypeID=1</link><pubDate>Thu, 07 Apr 2022 18:32:16 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:3e73ae2c-53f7-4011-b228-940d7d762c35</guid><dc:creator>ErikNl</dc:creator><description>&lt;p&gt;ah, it seems I did not.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;I now changed my overlay file to:&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;&amp;amp;i2c1 {
sgp30@58 {
compatible = &amp;quot;sensirion,sgp30&amp;quot;;
reg = ;
label = &amp;quot;sensirion_sgp30&amp;quot;;
status = &amp;quot;okay&amp;quot;;
};
};&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;I does give me some red remarks (Only i2c nodes accepted in /soc/peripheral@50000000/i2c@9000/.), but it does now go past the &amp;quot;No sensirion,sgp30 compatible node found in the device tree&amp;quot; it seems.&lt;/p&gt;
&lt;p&gt;I do now however get stuck at the compiler not finding the sgp30.h file.&lt;/p&gt;
&lt;p&gt;&lt;br /&gt;In the main.c file, I replaced&lt;/p&gt;
&lt;p&gt;#include &amp;lt;drivers/sensor/sgp40.h&amp;gt;&lt;/p&gt;
&lt;p&gt;with&lt;/p&gt;
&lt;p&gt;#include &amp;lt;drivers/sensor/sgp30.h&amp;gt;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;But when I try to compile the code, I get:&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;br /&gt;c:\Users\Erik\zigbee\test1\sgp30test1\src\main.c:12:10: fatal error: drivers/sensor/sgp30.h: No such file or directory&lt;/p&gt;
&lt;p&gt;I even tired manually copieng the sgp30.h and sgp30.c files to&amp;nbsp;C:\Users\Erik\zigbee\test1\sgp30test1\src\drivers\sensor, but I stil get the same error.&lt;/p&gt;
&lt;p&gt;&lt;br /&gt;Maybe I should explain a bit more what I did. I started with the files that where located in C:\Users\Erik\ncs\v1.8.0\zephyr\drivers\sensor\sgp40 and copied them to C:\Users\Erik\ncs\v1.8.0\zephyr\drivers\sensor\sgp30&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;I then changed the 4 files in the directory to match the sgp30 datasheet where possible.&lt;br /&gt;I now have the following files in that dir:&lt;/p&gt;
&lt;p&gt;- CMakeList.txt&lt;br /&gt;- Kconfig&lt;br /&gt;- sgp30.h&lt;br /&gt;- sgp30.c&lt;/p&gt;
&lt;p&gt;I then added the following line to C:\Users\Erik\ncs\v1.8.0\zephyr\drivers\sensor\CMakeLists.txt&lt;/p&gt;
&lt;p&gt;add_subdirectory_ifdef(CONFIG_SGP30 sgp30)&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;and the following line to C:\Users\Erik\ncs\v1.8.0\zephyr\drivers\sensor\Kconfig&lt;/p&gt;
&lt;p&gt;source &amp;quot;drivers/sensor/sgp30/Kconfig&amp;quot;&lt;/p&gt;
&lt;p&gt;I then created the sample application for the sgp40/sht40 that is included in the SDK in visual studio code, added the sgp30 to the KConfig (and removed the SGP40)&lt;/p&gt;
&lt;p&gt;I simplified the code to make it as minimal as possible.&lt;/p&gt;
&lt;p&gt;There&amp;#39;s probably some step I&amp;#39;m missing in the process, but I just can&amp;#39;t figure out what it is. Any ideas?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Reading a Sensirion SGP30 sensor with nRF52840 via I2C/TWI</title><link>https://devzone.nordicsemi.com/thread/358816?ContentTypeID=1</link><pubDate>Fri, 18 Mar 2022 10:19:34 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:72b533e0-9d81-4e76-a124-bdfe4530c0df</guid><dc:creator>J&amp;#248;rgen Holmefjord</dc:creator><description>&lt;p&gt;Did you try to add &lt;a href="https://github.com/nrfconnect/sdk-zephyr/blob/v2.7.99-ncs1-1/samples/sensor/sgp40_sht4x/boards/blackpill_f411ce.overlay#L18"&gt;&amp;quot;status = &amp;quot;okay&amp;quot;;&amp;quot;&lt;/a&gt; to the overlay?&amp;nbsp;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Reading a Sensirion SGP30 sensor with nRF52840 via I2C/TWI</title><link>https://devzone.nordicsemi.com/thread/358073?ContentTypeID=1</link><pubDate>Mon, 14 Mar 2022 19:42:24 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:4e54388e-066b-463d-b36a-aa027b4fffa7</guid><dc:creator>ErikNl</dc:creator><description>&lt;p&gt;Thanks, I looked into the&amp;nbsp;&lt;span&gt;SGP40&amp;nbsp;driver files an think I can use them as a base to build driver files for the SGP30, using the SGP30 data sheets.&amp;nbsp;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;I am however running into a problem with the SGP40 sample. I believe I was able to compile it earlier on without any modifications, but when I now try to compile it, it gets stuck at these lines:&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;/p&gt;
&lt;div&gt;
&lt;div&gt;&lt;span&gt;#if&lt;/span&gt;&lt;span&gt; &lt;/span&gt;&lt;span&gt;!&lt;/span&gt;&lt;span&gt;DT_HAS_COMPAT_STATUS_OKAY&lt;/span&gt;&lt;span&gt;(sensirion_sgp40)&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span&gt;#error&lt;/span&gt;&lt;span&gt; &lt;/span&gt;&lt;span&gt;&amp;quot;No sensirion,sgp40 compatible node found in the device tree&amp;quot;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span&gt;#endif&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span&gt;I have the SGP40 drivers enabled in kconfig, but am not sure what I should do to add the SGP40 to the device tree.&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span&gt;I also have tried to add this to the overlay file:&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span&gt;&lt;pre class="ui-code" data-mode="c_cpp"&gt;&amp;amp;i2c1 {
    sgp40@59 {
        compatible = &amp;quot;sensirion,sgp40&amp;quot;;
        reg = &amp;lt;0x59&amp;gt;;
        label = &amp;quot;sensirion_sgp40&amp;quot;;
    };
};
&lt;/pre&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span&gt;Bu to no avail.&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span&gt;I&amp;#39;m probably overlooking something simple, but I just don&amp;#39;t know what it is. I first would like to be able to compile the SGP40 sample before starting on the SGP30&lt;/span&gt;&lt;/div&gt;
&lt;/div&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Reading a Sensirion SGP30 sensor with nRF52840 via I2C/TWI</title><link>https://devzone.nordicsemi.com/thread/356002?ContentTypeID=1</link><pubDate>Thu, 03 Mar 2022 11:26:50 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:86789729-5b5a-40c4-8ac8-2205022f375d</guid><dc:creator>J&amp;#248;rgen Holmefjord</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
[quote user=""]With the nRF connect SDK, a driver is supplied for the SGP40, but unfortunately not for the SGP30.&amp;nbsp;[/quote]
&lt;p&gt;Are the sensors very different? It should not be that much work to copy and modify the existing driver to work with a similar device. Look at the SGP40 driver implementation in Zephyr and compare the commands/features with the datasheet of the SGP30 sensor and make the necessary changes.&lt;/p&gt;
[quote user=""]I found a github repository from Sensirion where they have some code for Nordic nRF series:&amp;nbsp;&lt;a href="https://github.com/Sensirion/embedded-common/tree/master/i2c/sample-implementations/Nordic_nRF5_series"&gt;https://github.com/Sensirion/embedded-common/tree/master/i2c/sample-implementations/Nordic_nRF5_series&lt;/a&gt;&amp;nbsp;, however, I am not sure how I should use it.[/quote]
&lt;p&gt;It looks like this is using &lt;a href="https://infocenter.nordicsemi.com/topic/sdk_nrf5_v17.1.0/group__nrf__drv__twi.html#ga0c3d5eec0ece122ca91526a7b4906ca5"&gt;driver APIs&lt;/a&gt; from nRF5 SDK and not from nRF Connect SDK. It may be possible to use this driver with nRF Connect SDK, but you will need to rewrite the HAL layer by using the &lt;a href="https://developer.nordicsemi.com/nRF_Connect_SDK/doc/1.9.0/zephyr/reference/peripherals/i2c.html"&gt;I2C API from Zephyr&lt;/a&gt; (or &lt;a href="https://developer.nordicsemi.com/nRF_Connect_SDK/doc/1.9.0/nrfx/drivers/twim/driver.html"&gt;nrfx_twim&lt;/a&gt;). How to actually use that driver is a question you need to direct to&amp;nbsp;&lt;span&gt;Sensirion.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;Best regards,&lt;br /&gt;Jørgen&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>