<?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>Interfacing with a BMI270 + aux BMM150: Zephyr sensor subsystem or Bosch drivers?</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/99067/interfacing-with-a-bmi270-aux-bmm150-zephyr-sensor-subsystem-or-bosch-drivers</link><description>I have a custom board with a BMD-300 (nRF52832), a BMI270 (accelerometer, gyroscope) and BMM150 (magnetometer), where the BMM150 is connected via the auxiliary connections on the BMI270: www.bosch-sensortec.com/.../bst-bmi270-ds000.pdf 
 From what I can</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Mon, 22 May 2023 18:31:52 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/99067/interfacing-with-a-bmi270-aux-bmm150-zephyr-sensor-subsystem-or-bosch-drivers" /><item><title>RE: Interfacing with a BMI270 + aux BMM150: Zephyr sensor subsystem or Bosch drivers?</title><link>https://devzone.nordicsemi.com/thread/426683?ContentTypeID=1</link><pubDate>Mon, 22 May 2023 18:31:52 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:9bb19357-2f27-43d9-ae43-c49b49dcc658</guid><dc:creator>deveryn</dc:creator><description>&lt;p&gt;It turned out to be a hardware issue, but the information in this thread was immensely helpful. Thank you!&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Interfacing with a BMI270 + aux BMM150: Zephyr sensor subsystem or Bosch drivers?</title><link>https://devzone.nordicsemi.com/thread/423365?ContentTypeID=1</link><pubDate>Tue, 02 May 2023 15:37:38 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:c197efe1-a59a-4661-947d-a3376bbb521d</guid><dc:creator>haakonsh</dc:creator><description>[quote user="deveryn"]You&amp;#39;re right - in hindsight,&amp;nbsp;going straight to the tiny custom board after using an&amp;nbsp;nRF DK was dumb![/quote]
&lt;p&gt;We&amp;#39;ve all been there. It&amp;#39;s a painful mistake, but your future self will thank you for remembering it :)&amp;nbsp;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Interfacing with a BMI270 + aux BMM150: Zephyr sensor subsystem or Bosch drivers?</title><link>https://devzone.nordicsemi.com/thread/423341?ContentTypeID=1</link><pubDate>Tue, 02 May 2023 14:13:59 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:34252416-8219-42a7-ae12-6bea46fa31e6</guid><dc:creator>deveryn</dc:creator><description>&lt;blockquote&gt;
&lt;p&gt;Is 0x10 the correct address? What is the state of the CSB and SDO pins?&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;Yes, I double and triple-checked. I also tried with all the potential addresses from 0x10 to 0x13 just to be sure.&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;I strongly urge you to&amp;nbsp;design development-friendly&amp;nbsp;prototypes for future projects. The size of your end-product&amp;nbsp;should have little relevance to the design of the prototype you use for development.&amp;nbsp;&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;&lt;span&gt;You&amp;#39;re right - in hindsight,&amp;nbsp;going straight to the tiny custom board after using an&amp;nbsp;nRF DK was dumb!&lt;/span&gt;&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;&lt;span&gt;You should probably cut those traces, as feeding an I2C bus into the AUX interface is likely operating the device out of spec.&amp;nbsp;&lt;/span&gt;&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;&lt;span&gt;I will try cutting the traces.&amp;nbsp;&lt;/span&gt;&lt;span&gt;Thank you for your help!&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Interfacing with a BMI270 + aux BMM150: Zephyr sensor subsystem or Bosch drivers?</title><link>https://devzone.nordicsemi.com/thread/423231?ContentTypeID=1</link><pubDate>Tue, 02 May 2023 09:49:29 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:cbfae7fa-dc21-4ecb-b877-c68305c37e00</guid><dc:creator>haakonsh</dc:creator><description>[quote user="deveryn"]I tried moving the BMM150 onto the same I2C bus as the BMI270, but for some reason, it&amp;#39;s giving me a -5 return code, which seems to be an &amp;quot;Address not acknowledged&amp;quot; error. Do you know why this would occur?[/quote]
&lt;p&gt;Is 0x10 the correct address? What is the state of the CSB and SDO pins?&lt;/p&gt;
[quote user="deveryn"]Unfortunately, the custom board is tiny, so getting oscilloscope probes attached is difficult.[/quote]
&lt;p&gt;I strongly urge you to&amp;nbsp;design development-friendly&amp;nbsp;prototypes for future projects. The size of your end-product&amp;nbsp;should have little relevance to the design of the prototype you use for development.&amp;nbsp;&lt;/p&gt;
[quote user="deveryn"]The only thing I can think of is the BMM150&amp;#39;s SDA and SCL are still connected to the AUX SDA and SCL lines on the BMMI270 - I just connected them to the SDA/SCL of the BMI270 as well. Would that cause the problem I&amp;#39;m seeing? Do I need to cut these traces, or fabricate a new board?[/quote]
&lt;p&gt;You should probably cut those traces, as feeding an I2C bus into the AUX interface is likely operating the device out of spec.&amp;nbsp;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Interfacing with a BMI270 + aux BMM150: Zephyr sensor subsystem or Bosch drivers?</title><link>https://devzone.nordicsemi.com/thread/423066?ContentTypeID=1</link><pubDate>Fri, 28 Apr 2023 19:56:25 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:17057d50-8a70-4cff-b2a8-fd2a1708f9fa</guid><dc:creator>deveryn</dc:creator><description>&lt;p&gt;Thanks haakonsh. I tried moving the BMM150 onto the same I2C bus as the BMI270, but for some reason, it&amp;#39;s giving me a -5 return code, which seems to be an &amp;quot;Address not acknowledged&amp;quot; error. Do you know why this would occur?&lt;/p&gt;
&lt;p&gt;Unfortunately, the custom board is tiny, so getting oscilloscope probes attached is difficult.&lt;/p&gt;
&lt;p&gt;This is the code I&amp;#39;m using to read from the BMM150:&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="c_cpp"&gt;int read_bmm150_id_tmp(void) {
	LOG_INF(&amp;quot;IMU: Reading BMM150 CHIP ID&amp;quot;);
	static const struct i2c_dt_spec dev_i2c = I2C_DT_SPEC_GET(I2C0_NODE_BMM150);

	// Check if the device is ready
	if (!device_is_ready(dev_i2c.bus)) {
		printk(&amp;quot;IMU I2C bus %s is not ready!\n\r&amp;quot;,dev_i2c.bus-&amp;gt;name);
		blink_with_colors(BRIGHTNESS_MAX_LEVEL, 0, 0, 0, 250, 2);
		return -1;
	}

	// Write the power control bit in order to read the chip ID
	uint8_t config_pwr[2] = {0x4B, 0x01};
	int ret = i2c_write_dt(&amp;amp;dev_i2c, config_pwr, sizeof(config_pwr));
	if (ret != 0) {
		LOG_ERR(&amp;quot;Failed to write to I2C device address&amp;quot;);
		blink_with_colors(BRIGHTNESS_MAX_LEVEL, 0, 0, 0, 250, 3);
		return -1;
	}

	// Read device ID
	uint8_t register_addr = 0x40;
	uint8_t temp_reading[1] = {0};
	uint8_t sensor_regs[1] = {register_addr};
	ret = i2c_write_read_dt(&amp;amp;dev_i2c, &amp;amp;sensor_regs[0], 1, &amp;amp;temp_reading[0], 1);
	if (ret != 0) {
		LOG_ERR(&amp;quot;Failed to write/read I2C device address&amp;quot;);
		blink_with_colors(BRIGHTNESS_MAX_LEVEL, 0, 0, 0, 250, 4);
		return -1;
	}
	LOG_INF(&amp;quot;Chip ID at register %d has value %d&amp;quot;, register_addr, temp_reading[0]);

	// BMM150 chip ID is 0x32
	if (temp_reading[0] == 0x32) {
		// Green
		blink_with_colors(0, BRIGHTNESS_MAX_LEVEL, 0, 0, 250, 5);
	} else {
		// Red
		blink_with_colors(BRIGHTNESS_MAX_LEVEL, 0, 0, 0, 250, 5);
	}

	return 0;
}&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;And my .dts file:&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;&amp;amp;i2c0 {
	compatible = &amp;quot;nordic,nrf-twi&amp;quot;;
	status = &amp;quot;okay&amp;quot;;

	pinctrl-0 = &amp;lt;&amp;amp;i2c0_default&amp;gt;;
	pinctrl-1 = &amp;lt;&amp;amp;i2c0_sleep&amp;gt;;
	pinctrl-names = &amp;quot;default&amp;quot;, &amp;quot;sleep&amp;quot;;
	clock-frequency = &amp;lt;100000&amp;gt;;

	bmi270: bmi270@68 {
		compatible = &amp;quot;bosch,bmi270&amp;quot;;
		reg = &amp;lt;0x68&amp;gt;;
		label = &amp;quot;BMI270&amp;quot;;
	};

	bmm150: bmm150@10 {
		compatible = &amp;quot;bosch,bmm150&amp;quot;;
		reg = &amp;lt;0x10&amp;gt;;
		label = &amp;quot;BMM150&amp;quot;;
	};
};&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;In my prj.conf I have these relevant options enabled:&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;CONFIG_I2C=y
CONFIG_SENSOR=y
CONFIG_BMI270=y
CONFIG_BMM150=y&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Does anything jump out as being incorrect here?&lt;/p&gt;
&lt;p&gt;The only thing I can think of is the BMM150&amp;#39;s SDA and SCL are still connected to the AUX SDA and SCL lines on the BMMI270 - I just connected them to the SDA/SCL of the BMI270 as well. Would that cause the problem I&amp;#39;m seeing? Do I need to cut these traces, or fabricate a new board?&lt;/p&gt;
&lt;p&gt;Any help you could provide would be greatly appreciated. Thank you.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Interfacing with a BMI270 + aux BMM150: Zephyr sensor subsystem or Bosch drivers?</title><link>https://devzone.nordicsemi.com/thread/422347?ContentTypeID=1</link><pubDate>Tue, 25 Apr 2023 15:27:56 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:d7ae453a-7b60-4605-93dd-f61d45abe11d</guid><dc:creator>haakonsh</dc:creator><description>&lt;p&gt;Do you need to use the AUX interface at all? I ask because if the two sensors can share the same I2C bus then Zephyr&amp;#39;s Sensor Device Drivers will work just fine with both devices as is.&lt;/p&gt;
&lt;p&gt;Zephyr&amp;#39;s BMI270&lt;span&gt;&amp;nbsp;Sensor Device Driver (zephyr\drivers\sensor\bmi270\bmi270.c) does not support the AUX interface, it would be very helpful if you&amp;#39;d ask Bosch to add this support.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;One &amp;quot;not-so-beginner-firendly&amp;quot; option is to&amp;nbsp;add this support yourself by&amp;nbsp;expanding&amp;nbsp;Zephyr&amp;#39;s BMI270&amp;nbsp;Sensor Device Driver with the corresponding behaviour of&amp;nbsp;&lt;a href="https://github.com/boschsensortec/BMI270-Sensor-API/blob/master/bmi270_examples/sensor_data/sensor_data.c"&gt;https://github.com/boschsensortec/BMI270-Sensor-API/blob/master/bmi270_examples/sensor_data/sensor_data.c&lt;/a&gt;&amp;nbsp;(the example that includes the BMM150 on the AUX interface of the BMI270).&lt;/p&gt;
&lt;p&gt;One &amp;quot;beginner-friendly&amp;quot; option is to use the NRFX I2C driver directly and port &lt;span&gt;&lt;a href="https://github.com/BoschSensortec/"&gt;github.com/.../&lt;/a&gt;&lt;/span&gt;&lt;span&gt;BMI270-Sensor-API.&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>