<?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>pm_device_action_run behavior when multipile sensors are connected on same bus</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/127198/pm_device_action_run-behavior-when-multipile-sensors-are-connected-on-same-bus</link><description>I have an application in which there are two high speed sensors consider it as sensors 1 and sensor 2. Both sensors are connected over same SPI lines having different CS pins and power supply pins using different LDOs. 
 According to my application, in</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Thu, 12 Mar 2026 12:26:28 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/127198/pm_device_action_run-behavior-when-multipile-sensors-are-connected-on-same-bus" /><item><title>RE: pm_device_action_run behavior when multipile sensors are connected on same bus</title><link>https://devzone.nordicsemi.com/thread/563108?ContentTypeID=1</link><pubDate>Thu, 12 Mar 2026 12:26:28 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:e55c0b1e-cc76-4c1a-b839-5494f57a8890</guid><dc:creator>Hieu</dc:creator><description>&lt;p&gt;&lt;span&gt;Hi Ankit_chauhan,&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;Perfect. I will keep this case on hold then. Please feel free to follow-up or close it as you see fit.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;Hieu&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: pm_device_action_run behavior when multipile sensors are connected on same bus</title><link>https://devzone.nordicsemi.com/thread/563071?ContentTypeID=1</link><pubDate>Thu, 12 Mar 2026 04:50:21 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:095ce3f5-f029-4e4d-b371-57e1a9234563</guid><dc:creator>Ankit_chauhan</dc:creator><description>&lt;p&gt;Hieu,&lt;br /&gt;&lt;br /&gt;Thanks for the reply.&lt;/p&gt;
&lt;p&gt;I got your point here, instead of suspedning an entire bus I need to focus of device runtime status and then suspend the device. I will take a look at the link that you shared.&amp;nbsp;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: pm_device_action_run behavior when multipile sensors are connected on same bus</title><link>https://devzone.nordicsemi.com/thread/563062?ContentTypeID=1</link><pubDate>Wed, 11 Mar 2026 21:42:49 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:bdb909c2-cb66-4e84-992a-32e81802d027</guid><dc:creator>Hieu</dc:creator><description>&lt;p&gt;Hi Ankit_chauhan,&lt;/p&gt;
&lt;p&gt;Yes, this is what I suspected was happening, that the sensor driver handling of PM API also affects the SPI bus as a whole. I think that you see that this&amp;nbsp;gives you the problem of suspending one sensor affecting the other as well.&lt;/p&gt;
&lt;p&gt;It is much better that&amp;nbsp;the suspending of one sensor only affects itself and nothing else. Maybe it can signal that it is done/not done using the SPI bus with &lt;a href="https://docs.nordicsemi.com/bundle/zephyr-apis-3.2.3/page/group_subsys_pm_device_runtime.html#ga530d4be65757fb2276ab6f631953e045"&gt;pm_runtime_device_get()&lt;/a&gt; and &lt;a href="https://docs.nordicsemi.com/bundle/zephyr-apis-3.2.3/page/group_subsys_pm_device_runtime.html#ga98daba53a992fb6bd2c2b31cb445844f"&gt;pm_device_runtime_put()&lt;/a&gt;, but it shouldn&amp;#39;t suspend the whole bus.&lt;/p&gt;
&lt;p&gt;Please refer to our online course on Device Driver Development for more information:&amp;nbsp;&lt;a href="https://academy.nordicsemi.com/courses/nrf-connect-sdk-intermediate/lessons/lesson-7-device-driver-dev/"&gt;Lesson 7 - Device driver development - Nordic Developer Academy&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;Hieu&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: pm_device_action_run behavior when multipile sensors are connected on same bus</title><link>https://devzone.nordicsemi.com/thread/562866?ContentTypeID=1</link><pubDate>Tue, 10 Mar 2026 04:47:45 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:6964cbdd-7ae7-4383-99fc-35ded393e0e0</guid><dc:creator>Ankit_chauhan</dc:creator><description>&lt;p&gt;Hieu,&lt;br /&gt;&lt;br /&gt;Yes, earlier we were using the Zephyr sample driver for LSM, but as per our application architecture requirement we need to read a FIFO using a single API and we do not have a sensor API to read the FIFO. We did not get appropreate results what we are looking for with the available Zephyr LSM driver. So. to full fill this requirement we creates a custom sensor API so that we can utilize the FIFO read directly instead of using conventional APIs.&lt;/p&gt;
&lt;p&gt;Below is the implementation of my PM action API&lt;br /&gt;&lt;pre class="ui-code" data-mode="c_cpp"&gt;#ifdef CONFIG_PM_DEVICE
static int lsm6dsl_pm_action(const struct device *dev,
								enum pm_device_action action)
{
	int ret = 0;
	const struct lsm6dsl_config * const config = dev-&amp;gt;config;
	enum pm_device_state cur_state = PM_DEVICE_STATE_OFF;

	switch(action) {
		case PM_DEVICE_ACTION_SUSPEND:
		case PM_DEVICE_ACTION_TURN_OFF:
			/// Check the current status of bus 
            ret = pm_device_state_get(config-&amp;gt;bus_cfg.spi.bus, &amp;amp;cur_state);
            if(ret&amp;lt;0) {
                LOG_ERR(&amp;quot;lsm6dsl pm_device_state_get failed : %d &amp;quot;, ret);
            } else {
                LOG_DBG(&amp;quot;lsm6dsl pm_device_state_get : %s. : %d&amp;quot;, pm_device_state_str(cur_state), cur_state);
            }

			LOG_INF(&amp;quot;lsm6dsl Power OFF :: PM_DEVICE_ACTION_SUSPEND :: Bus :: %s&amp;quot;, config-&amp;gt;bus_cfg.spi.bus-&amp;gt;name);

			if(PM_DEVICE_STATE_ACTIVE == cur_state) {
				ret = pm_device_action_run(config-&amp;gt;bus_cfg.spi.bus, PM_DEVICE_ACTION_SUSPEND);
				if(ret&amp;lt;0) {
					LOG_ERR(&amp;quot;lsm6dsl Driver Power Action failed : %d : PM_DEVICE_ACTION_SUSPEND.&amp;quot;, ret);
				} else {
					LOG_INF(&amp;quot;lsm6dsl Driver Power Action : PM_DEVICE_ACTION_SUSPEND.&amp;quot;);
				}
			}

			break;
		case PM_DEVICE_ACTION_RESUME:
		case PM_DEVICE_ACTION_TURN_ON:
			ret = pm_device_state_get(config-&amp;gt;bus_cfg.spi.bus, &amp;amp;cur_state);
            if(ret&amp;lt;0) {
                LOG_ERR(&amp;quot;lsm6dsl pm_device_state_get failed : %d &amp;quot;, ret);
            } else {
                LOG_DBG(&amp;quot;lsm6dsl pm_device_state_get : %s. : %d&amp;quot;, pm_device_state_str(cur_state), cur_state);
            }

			LOG_INF(&amp;quot;lsm6dsl Power ON :: current status  :: %s&amp;quot;, pm_device_state_str(cur_state));

			if(PM_DEVICE_STATE_ACTIVE != cur_state) {
				ret = pm_device_action_run(config-&amp;gt;bus_cfg.spi.bus, PM_DEVICE_ACTION_RESUME);
				if(ret&amp;lt;0) {
					LOG_ERR(&amp;quot;lsm6dsl Driver Power Action failed : %d : PM_DEVICE_ACTION_RESUME.&amp;quot;, ret);
				} else {
					LOG_INF(&amp;quot;lsm6dsl Driver Power Action : PM_DEVICE_ACTION_RESUME.&amp;quot;);
				}
			}
			
			break;
		default:
			return -ENOTSUP;
	}

	return ret;
}
#endif /* CONFIG_PM_DEVICE */&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;And I am using below APIs to execute above actions&amp;nbsp;&lt;br /&gt;&lt;br /&gt;&lt;/p&gt;
&lt;div&gt;
&lt;div&gt;&lt;span&gt;#ifdef&lt;/span&gt;&lt;span&gt; CONFIG_PM_DEVICE&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span&gt;&amp;nbsp; &amp;nbsp; ret &lt;/span&gt;&lt;span&gt;=&lt;/span&gt;&lt;span&gt; &lt;/span&gt;&lt;span&gt;pm_device_action_run&lt;/span&gt;&lt;span&gt;(dev, PM_DEVICE_ACTION_SUSPEND);&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span&gt;#endif&lt;/span&gt;&lt;span&gt; /* CONFIG_PM_DEVICE */&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;div&gt;
&lt;div&gt;&lt;span&gt;#ifdef&lt;/span&gt;&lt;span&gt; CONFIG_PM_DEVICE&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span&gt;&amp;nbsp; &amp;nbsp; ret &lt;/span&gt;&lt;span&gt;=&lt;/span&gt;&lt;span&gt; &lt;/span&gt;&lt;span&gt;pm_device_action_run&lt;/span&gt;&lt;span&gt;(dev, PM_DEVICE_ACTION_RESUME);&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span&gt;#endif&lt;/span&gt;&lt;span&gt; /* CONFIG_PM_DEVICE */&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span&gt;&lt;span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span&gt;&lt;span&gt;Where the dev is&amp;nbsp;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;
&lt;div&gt;
&lt;div&gt;&lt;span&gt;const&lt;/span&gt;&lt;span&gt; &lt;/span&gt;&lt;span&gt;struct&lt;/span&gt;&lt;span&gt; &lt;/span&gt;&lt;span&gt;device&lt;/span&gt;&lt;span&gt; *const &lt;/span&gt;&lt;span&gt;dev&lt;/span&gt;&lt;span&gt; = DEVICE_DT_GET_ANY(st_lsm6dsl);&lt;/span&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: pm_device_action_run behavior when multipile sensors are connected on same bus</title><link>https://devzone.nordicsemi.com/thread/562831?ContentTypeID=1</link><pubDate>Mon, 09 Mar 2026 14:08:40 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:665dd995-5278-44ad-b927-96c3cfb9d593</guid><dc:creator>Hieu</dc:creator><description>&lt;p&gt;Hi Ankit_chauhan,&lt;/p&gt;
&lt;p&gt;There should be a&amp;nbsp;LSM6DSL available in the SDK. Why do you need a custom one?&lt;/p&gt;
&lt;p&gt;Could you please give me the implementation related to Power Management in the drivers?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: pm_device_action_run behavior when multipile sensors are connected on same bus</title><link>https://devzone.nordicsemi.com/thread/562600?ContentTypeID=1</link><pubDate>Thu, 05 Mar 2026 05:35:09 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:450643f9-9f2c-40d0-8306-e5a5357265d8</guid><dc:creator>Ankit_chauhan</dc:creator><description>&lt;p&gt;Hi Hieu,&lt;/p&gt;
&lt;p&gt;The ECG sensor that I am using is MAX30001 and the IMU sensor is LSM6DSL. Both are custom drives written by our own by taking reference from the sample drivers of Zephyr. Below is the device tree configuration that we are using in our dts. And I have also enabled &amp;quot;low-power-enable;&amp;quot; in the &amp;quot;&lt;span&gt;spi2_sleep&amp;quot; dtsi configuration&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;/p&gt;
&lt;p&gt;&amp;amp;spi2 {&lt;br /&gt; status = &amp;quot;okay&amp;quot;;&lt;br /&gt; pinctrl-0 = &amp;lt;&amp;amp;spi2_default&amp;gt;;&lt;br /&gt; pinctrl-1 = &amp;lt;&amp;amp;spi2_sleep&amp;gt;;&lt;br /&gt; pinctrl-names = &amp;quot;default&amp;quot;, &amp;quot;sleep&amp;quot;;&lt;br /&gt; cs-gpios = &amp;lt;&amp;amp;gpio0 19 GPIO_ACTIVE_LOW&amp;gt;, &lt;br /&gt; &amp;lt;&amp;amp;gpio0 15 GPIO_ACTIVE_LOW&amp;gt;;&lt;/p&gt;
&lt;p&gt;&lt;br /&gt; max30001: max30001@0 {&lt;br /&gt; compatible = &amp;quot;maxim,max30001&amp;quot;;&lt;br /&gt; irq-gpios = &amp;lt;&amp;amp;gpio0 23 GPIO_ACTIVE_LOW&amp;gt;;&lt;br /&gt; status = &amp;quot;okay&amp;quot;;&lt;br /&gt; reg = &amp;lt;0&amp;gt;;&lt;br /&gt; spi-max-frequency = &amp;lt;DT_FREQ_M(8)&amp;gt;;&lt;br /&gt; };&lt;/p&gt;
&lt;p&gt;&lt;br /&gt; lsm6dsl: lsm6dsl@1 {&lt;br /&gt; irq-gpios = &amp;lt;&amp;amp;gpio0 6 GPIO_ACTIVE_LOW&amp;gt;;&lt;br /&gt; compatible = &amp;quot;st,lsm6dsl&amp;quot;;&lt;br /&gt; status = &amp;quot;okay&amp;quot;;&lt;br /&gt; reg = &amp;lt;1&amp;gt;;&lt;br /&gt; spi-max-frequency = &amp;lt;DT_FREQ_M(8)&amp;gt;;&lt;br /&gt; };&lt;br /&gt;};&lt;br /&gt;&lt;br /&gt;&lt;/p&gt;
&lt;p&gt;We are not using any other configuration for these drivers except the trigger config.&amp;nbsp;&lt;/p&gt;
&lt;div&gt;
&lt;div&gt;&lt;span&gt;CONFIG_LSM6DSL_TRIGGER&lt;/span&gt;&lt;span&gt;=y&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;div&gt;
&lt;div&gt;&lt;span&gt;CONFIG_MAX30001_TRIGGER&lt;/span&gt;&lt;span&gt;=y&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span&gt;We are not using device runtime power configuration for suspend and resume. Below are the configuration related to the power&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;div&gt;
&lt;div&gt;&lt;span&gt;CONFIG_PM&lt;/span&gt;&lt;span&gt;=y&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span&gt;CONFIG_PM_DEVICE&lt;/span&gt;&lt;span&gt;=y&lt;/span&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: pm_device_action_run behavior when multipile sensors are connected on same bus</title><link>https://devzone.nordicsemi.com/thread/562467?ContentTypeID=1</link><pubDate>Tue, 03 Mar 2026 16:44:18 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:213242fa-c4ea-4ac8-a58e-ba9125ae182a</guid><dc:creator>Hieu</dc:creator><description>&lt;p&gt;&lt;span&gt;Hi&amp;nbsp;Ankit_chauhan,&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;Could you please share the part number of the sensor, or, preferably, which driver files are being compiled?&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;If you are unsure what driver files are used, please just share the &amp;quot;compatible&amp;quot; properties of the node in DeviceTree, and all relevant Kconfigs.&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: pm_device_action_run behavior when multipile sensors are connected on same bus</title><link>https://devzone.nordicsemi.com/thread/562371?ContentTypeID=1</link><pubDate>Tue, 03 Mar 2026 05:51:44 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:bf09d982-6376-4e0d-ac16-85321b431afe</guid><dc:creator>Ankit_chauhan</dc:creator><description>&lt;p&gt;Hi&amp;nbsp;&lt;span&gt;Hieu,&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;Thank you for the response.&amp;nbsp;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;I have two sensors, sensor 1 is the&amp;nbsp;Biopotential and Bioimpedance AFE that measures ECG. And sensor 2 is the IMU sensor. Both sensors are connected on SPI2 that uses&amp;nbsp;&lt;/span&gt;&lt;span&gt;&amp;quot;nordic,nrf-spim&amp;quot; interface.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;The dev that I am using in the application is from&amp;nbsp;&lt;/span&gt;&lt;span&gt;const&lt;/span&gt;&lt;span&gt; &lt;/span&gt;&lt;span&gt;struct&lt;/span&gt;&lt;span&gt; &lt;/span&gt;&lt;span&gt;device&lt;/span&gt;&lt;span&gt; *const &lt;/span&gt;&lt;span&gt;dev&lt;/span&gt;&lt;span&gt; = &lt;/span&gt;&lt;span&gt;DEVICE_DT_GET_ANY&lt;/span&gt;&lt;span&gt;(AFE); that is defined in the dts file inside SPI2 node.&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: pm_device_action_run behavior when multipile sensors are connected on same bus</title><link>https://devzone.nordicsemi.com/thread/562330?ContentTypeID=1</link><pubDate>Mon, 02 Mar 2026 14:25:39 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:f78ff7f2-b4e6-46ca-be5f-c79ba3b13010</guid><dc:creator>Hieu</dc:creator><description>&lt;p&gt;Hi&amp;nbsp;Ankit_chauhan,&lt;/p&gt;
[quote user=""]&lt;span&gt;What I observed is, when I call&amp;nbsp;&lt;/span&gt;&lt;span&gt;pm_device_action_run&lt;/span&gt;&lt;span&gt;(&lt;/span&gt;&lt;span&gt;dev&lt;/span&gt;&lt;span&gt;, &lt;/span&gt;&lt;span&gt;PM_DEVICE_ACTION_SUSPEND&lt;/span&gt;&lt;span&gt;); from sensor 1 it suspend the interface and I can see the success return from&amp;nbsp;&lt;/span&gt;pm_device_action_run. Now when application tried to suspend the sensor 2 using the same API then I observed that pm_action API of that sensor 2 is not executing which is registered in the driver. In short, if Sensor 1 is suspended then if I call&amp;nbsp;&lt;span&gt;pm_device_action_run it is not reaching to the driver pm_action API and I am not able to execute the Sensor 2 power suspend operations.&lt;/span&gt;[/quote]
&lt;p&gt;What is the &amp;quot;dev&amp;quot; you are using when you call pm_device_action_run() for these two sensors?&lt;/p&gt;
&lt;p&gt;The behavior might also depends on the sensor&amp;#39;s PM support a little. What sensors are you using here?&lt;/p&gt;
&lt;p&gt;Hieu&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>