<?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>I2S in NRF9161</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/107381/i2s-in-nrf9161</link><description>Hi. I am working on upgrading an old project made for NRF9160 to NRF9161. a Requirement that seems to require upgrading Zephyr/NRF SDK and this 10000 lines of application code too. Now I got stuck with I2S. It looks like a lots of stuff have changed since</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Mon, 29 Apr 2024 08:32:31 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/107381/i2s-in-nrf9161" /><item><title>RE: I2S in NRF9161</title><link>https://devzone.nordicsemi.com/thread/481007?ContentTypeID=1</link><pubDate>Mon, 29 Apr 2024 08:32:31 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:9ce38811-9e92-4681-945e-1d1c17957bfb</guid><dc:creator>fastfox</dc:creator><description>&lt;p&gt;I am using that. I need to study&amp;nbsp;this a bit before any conclusions. There are something like 6 I2C devices on that bus. Some use drivers from zephyr and some custom drivers outside of zephyr. But for some reason enabling CONFIG_LIS2DH&amp;nbsp; now gives hard faults. Problem could be anything really. I&amp;#39;ll open another question if I can&amp;#39;t sort it out by myself.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: I2S in NRF9161</title><link>https://devzone.nordicsemi.com/thread/481000?ContentTypeID=1</link><pubDate>Mon, 29 Apr 2024 07:52:26 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:514508c1-521c-4e65-8b8d-c7aa21394349</guid><dc:creator>Vidar Berg</dc:creator><description>&lt;div&gt;[quote userid="85365" url="~/f/nordic-q-a/107381/i2s-in-nrf9161/480993"]Unfortunately one I2C device now crashes the whole thing that had no problem in 2.5.0, but that is another story.[/quote]
&lt;p&gt;Are you using TWIM1 by any chance? In that case, disabling UARTE1 in TF-M should fix the problem.&lt;/p&gt;
&lt;p&gt;&lt;span&gt;You can disable UARTE1 and logging in TF-M by adding the following lines to your prj.conf file:&lt;/span&gt;&lt;/p&gt;
&lt;/div&gt;
&lt;div&gt;&lt;span&gt;CONFIG_TFM_SECURE_UART&lt;/span&gt;&lt;span&gt;=n&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span&gt;CONFIG_TFM_LOG_LEVEL_SILENCE&lt;/span&gt;&lt;span&gt;=y&lt;/span&gt;&lt;/div&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: I2S in NRF9161</title><link>https://devzone.nordicsemi.com/thread/480993?ContentTypeID=1</link><pubDate>Mon, 29 Apr 2024 07:24:05 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:abd04c2e-875e-4873-91d9-5e064f933d09</guid><dc:creator>fastfox</dc:creator><description>&lt;p&gt;Aww yeah, it works. I was using 2.5.0 and now updated to 2.6.1 and no problems with I2S anymore. Unfortunately one I2C device now crashes the whole thing that had no problem in 2.5.0, but that is another story.&lt;br /&gt;&lt;br /&gt;Thanks for your help!&lt;br /&gt;&lt;br /&gt;ps. I didn&amp;#39;t know that ozone can decode NRF register configurations. I need to try that.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: I2S in NRF9161</title><link>https://devzone.nordicsemi.com/thread/480631?ContentTypeID=1</link><pubDate>Thu, 25 Apr 2024 09:42:17 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:84999712-0389-4ce8-8486-f187ffe83ed7</guid><dc:creator>Vidar Berg</dc:creator><description>&lt;p&gt;Hello,&lt;/p&gt;
&lt;p&gt;Please check if your&amp;nbsp;platform/ext/target/nordic_nrf/common/core/target_cfg.c file includes this commit:&amp;nbsp;&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;. There was an issue in previous versions of the SDK that the I2S peripheral did not get configured as non-secure due to inconsistent naming between nRFx chip variants.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;With TF-M, peripherals will generally default to non-secure unless specified otherwise through the CONFIG_NRF_&amp;lt;peripheral_name&amp;gt;_SECURE symbols. Note: in SDK v2.6.0, the&amp;nbsp;CONFIG_NRF_UARTE1_SECURE is enabled by default for debug logging. This means that the following peripherals will not be accessible to the NS application:&lt;/p&gt;
&lt;p&gt;&lt;img style="max-height:240px;max-width:320px;" alt=" " src="https://devzone.nordicsemi.com/resized-image/__size/640x480/__key/communityserver-discussions-components-files/4/pastedimage1714038042923v1.png" /&gt;&lt;/p&gt;
[quote user="fastfox"]And if I try to decode that[/quote]
&lt;p&gt;I recommend using the peripheral viewer in the VS code or Segger Ozone debugger to view the register configurations so you don&amp;#39;t have to decode the memory dump by hand.&lt;/p&gt;
&lt;p&gt;Best regards,&lt;/p&gt;
&lt;p&gt;Vidar&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: I2S in NRF9161</title><link>https://devzone.nordicsemi.com/thread/479863?ContentTypeID=1</link><pubDate>Mon, 22 Apr 2024 07:26:09 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:deb46779-2ca0-4358-8ba6-1404b3326bca</guid><dc:creator>fastfox</dc:creator><description>&lt;p&gt;Ok. Finally back in debugging this puppy. I tried to confirm my theory about secure/non-secure problem by looking at how SPU is configured. This is a memory dump from what I believe is the SPU peripheral configuration memory area&lt;br /&gt;&lt;br /&gt;&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;SPU peripheral permissions @50003800
50003800 12 00 00 80 00 00 00 00 11 00 00 80 11 00 00 80
50003810 02 00 00 80 02 00 00 80 11 00 00 80 12 00 00 80
50003820 0A 00 00 80 0A 00 00 80 0A 00 00 80 0A 00 00 80
50003830 00 00 00 00 11 00 00 80 0A 00 00 80 02 00 00 80
50003840 02 00 00 80 02 00 00 80 00 00 00 00 00 00 00 00
50003850 02 00 00 80 02 00 00 80 00 00 00 00 03 00 00 80
50003860 02 00 00 80 00 00 00 00 00 00 00 00 02 00 00 80
50003870 02 00 00 80 02 00 00 80 02 00 00 80 02 00 00 80
50003880 02 00 00 80 0A 00 00 80 0A 00 00 80 0A 00 00 80
50003890 0A 00 00 80 00 00 00 00 3A 00 00 80 00 00 00 00
500038A0 3A 00 00 80 00 00 00 00 02 00 00 80 00 00 00 00
500038B0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;I2S ID == 40 == 0x28&lt;br /&gt;So I suppose it is found from this line&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;50003820 0A 00 00 80 0A 00 00 80 0A 00 00 80 0A 00 00 80 00 00&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;And if I try to decode that&lt;br /&gt;&lt;br /&gt;&lt;pre class="ui-code" data-mode="text"&gt;0A 00 00 80
00001010 00000000 00000000 10000000
Swap
10000000 00000000 00000000 00001010
F == 1 == Peripheral present
A == 10 == 2 == User selectable
B == 10 == 2 == DMA has a separate attribute
C == 0 == Non secure
D == 0 == DMA transfer is non-secure
E == 0 == Unlocked&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;So I2S is configured as non-secure just as it should be. I suppose there goes that theory then. Now I again have no idea why do I get that bus fault. But I just need to keep digging&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: I2S in NRF9161</title><link>https://devzone.nordicsemi.com/thread/475627?ContentTypeID=1</link><pubDate>Mon, 25 Mar 2024 12:13:52 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:ed35bd69-bcca-4ff7-b25c-ad06f6e90a41</guid><dc:creator>fastfox</dc:creator><description>&lt;p&gt;Noup. This is in my low priority list. But it has to be done at some point anway. I&amp;#39;ll post here once I get back to this and figure out how to get it working.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: I2S in NRF9161</title><link>https://devzone.nordicsemi.com/thread/475541?ContentTypeID=1</link><pubDate>Mon, 25 Mar 2024 07:51:09 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:8714d987-39aa-4dcd-beb4-0f3cdd9986ad</guid><dc:creator>Michal</dc:creator><description>&lt;p&gt;Hello,&lt;/p&gt;
&lt;p&gt;Did you get any progress on that in the meantime by chance?&lt;/p&gt;
&lt;p&gt;Best regards,&lt;/p&gt;
&lt;p&gt;Michal&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: I2S in NRF9161</title><link>https://devzone.nordicsemi.com/thread/472303?ContentTypeID=1</link><pubDate>Tue, 05 Mar 2024 17:10:42 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:ef9caa4d-29fc-49b5-8bf9-57df3523ba9a</guid><dc:creator>Michal</dc:creator><description>&lt;p&gt;I will have to research more into the secure/insecure peripherals and ask around my colleagues, as I am not an expert on TF-M.&lt;/p&gt;
&lt;p&gt;I will get back to you.&lt;/p&gt;
&lt;p&gt;Best regards,&lt;/p&gt;
&lt;p&gt;Michal&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: I2S in NRF9161</title><link>https://devzone.nordicsemi.com/thread/471981?ContentTypeID=1</link><pubDate>Mon, 04 Mar 2024 10:39:27 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:d1ee7c88-a38b-4ece-ad0d-e6578902017e</guid><dc:creator>fastfox</dc:creator><description>&lt;p&gt;Yes I did&amp;nbsp;&lt;span&gt;CONFIG_I2S=y&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;You don&amp;#39;t have any idea how to make sure that I2S really is insecure? I need to try to find some documentation for this once I again get more urgent matters away from my desk.&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;First just try it&lt;/li&gt;
&lt;li&gt;Then debug it&lt;/li&gt;
&lt;li&gt;If nothing else helps, read the manual&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;span class="emoticon" data-url="https://devzone.nordicsemi.com/cfs-file/__key/system/emoji/1f642.svg" title="Slight smile"&gt;&amp;#x1f642;&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: I2S in NRF9161</title><link>https://devzone.nordicsemi.com/thread/471146?ContentTypeID=1</link><pubDate>Tue, 27 Feb 2024 22:28:25 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:d15435d2-2986-49b9-9397-b38003baca3a</guid><dc:creator>Michal</dc:creator><description>&lt;p&gt;Hello,&lt;/p&gt;
&lt;p&gt;The nrfy part is from a rework of the nrfx driver which I was not aware of at the time.&lt;/p&gt;
&lt;p&gt;Did you add CONFIG_I2S=y to prj.conf?&lt;/p&gt;
&lt;p&gt;Though with a pure nrfx solution I think that using devicetree should not be required.&lt;/p&gt;
&lt;p&gt;Best regards,&lt;/p&gt;
&lt;p&gt;Michal&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: I2S in NRF9161</title><link>https://devzone.nordicsemi.com/thread/470727?ContentTypeID=1</link><pubDate>Mon, 26 Feb 2024 12:38:57 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:a141bccd-0103-41a2-b901-7070d71e03a1</guid><dc:creator>fastfox</dc:creator><description>&lt;p&gt;So, I finally had some time to invest to this one. These errors are from my own code. It is not very easy to port samples to the custom HW I am using. No idea why the nrfy. This is straight from the SDK.&lt;br /&gt;&lt;br /&gt;I am pretty sure that the crash happens because I2S peripheral is secure by default. There used to be a way to make it unsecure by modifying spm.c. But this is apparently no more possible.&lt;br /&gt;&lt;br /&gt;If I understood correctly, now you would need to add `CONFIG_I2S_NRFX=y` and that would set the peripheral to unsecure. But to add that you will also need to modify the device tree for it to compile. which I tried to do like this:&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;&amp;amp;pinctrl {

	i2s0_default: i2s0_default {
		group1 {
			psels = &amp;lt;NRF_PSEL(I2S_SCK_M, 0, 24)&amp;gt;,
				&amp;lt;NRF_PSEL(I2S_LRCK_M, 0, 23)&amp;gt;,
				&amp;lt;NRF_PSEL(I2S_SDIN, 0, 25)&amp;gt;;
		};
	};

	i2s0_sleep: i2s0_sleep {
		group1 {
			psels = &amp;lt;NRF_PSEL(I2S_SCK_M, 0, 24)&amp;gt;,
				&amp;lt;NRF_PSEL(I2S_LRCK_M, 0, 23)&amp;gt;,
				&amp;lt;NRF_PSEL(I2S_SDIN, 0, 25)&amp;gt;;
			low-power-enable;
		};
	};
};


&amp;amp;i2s0 {
	compatible = &amp;quot;nordic,nrf-i2s&amp;quot;;
	status = &amp;quot;okay&amp;quot;;
	pinctrl-0 = &amp;lt;&amp;amp;i2s0_default&amp;gt;;
	pinctrl-1 = &amp;lt;&amp;amp;i2s0_sleep&amp;gt;;
	pinctrl-names = &amp;quot;default&amp;quot;, &amp;quot;sleep&amp;quot;;
};&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;But only effect is that device crashes even earlier to a bus fault in 4002 8564. That is SCK signal so obviously I am doing something wrong.&amp;nbsp;My HW only has WS, SD and SCK connected.&lt;/p&gt;
&lt;p&gt;What I would of course prefer would be to not use device tree at all since that is how the legacy code was originally made. But anyways. All the hints are welcome. It is also possible that I am completely in the wrong track with my investigation here.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: I2S in NRF9161</title><link>https://devzone.nordicsemi.com/thread/465397?ContentTypeID=1</link><pubDate>Mon, 22 Jan 2024 15:29:35 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:42f9e204-9e29-45bb-ac33-b029fd5d15a4</guid><dc:creator>Michal</dc:creator><description>&lt;p&gt;Is it from the sample, or from your own code?&lt;/p&gt;
&lt;p&gt;Also, why is called nrf&lt;strong&gt;y&lt;/strong&gt;_i2s_config_t?&lt;/p&gt;
&lt;p&gt;Best regards,&lt;/p&gt;
&lt;p&gt;Michal&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: I2S in NRF9161</title><link>https://devzone.nordicsemi.com/thread/465233?ContentTypeID=1</link><pubDate>Mon, 22 Jan 2024 09:04:43 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:2e175f5e-57cd-44d6-80d7-6e73bc9ca137</guid><dc:creator>fastfox</dc:creator><description>&lt;p&gt;I finally got&amp;nbsp;a debugger working at least somehow. It shows that it crashes to bus fault as soon as the NRF driver touches MODE at 0x40028504. To me this seems like exactly the correct address to set the mode. Any ideas what might cause this?&lt;/p&gt;
&lt;p&gt;Screenshot just before the&amp;nbsp;last function call shows that config and pointer to peripheral should be ok:&lt;/p&gt;
&lt;p&gt;&lt;img style="max-height:240px;max-width:320px;" src="https://devzone.nordicsemi.com/resized-image/__size/640x480/__key/communityserver-discussions-components-files/4/pastedimage1705914056447v1.png" alt=" " /&gt;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Screeshot just before the crash shows that everything should still be ok:&lt;/p&gt;
&lt;p&gt;&lt;img style="max-height:240px;max-width:320px;" src="https://devzone.nordicsemi.com/resized-image/__size/640x480/__key/communityserver-discussions-components-files/4/pastedimage1705914185891v2.png" alt=" " /&gt;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Not sure how trustworthy the data here is as it looks like almost all the flags are on. But a bus fault anyway:&lt;/p&gt;
&lt;p&gt;&lt;img style="max-height:240px;max-width:320px;" src="https://devzone.nordicsemi.com/resized-image/__size/640x480/__key/communityserver-discussions-components-files/4/pastedimage1705914247520v3.png" alt=" " /&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: I2S in NRF9161</title><link>https://devzone.nordicsemi.com/thread/464372?ContentTypeID=1</link><pubDate>Tue, 16 Jan 2024 12:07:38 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:d680e7d3-b233-49ef-b19a-1edf084c47d0</guid><dc:creator>Michal</dc:creator><description>&lt;p&gt;Hello,&lt;/p&gt;
&lt;p&gt;There is an &lt;a href="https://developer.nordicsemi.com/nRF_Connect_SDK/doc/2.5.1/zephyr/samples/boards/litex/i2s/README.html"&gt;I2S sample&lt;/a&gt; in Zephyr.&lt;/p&gt;
&lt;p&gt;Best regards,&lt;/p&gt;
&lt;p&gt;Michal&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>