<?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>nrf5340dk connection to a bosch&amp;#39;s bhi260ab</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/72740/nrf5340dk-connection-to-a-bosch-s-bhi260ab</link><description>Using the sample code from this earlier devzone post , I&amp;#39;ve been trying establish communication with from my bosch sensor to my board. I have the code running: and it&amp;#39;s printing that the &amp;quot;spim example&amp;quot; but I&amp;#39;m not getting any confirmation print outs that</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Fri, 19 Mar 2021 16:49:35 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/72740/nrf5340dk-connection-to-a-bosch-s-bhi260ab" /><item><title>RE: nrf5340dk connection to a bosch's bhi260ab</title><link>https://devzone.nordicsemi.com/thread/301004?ContentTypeID=1</link><pubDate>Fri, 19 Mar 2021 16:49:35 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:c5a34e2b-42cf-438c-a339-e0753e945248</guid><dc:creator>j-saur</dc:creator><description>&lt;p&gt;Thanks Simon! I&amp;#39;ll look at those and try to implement them. I didn&amp;#39;t use bmm150 because I need an spi connection and I cannot reach the bmm150 data without getting the bhi260ab data first.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nrf5340dk connection to a bosch's bhi260ab</title><link>https://devzone.nordicsemi.com/thread/300888?ContentTypeID=1</link><pubDate>Fri, 19 Mar 2021 11:00:48 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:35bd34d3-7947-41dc-971b-39f16c4b4c77</guid><dc:creator>Simon</dc:creator><description>&lt;p&gt;That will not work. You have not defined the dts node&amp;nbsp;bhi260ab_bmm150 in&amp;nbsp;&lt;a href="https://github.com/nrfconnect/sdk-zephyr/tree/master/dts/bindings/sensor"&gt;https://github.com/nrfconnect/sdk-zephyr/tree/master/dts/bindings/sensor&lt;/a&gt;. There are several more things that are lacking as well, but take a look at the down below instructions.&lt;/p&gt;
&lt;p&gt;Take a look at this link, that demonstrates how to add a new driver to Zephyr:&amp;nbsp;&lt;a href="https://devzone.nordicsemi.com/f/nordic-q-a/66230/how-to-add-new-i2c-based-sensor-device-to-ncs-v1-3-0-zephyr-drivers-sensor"&gt;https://devzone.nordicsemi.com/f/nordic-q-a/66230/how-to-add-new-i2c-based-sensor-device-to-ncs-v1-3-0-zephyr-drivers-sensor&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;Btw. why don&amp;#39;t you use the already present driver &lt;a href="https://github.com/nrfconnect/sdk-zephyr/tree/a2d2a5e169f7aec8d9de16787af99e59c56c09b7/drivers/sensor/bmm150"&gt;driver/sensor/bmm150&lt;/a&gt;&amp;nbsp;and the sample&amp;nbsp;&lt;a href="https://github.com/nrfconnect/sdk-zephyr/tree/a2d2a5e169f7aec8d9de16787af99e59c56c09b7/samples/sensor/bmm150"&gt;zephyr/samples/sensor/bmm150&lt;/a&gt;? You just have to add an overlay file in&amp;nbsp;&lt;a href="https://github.com/nrfconnect/sdk-zephyr/tree/a2d2a5e169f7aec8d9de16787af99e59c56c09b7/samples/sensor/bmm150/boards"&gt;zephyr/samples/sensor/bmm150/boards&lt;/a&gt;.&lt;/p&gt;
&lt;hr /&gt;
&lt;p&gt;Zephyr might be complicated and difficult in the beginning, but I would recommend you to put off some time to read through the documentation and trying to understand how stuff works. Take a look at these:&lt;/p&gt;
&lt;p&gt;&lt;a href="https://developer.nordicsemi.com/nRF_Connect_SDK/doc/latest/zephyr/guides/kconfig/index.html"&gt;https://developer.nordicsemi.com/nRF_Connect_SDK/doc/latest/zephyr/guides/kconfig/index.html&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&lt;a href="https://developer.nordicsemi.com/nRF_Connect_SDK/doc/latest/zephyr/guides/dts/index.html"&gt;https://developer.nordicsemi.com/nRF_Connect_SDK/doc/latest/zephyr/guides/dts/index.html&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;Best regards,&lt;/p&gt;
&lt;p&gt;Simon&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nrf5340dk connection to a bosch's bhi260ab</title><link>https://devzone.nordicsemi.com/thread/300260?ContentTypeID=1</link><pubDate>Wed, 17 Mar 2021 01:02:35 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:70986aab-67e0-4841-a4b8-6b6199301903</guid><dc:creator>j-saur</dc:creator><description>&lt;p&gt;So I added the api files from bhy as an external driver and tried to get the spi connection working from there.&amp;nbsp; I&amp;#39;m normally 3D developer so I apologize for the basic questions&lt;/p&gt;
&lt;p&gt;&lt;a href="https://devzone.nordicsemi.com/cfs-file/__key/communityserver-discussions-components-files/4/extDriver.zip"&gt;devzone.nordicsemi.com/.../extDriver.zip&lt;/a&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nrf5340dk connection to a bosch's bhi260ab</title><link>https://devzone.nordicsemi.com/thread/299939?ContentTypeID=1</link><pubDate>Mon, 15 Mar 2021 18:23:42 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:328b2401-3976-49be-8851-a4b6d7cc8d37</guid><dc:creator>Simon</dc:creator><description>&lt;p&gt;I took a look at your new sample and I still saw that bhi260ab_bmm150 and&amp;nbsp;&amp;quot;bosch,bhi260_bmm150&amp;quot; was present. Could you tell me where you got these from? Please read through my previous reply and update your overlay file.&lt;/p&gt;
&lt;p&gt;You are calling&amp;nbsp;&lt;code&gt;evice_get_binding(spi_dev-&amp;gt;name).&amp;nbsp;&lt;/code&gt;This will not do anything since spi_dev-&amp;gt;name is null by default. You should instead call device_get_binding(&amp;lt;label used inside bmm150 node&amp;gt;). Take a look at the file&amp;nbsp;&lt;span&gt;\zephyr\samples\sensor\bmm150\src\main.c and update your main.c accordingly. The API used inside your sample is zephyr/includedrivers/spi.h, this is not correct you should use the API&amp;nbsp;&lt;/span&gt;drivers/sensor.h. Read NCS tutorial part 3 to understand this better:&amp;nbsp;&lt;a href="https://devzone.nordicsemi.com/nordic/nrf-connect-sdk-guides/b/getting-started/posts/nrf-connect-sdk-tutorial---part-3-ncs-v1-4-0#h56sk0f6zs6u1qqs6nj2hbrjty9raxu"&gt;https://devzone.nordicsemi.com/nordic/nrf-connect-sdk-guides/b/getting-started/posts/nrf-connect-sdk-tutorial---part-3-ncs-v1-4-0#h56sk0f6zs6u1qqs6nj2hbrjty9raxu&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;Best regards,&lt;/p&gt;
&lt;p&gt;Simon&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nrf5340dk connection to a bosch's bhi260ab</title><link>https://devzone.nordicsemi.com/thread/299927?ContentTypeID=1</link><pubDate>Mon, 15 Mar 2021 17:01:04 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:cb61539d-21b7-4221-bdd9-c6439eeff2fc</guid><dc:creator>j-saur</dc:creator><description>&lt;p&gt;&lt;a href="https://devzone.nordicsemi.com/cfs-file/__key/communityserver-discussions-components-files/4/5381.spi_5F00_only.zip"&gt;devzone.nordicsemi.com/.../5381.spi_5F00_only.zip&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;Thanks for your suggestions Simon I was in a hurry to post friday, so I&amp;#39;ve updated the overlay file and attached my project.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Also here is what my logic analyzer reads:&lt;/p&gt;
&lt;p&gt;&lt;img alt=" " src="https://devzone.nordicsemi.com/resized-image/__size/640x480/__key/communityserver-discussions-components-files/4/Screen-Shot-2021_2D00_03_2D00_12-at-2.48.07-PM.png" /&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nrf5340dk connection to a bosch's bhi260ab</title><link>https://devzone.nordicsemi.com/thread/299874?ContentTypeID=1</link><pubDate>Mon, 15 Mar 2021 15:22:08 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:6dc1c213-7227-433e-944d-2fe7a8e44c3a</guid><dc:creator>Simon</dc:creator><description>&lt;p&gt;I was not able to build the sample, as the content inside&amp;nbsp;spi_only\boards\nrf5340dk_nrf5340_cpuapp.overlay is not valid:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;The spi1 node is not terminated (no &amp;quot;};&amp;quot; at the end of the node).&lt;/li&gt;
&lt;li&gt;The property &amp;quot;def-char&amp;quot; is not declared for &amp;quot;nordic,nrf-spim&amp;quot; (SPI master), but for &amp;quot;&lt;a href="https://github.com/nrfconnect/sdk-zephyr/blob/v2.4.0-ncs1/dts/bindings/spi/nordic,nrf-spis.yaml#L16-L21"&gt;nordic,nrf-spis.yaml&lt;/a&gt;&amp;quot;&lt;/li&gt;
&lt;li&gt;There is no yaml file for the compatible&amp;nbsp;&amp;quot;bosch,bhi260_bmm150&amp;quot;, use&amp;nbsp;&lt;a href="https://github.com/nrfconnect/sdk-zephyr/blob/v2.4.0-ncs1/dts/bindings/sensor/bosch,bmm150.yaml"&gt;&amp;quot;bosch,bmm150&amp;quot;&lt;/a&gt;&amp;nbsp;instead&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;
&amp;amp;spi1 {
	compatible = &amp;quot;nordic,nrf-spim&amp;quot;;
	status = &amp;quot;okay&amp;quot;;
	sck-pin = &amp;lt;4&amp;gt;;
	mosi-pin = &amp;lt;5&amp;gt;;
	miso-pin = &amp;lt;6&amp;gt;;
	cs-gpios = &amp;lt; &amp;amp;gpio0 7 GPIO_ACTIVE_LOW&amp;gt;;
	def-char = &amp;lt;0x00&amp;gt;;

	spi_dev:bhi260ab_bmm150@2B {
		compatible = &amp;quot;bosch,bhi260_bmm150&amp;quot;;
		reg = &amp;lt;0x2B&amp;gt;;
		spi-max-frequency = &amp;lt;4000000&amp;gt;;
		int1-gpios = &amp;lt;&amp;amp;gpio0 10 GPIO_ACTIVE_HIGH&amp;gt;;
	};
&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;I suspect that you didn&amp;#39;t use the same name as your overlay folder when building it (&lt;span style="font-family:inherit;"&gt;such that the overlay file was just ignored),&amp;nbsp; since you were actually able to run the sample.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="font-family:inherit;"&gt; If you create an overlay file with the name&amp;nbsp;&lt;/span&gt;&lt;span style="font-family:inherit;"&gt;&lt;strong&gt;nrf5340dk_nrf5340_cpuapp&lt;/strong&gt;.overlay you should build using the board&amp;nbsp;&lt;strong&gt;nrf5340dk_nrf5340_cpuapp&amp;nbsp;&lt;/strong&gt;for the changes in the overlay file to take effect.&lt;/span&gt;&lt;/p&gt;
&lt;hr /&gt;
&lt;p&gt;I would recommend you to&amp;nbsp;use the sample \zephyr\samples\sensor\bmm150\src\main.c as a reference for how to go about it. There is no overlay file in that sample for your particluar board, so you have to add it yourself. Take a look at e.g.&amp;nbsp;&lt;a href="https://github.com/nrfconnect/sdk-nrf/blob/v1.4.2/samples/nfc/tnep_poller/nrf5340dk_nrf5340_cpuapp.overlay"&gt;https://github.com/nrfconnect/sdk-nrf/blob/v1.4.2/samples/nfc/tnep_poller/nrf5340dk_nrf5340_cpuapp.overlay&lt;/a&gt;&amp;nbsp;to get a general idea how to implement the overlay file.&lt;/p&gt;
&lt;p&gt;Best regards,&lt;/p&gt;
&lt;p&gt;Simon&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nrf5340dk connection to a bosch's bhi260ab</title><link>https://devzone.nordicsemi.com/thread/299579?ContentTypeID=1</link><pubDate>Sat, 13 Mar 2021 07:22:33 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:e288c037-e11c-49e0-9576-4ea2908260e5</guid><dc:creator>niebert</dc:creator><description>&lt;p&gt;A SPIM device ALWAYS receives data from the slave, even if nothing is connected to it. So you have to look into the data with logging to see what you actually receive (if anything). If that does not help, really, I&amp;#39;d recommend using a logic analyzer to observe what is going on between your MCU and the sensor (at least you can observe if the master is set up correctly). They are dead cheap these days really useful for understanding a symptom in the situation you describe.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>