<?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>Bus Fault in DMIC Driver on NRF9160 After Upgrading to SDK Version 2.5.0</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/105128/bus-fault-in-dmic-driver-on-nrf9160-after-upgrading-to-sdk-version-2-5-0</link><description>I&amp;#39;ve recently encountered an issue with the DMIC driver on the NRF9160 after updating to SDK version 2.5.0. Specifically, a bus fault arises during the initialization phase of Zephyr. 
 Some observations and details: 
 
 The BusFault Address Register</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Tue, 14 Nov 2023 18:01:48 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/105128/bus-fault-in-dmic-driver-on-nrf9160-after-upgrading-to-sdk-version-2-5-0" /><item><title>RE: Bus Fault in DMIC Driver on NRF9160 After Upgrading to SDK Version 2.5.0</title><link>https://devzone.nordicsemi.com/thread/455630?ContentTypeID=1</link><pubDate>Tue, 14 Nov 2023 18:01:48 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:22256355-f618-41bf-a51b-4d767a6dc06d</guid><dc:creator>Raoul</dc:creator><description>&lt;p&gt;That is great, I&amp;#39;m glad to read that. Thank you for coming back to report!&lt;/p&gt;
[quote user="sensorbee-dev"]I appreciate the detailed explanation and the links to the specific code changes.[/quote]
&lt;p&gt;Thanks!&lt;/p&gt;
&lt;p&gt;Best regards,&lt;/p&gt;
&lt;p&gt;Raoul&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Bus Fault in DMIC Driver on NRF9160 After Upgrading to SDK Version 2.5.0</title><link>https://devzone.nordicsemi.com/thread/455535?ContentTypeID=1</link><pubDate>Tue, 14 Nov 2023 13:31:51 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:596fd136-17fa-4f6b-a88e-a301a0cb288e</guid><dc:creator>sensorbee-dev</dc:creator><description>&lt;p&gt;Hi Raoul,&lt;/p&gt;
&lt;p&gt;Fantastic news! I applied the changes from the latest commit, and I&amp;#39;m happy to report that the issue is now resolved. The DMIC is functioning correctly on the NRF9160.&lt;/p&gt;
&lt;p&gt;I appreciate the detailed explanation and the links to the specific code changes.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Bus Fault in DMIC Driver on NRF9160 After Upgrading to SDK Version 2.5.0</title><link>https://devzone.nordicsemi.com/thread/455517?ContentTypeID=1</link><pubDate>Tue, 14 Nov 2023 12:49:16 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:7e307349-fbfe-415d-9986-af69e3da69e6</guid><dc:creator>Raoul</dc:creator><description>&lt;p&gt;Hi Sensorbee,&lt;/p&gt;
&lt;p&gt;Thanks for confirming! It&amp;#39;s all becoming clear now.&lt;/p&gt;
&lt;p&gt;There were indeed two peripherals that were misnamed in the TF-M configuration in NCS v2.5.0. PDM was one of them.&lt;br /&gt;&lt;br /&gt;If you&amp;#39;re curious, you can see here: &lt;a href="https://github.com/nrfconnect/sdk-trusted-firmware-m/blob/8f6d96538f2221ac3a5c7df2e8fdbe3bd147d2ce/platform/ext/target/nordic_nrf/common/core/target_cfg.c#L829"&gt;https://github.com/nrfconnect/sdk-trusted-firmware-m/blob/8f6d96538f2221ac3a5c7df2e8fdbe3bd147d2ce/platform/ext/target/nordic_nrf/common/core/target_cfg.c#L829&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;that the PDM instance is referred to as PDM0, while the MDK refers to the PDM without any number: &lt;a href="https://github.com/NordicSemiconductor/nrfx/blob/f147ea557d5e2a04cb95ab8328204bcf36d8f410/mdk/nrf9160.h#L2257"&gt;https://github.com/NordicSemiconductor/nrfx/blob/f147ea557d5e2a04cb95ab8328204bcf36d8f410/mdk/nrf9160.h#L2257&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;So there was a mismatch. Fortunately, the fix has already been commited: &lt;a href="https://github.com/nrfconnect/sdk-trusted-firmware-m/commit/f2a462080edc42818003d052c57d777954220145"&gt;https://github.com/nrfconnect/sdk-trusted-firmware-m/commit/f2a462080edc42818003d052c57d777954220145&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;Apply those changes, and you should be good.&lt;/p&gt;
&lt;p&gt;Best regards,&lt;/p&gt;
&lt;p&gt;Raoul&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Bus Fault in DMIC Driver on NRF9160 After Upgrading to SDK Version 2.5.0</title><link>https://devzone.nordicsemi.com/thread/455463?ContentTypeID=1</link><pubDate>Tue, 14 Nov 2023 09:15:34 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:55edf83a-0b46-45f0-9dd3-1bf594254e95</guid><dc:creator>sensorbee-dev</dc:creator><description>&lt;p&gt;Hi Raoul,&lt;/p&gt;
&lt;p&gt;Thank you for the suggestion. Following your advice, I built the DMIC sample for the &lt;code&gt;nrf9160dk_nrf9160&lt;/code&gt; board, targeting the secure build instead of the &lt;code&gt;nrf9160dk_nrf9160_ns&lt;/code&gt;.&lt;/p&gt;
&lt;p&gt;Interestingly, the DMIC sample worked with the secure build. This result aligns with your theory about a potential issue with the TF-M definitions affecting peripheral access in the non-secure partition.&lt;/p&gt;
&lt;p&gt;If you have any more suggestions or need additional information from my tests, please let me know.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Bus Fault in DMIC Driver on NRF9160 After Upgrading to SDK Version 2.5.0</title><link>https://devzone.nordicsemi.com/thread/455401?ContentTypeID=1</link><pubDate>Mon, 13 Nov 2023 18:19:24 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:751da968-6c6f-49bc-9c21-0785c69bff2e</guid><dc:creator>Raoul</dc:creator><description>&lt;p&gt;Hi again,&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Could you try building your DMIC sample in the exact same as you did previously, but for the nrf9160dk_nrf9160 board? Meaning, the &amp;quot;secure&amp;quot; build. I&amp;#39;m assuming you&amp;#39;ve built for nrf9160dk_nrf9160_ns so far.&lt;/p&gt;
&lt;p&gt;I&amp;#39;m curious if you would still get the same issue with the secure build.&lt;/p&gt;
&lt;p&gt;I&amp;#39;ve discovered some recent cases that might possibly be related - It&amp;#39;s possible that there is an error in some TF-M definitions which make peripherals inaccessible to the non-secure partition.&lt;/p&gt;
&lt;p&gt;Best regards,&lt;/p&gt;
&lt;p&gt;Raoul&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Bus Fault in DMIC Driver on NRF9160 After Upgrading to SDK Version 2.5.0</title><link>https://devzone.nordicsemi.com/thread/454805?ContentTypeID=1</link><pubDate>Thu, 09 Nov 2023 00:06:24 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:ae8840df-861f-4a01-af2a-8a9dfb305406</guid><dc:creator>Raoul</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;Interesting, thank you for the details! That&amp;#39;s really useful.&lt;/p&gt;
&lt;p&gt;I&amp;#39;m not sure what the culprit is yet, but I&amp;#39;m looking into this and will keep you updated.&lt;/p&gt;
&lt;p&gt;Best regards,&lt;/p&gt;
&lt;p&gt;Raoul&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Bus Fault in DMIC Driver on NRF9160 After Upgrading to SDK Version 2.5.0</title><link>https://devzone.nordicsemi.com/thread/453927?ContentTypeID=1</link><pubDate>Fri, 03 Nov 2023 10:19:13 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:aa9ddf88-5529-42d0-a19a-66d8c053449f</guid><dc:creator>sensorbee-dev</dc:creator><description>&lt;p&gt;Hi Raoul,&lt;/p&gt;
&lt;p&gt;Thank you for looking into this. I appreciate your efforts. Here&amp;#39;s an update on the situation after following your suggestions and performing some additional tests:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;
&lt;p&gt;I attempted to run the DMIC sample on our custom NRF9160-based board after executing &lt;code&gt;west update&lt;/code&gt;. Unfortunately, we encountered the same bus fault as before.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;For comparison, I also ran the DMIC sample on an NRF5340DK. In this case, it functioned correctly without any issues, indicating that the problem seems to be specific to the NRF9160.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Further testing on an NRF9160DK board did not yield positive results. Although I couldn&amp;#39;t confirm if it&amp;#39;s the exact same issue faced with our custom board, the debug session was unsuccessful. An attempt to pause the execution led to an error message: &amp;quot;Internal error: Failed to update peripheral PDM_NS after memory reads.&amp;quot; EDIT: It did however work without issues using SDK version 2.4.2.&lt;/p&gt;
&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;Given these outcomes, it seems the problem might be specific to the NRF9160 in the context of SDK version 2.5.0.&lt;/p&gt;
&lt;p&gt;Here is the overlay that I used for the NRF9160DK board:&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;&amp;amp;pinctrl {
	pdm0_default_alt: pdm0_default_alt {
		group1 {
			psels = &amp;lt;NRF_PSEL(PDM_CLK, 0, 18)&amp;gt;,
				&amp;lt;NRF_PSEL(PDM_DIN, 0, 19)&amp;gt;;
		};
	};
};

dmic_dev: &amp;amp;pdm0 {
	status = &amp;quot;okay&amp;quot;;
	pinctrl-0 = &amp;lt;&amp;amp;pdm0_default_alt&amp;gt;;
	pinctrl-names = &amp;quot;default&amp;quot;;
	clock-source = &amp;quot;PCLK32M_HFXO&amp;quot;;
};&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;If you have any further insights or suggestions, they would be greatly appreciated.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Bus Fault in DMIC Driver on NRF9160 After Upgrading to SDK Version 2.5.0</title><link>https://devzone.nordicsemi.com/thread/453854?ContentTypeID=1</link><pubDate>Thu, 02 Nov 2023 22:52:34 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:ca0fd0f7-b517-4031-ada2-a93d5ac226a0</guid><dc:creator>Raoul</dc:creator><description>&lt;p&gt;Hi, and sorry for the late reply.&lt;/p&gt;
[quote user=""]&lt;ul&gt;&lt;li&gt;The BusFault Address Register (BFAR) indicates that the fault was triggered by address &lt;code&gt;0x40006540 [PDM-&amp;gt;CLK]&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;The previous SDK version I was using was 2.4.2, and I didn&amp;#39;t experience this issue.&lt;/li&gt;
&lt;li&gt;I haven&amp;#39;t made any modifications to the DMIC configuration or altered anything within the device tree.&lt;/li&gt;
&lt;li&gt;Due to the early occurrence of the fault during the boot-up process, I&amp;#39;ve been unable to retrieve any logs.&lt;/li&gt;
&lt;li&gt;I have also tried to look for any changes in the driver that could be causing this issue, but there does not seem to have been any significant changes recently.&lt;/li&gt;&lt;/ul&gt;[/quote]
&lt;p&gt;Thanks for your clear description!&lt;/p&gt;
[quote user=""]Has anyone else faced a similar issue or have suggestions on how to resolve it?[/quote]
&lt;p&gt;No, I can&amp;#39;t find any reference to this either internally or on DevZone. But v2.5.0 has not been out for long.&lt;/p&gt;
&lt;p&gt;I also don&amp;#39;t see any changed to DMIC drivers mentioned in the release notes.&lt;/p&gt;
&lt;p&gt;So far I haven&amp;#39;t figured out what could be causing this, but I&amp;#39;ll let you know if I find anything. Keep me updated if you happen to fix it!&lt;/p&gt;
&lt;p&gt;By the way, which board are you using? Are you able to run your application on a DK, on v2.4.2 and v2.5.0? Or have you tried running the DMIC sample in v2.5.0?&lt;/p&gt;
&lt;p&gt;Best regards,&lt;/p&gt;
&lt;p&gt;Raoul&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>