<?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>Clock configuration</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/119881/clock-configuration</link><description>Hi,I have been using I2S communication in nrf54l15 DK board with zephyr but couldn&amp;#39;t able to get clock to I2s .I couldn&amp;#39;t able to get configure clock in overlay file ,can you help me with that.</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Tue, 18 Mar 2025 14:32:39 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/119881/clock-configuration" /><item><title>RE: Clock configuration</title><link>https://devzone.nordicsemi.com/thread/527874?ContentTypeID=1</link><pubDate>Tue, 18 Mar 2025 14:32:39 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:5430714d-5b38-4321-b6c0-f9b2bcb28801</guid><dc:creator>Kenneth</dc:creator><description>&lt;p&gt;If you haven&amp;#39;t already, can you just check that the default i2s examples work?&amp;nbsp;&lt;/p&gt;
&lt;p&gt;\zephyr\tests\drivers\i2s&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Looks like both examples I can find there have overlay files for the nRF54L15.&lt;/p&gt;
&lt;p&gt;Kenneth&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Clock configuration</title><link>https://devzone.nordicsemi.com/thread/527858?ContentTypeID=1</link><pubDate>Tue, 18 Mar 2025 13:48:03 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:0efc7ee2-1672-4973-b228-850f7521cdba</guid><dc:creator>Kashyap23</dc:creator><description>&lt;p&gt;In that specified I need to use only clock pin only for MCK,SCK right? . I have gone through pin assignment and changed SCK to p1.03&amp;nbsp; even though I am not able to get data.Do I need to configure and clock setup in overlay?&lt;pre class="ui-code" data-mode="text"&gt;#include &amp;lt;zephyr/kernel.h&amp;gt;
#include &amp;lt;zephyr/sys/printk.h&amp;gt;
#include &amp;lt;zephyr/drivers/i2s.h&amp;gt;
#include &amp;lt;zephyr/drivers/gpio.h&amp;gt;
#include &amp;lt;string.h&amp;gt;

#define I2S_RX_NODE DT_NODELABEL(i2s_rxtx)

#define SAMPLE_FREQUENCY 16000
#define SAMPLE_BIT_WIDTH 32
#define BYTES_PER_SAMPLE sizeof(int16_t)
#define NUMBER_OF_CHANNELS 1
#define SAMPLES_PER_BLOCK ((SAMPLE_FREQUENCY / 10) * NUMBER_OF_CHANNELS)
#define INITIAL_BLOCKS 2
#define TIMEOUT 1000

#define BLOCK_SIZE (BYTES_PER_SAMPLE * SAMPLES_PER_BLOCK)
#define BLOCK_COUNT (INITIAL_BLOCKS + 2)
K_MEM_SLAB_DEFINE_STATIC(mem_slab, BLOCK_SIZE, BLOCK_COUNT, 4);

static int16_t echo_block[SAMPLES_PER_BLOCK];
uint8_t loopCnt = 0;

static void process_block_data(void *mem_block, uint32_t number_of_samples)
{
	for (int i = 0; i &amp;lt; number_of_samples; ++i)
	{
		int16_t *sample = &amp;amp;((int16_t *)mem_block)[i];
		// *sample += echo_block[i];
		// echo_block[i] = (*sample) / 2;
		echo_block[i] = *sample;
		// printk(&amp;quot;%d\n&amp;quot;, echo_block[i]);
	}
	printk(&amp;quot;Samples: %d\n&amp;quot;, number_of_samples);
	// k_sleep(K_MSEC(100));
}

static bool configure_streams(const struct device *i2s_dev_rx, const struct i2s_config *config)
{
	int ret = i2s_configure(i2s_dev_rx, I2S_DIR_RX, config);
	if (ret == 0)
	{
		printk(&amp;quot;Configure Stream Successful.\n&amp;quot;);
		return true;
	}
	printk(&amp;quot;Failed to configure streams: %d\n&amp;quot;, ret);
	return false;
}

static bool trigger_command(const struct device *i2s_dev_rx, enum i2s_trigger_cmd cmd)
{
	int ret = i2s_trigger(i2s_dev_rx, I2S_DIR_RX, cmd);
	if (ret == 0)
	{
		printk(&amp;quot;Trigger Command Successful.\n&amp;quot;);
		return true;
	}
	printk(&amp;quot;Failed to trigger command %d: %d\n&amp;quot;, cmd, ret);
	return false;
}

int main(void)
{
	const struct device *const i2s_dev_rx = DEVICE_DT_GET(I2S_RX_NODE);
	struct i2s_config config;

	printk(&amp;quot;I2S echo sample\n&amp;quot;);

	if (!device_is_ready(i2s_dev_rx))
	{
		printk(&amp;quot;%s is not ready\n&amp;quot;, i2s_dev_rx-&amp;gt;name);
		return 0;
	}

	config.word_size = SAMPLE_BIT_WIDTH;
	config.channels = NUMBER_OF_CHANNELS;
	config.format = I2S_FMT_DATA_FORMAT_I2S;
	config.options = I2S_OPT_BIT_CLK_MASTER | I2S_OPT_FRAME_CLK_MASTER;
	config.frame_clk_freq = SAMPLE_FREQUENCY;
	config.mem_slab = &amp;amp;mem_slab;
	config.block_size = BLOCK_SIZE;
	config.timeout = TIMEOUT;

	if (!configure_streams(i2s_dev_rx, &amp;amp;config))
	{
		return 0;
	}

	if (!trigger_command(i2s_dev_rx, I2S_TRIGGER_START))
	{
		return 0;
	}

	printk(&amp;quot;Streams started\n&amp;quot;);

	while (1)
	{
		void *mem_block;
		uint32_t block_size;
		int ret;

		ret = i2s_read(i2s_dev_rx, &amp;amp;mem_block, &amp;amp;block_size);
		if (ret &amp;lt; 0)
		{
			printk(&amp;quot;Failed to read data: %d\n&amp;quot;, ret);
			break;
		}

		process_block_data(mem_block, block_size);

		// int16_t *data = (int16_t *)mem_block;
		// for (size_t i = 0; i &amp;lt; block_size / sizeof(int16_t); i++)
		// {
		// 	printk(&amp;quot;Data[%zu]: %d\n&amp;quot;, i, data[i]);
		// }

		k_mem_slab_free(&amp;amp;mem_slab, mem_block);

		printk(&amp;quot;Loop: %d\n&amp;quot;, loopCnt);
		loopCnt++;
	}
	printk(&amp;quot;Exiting main loop\n&amp;quot;);
	return 0;
}&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;I am getting,&lt;/p&gt;
&lt;p&gt;Starting nrf54l15dk with CPU frequency: 128 MHz&lt;br /&gt;I2S echo sample&lt;br /&gt;Failed to read data: -11&lt;br /&gt;Streams stopped&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Clock configuration</title><link>https://devzone.nordicsemi.com/thread/527815?ContentTypeID=1</link><pubDate>Tue, 18 Mar 2025 11:11:45 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:70339320-eebb-4d6e-be51-7ce06cd27449</guid><dc:creator>Kenneth</dc:creator><description>&lt;p&gt;Hello,&lt;/p&gt;
&lt;p&gt;Make sure to fulfill the requirement set here:&lt;br /&gt;&lt;a href="https://docs.nordicsemi.com/bundle/ps_nrf54L15/page/chapters/pin.html#ariaid-title3"&gt;https://docs.nordicsemi.com/bundle/ps_nrf54L15/page/chapters/pin.html#ariaid-title3&lt;/a&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;In specific that both MCK and&amp;nbsp;&lt;span&gt;SCK need to use a pin that is a &amp;quot;Clock pin&amp;quot;, see Table 3. QFN48 pin assignments for which pins are &amp;quot;Clock pin&amp;quot;.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;Kenneth&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>