<?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>I2C communication between  Renesas MCU(master) -&amp;gt; nRF5340(slave).</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/127033/i2c-communication-between-renesas-mcu-master---nrf5340-slave</link><description>Hello Nordic Team, 
 I am using nRF5340 DK as a debugger/programmer to develop firmware for the Fanstel EV-WT02C40C module. My goal is to do i2c communication between Renesas MCU and EV-WT02C40C board with nRF Connect SDK . 
 I have a few i2c communication</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Thu, 05 Mar 2026 11:22:59 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/127033/i2c-communication-between-renesas-mcu-master---nrf5340-slave" /><item><title>RE: I2C communication between  Renesas MCU(master) -&gt; nRF5340(slave).</title><link>https://devzone.nordicsemi.com/thread/562631?ContentTypeID=1</link><pubDate>Thu, 05 Mar 2026 11:22:59 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:0f649f6f-c402-4074-809d-236055d1ca9f</guid><dc:creator>Embedded developer0</dc:creator><description>&lt;p&gt;&lt;span&gt;Hey &lt;/span&gt;&lt;strong&gt;&lt;span&gt;Simon D-M&lt;/span&gt;&lt;/strong&gt;&lt;span&gt;,&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;Thank you very much for your help.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;I managed to fix the I2C master transmit and receive issue. The problem was actually coming from the code snippet below:&lt;/span&gt;&lt;/p&gt;
&lt;pre dir="ltr"&gt;&lt;code dir="ltr"&gt;&lt;span&gt;static int sample_target_buf_read_requested_cb(struct i2c_target_config *config,
                                               uint8_t **data, uint32_t *size)
{
    // printk(&amp;quot;sample target buffer read requested\n&amp;quot;);
    // static uint8_t buffer&lt;span&gt;[1]&lt;/span&gt; = {0x44};
    *data = rx_buf;
    *size = sizeof(rx_buf);
    return 0;
}&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;&lt;span&gt;When these two lines were enabled:&lt;/span&gt;&lt;/p&gt;
&lt;pre dir="ltr"&gt;&lt;code dir="ltr"&gt;&lt;span&gt;printk(&amp;quot;sample target buffer read requested\n&amp;quot;);
static uint8_t buffer&lt;span&gt;[1]&lt;/span&gt; = {0x44};&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;&lt;span&gt;they introduced a small delay. Since this function is executed inside a callback context, the delay was not acceptable and the I2C read operation was failing.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;After commenting out these lines, the code works perfectly and the I2C master can now transmit and receive data correctly.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;Thanks again for your support!&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;br /&gt;&lt;br /&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: I2C communication between  Renesas MCU(master) -&gt; nRF5340(slave).</title><link>https://devzone.nordicsemi.com/thread/562060?ContentTypeID=1</link><pubDate>Wed, 25 Feb 2026 14:10:10 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:fa30bfe8-056a-418f-964a-43748790b9eb</guid><dc:creator>Simon D-M</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;Do you still get the hard-fault ? Can you show me the full logs, to see if they are the exact same?&lt;/p&gt;
&lt;p&gt;Have you updated the&lt;code&gt; main.c&lt;/code&gt;, the &lt;code&gt;prj.conf&lt;/code&gt; and the &lt;code&gt;nrf5340dk_nrf5340_cpuapp.overlay&lt;/code&gt; with the code that I sent you?&lt;/p&gt;
&lt;p&gt;It sounds strange that it still happens, because I tried the reading and writing on this sample, and it worked on my end... Can you maybe also show me the firmware that you use as a master ?&lt;/p&gt;
&lt;p&gt;Best regards,&lt;/p&gt;
&lt;p&gt;Simon D-M&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: I2C communication between  Renesas MCU(master) -&gt; nRF5340(slave).</title><link>https://devzone.nordicsemi.com/thread/562048?ContentTypeID=1</link><pubDate>Wed, 25 Feb 2026 13:46:54 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:883250f6-3af8-4301-b971-4eb208c80dd6</guid><dc:creator>Embedded developer0</dc:creator><description>&lt;p&gt;&lt;span style="background-color:#eeeeee;"&gt;&lt;span style="background-color:#ffffff;"&gt;hi,&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="background-color:#eeeeee;"&gt;still im facing same problem, data writing from master to slave is working fine&lt;br /&gt;but when master(controller) trying to read data from slave, slave is not sending data on bus.&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="background-color:#eeeeee;"&gt;&lt;span style="background-color:#eeeeee;"&gt;during reading from slave,&amp;nbsp; just address + ack bit is coming. data is missing&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;i tried with both method&amp;nbsp;&lt;br /&gt;buffer method and non-buffer method. both method giving same result&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: I2C communication between  Renesas MCU(master) -&gt; nRF5340(slave).</title><link>https://devzone.nordicsemi.com/thread/561808?ContentTypeID=1</link><pubDate>Mon, 23 Feb 2026 10:32:28 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:67283ae1-6c4c-4ad2-a03a-5759b1d28fa2</guid><dc:creator>Simon D-M</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;I&amp;#39;ve used the &amp;quot;&lt;code&gt;custom_target&lt;/code&gt;&amp;quot; sample as a base for my small sample.&lt;/p&gt;
&lt;p&gt;I first encountered the same issue you had with the hard fault. However, this is because the sample used is not configured to use the config &amp;quot;&lt;code&gt;CONFIG_I2C_TARGET_BUFFER_MODE&lt;/code&gt;&amp;quot; which is enabled by default. The result is that when the i2c receive a request, it tries to call a callback which is not implemented. Thus provoke a hard fault in the MCU.&lt;/p&gt;
&lt;p&gt;To fix that, we either need to deactivate that configuration or to implement these callbacks. I choose to implement the callbacks as it is preferable to use the &amp;quot;buffer mode&amp;quot;.&lt;/p&gt;
&lt;p&gt;Here is the resulting code (&lt;em&gt;I tried on a nrf54l15 so the nrf5340 overlay hasn&amp;#39;t been tested&lt;/em&gt;):&lt;/p&gt;
&lt;p&gt;&lt;code&gt;main.c&lt;/code&gt;&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;/*
 * Copyright (c) 2024 Open Pixel Systems
 *
 * SPDX-License-Identifier: Apache-2.0
 */

#include &amp;lt;zephyr/kernel.h&amp;gt;
#include &amp;lt;zephyr/sys/printk.h&amp;gt;
#include &amp;lt;zephyr/drivers/i2c.h&amp;gt;

static const struct device *bus = DEVICE_DT_GET(DT_ALIAS(i2c_target));
static char last_byte;

/*
 * @brief Callback which is called when a write request is received from the master.
 * @param config Pointer to the target configuration.
 */
int sample_target_write_requested_cb(struct i2c_target_config *config)
{
	printk(&amp;quot;sample target write requested\n&amp;quot;);
	return 0;
}

/*
 * @brief Callback which is called when a write is received from the master.
 * @param config Pointer to the target configuration.
 * @param val The byte received from the master.
 */
int sample_target_write_received_cb(struct i2c_target_config *config, uint8_t val)
{
	printk(&amp;quot;sample target write received: 0x%02x\n&amp;quot;, val);
	last_byte = val;
	return 0;
}

/*
 * @brief Callback which is called when a read request is received from the master.
 * @param config Pointer to the target configuration.
 * @param val Pointer to the byte to be sent to the master.
 */
int sample_target_read_requested_cb(struct i2c_target_config *config, uint8_t *val)
{
	printk(&amp;quot;sample target read request: 0x%02x\n&amp;quot;, *val);
	*val = 0x42;
	return 0;
}

/*
 * @brief Callback which is called when a read is processed from the master.
 * @param config Pointer to the target configuration.
 * @param val Pointer to the next byte to be sent to the master.
 */
int sample_target_read_processed_cb(struct i2c_target_config *config, uint8_t *val)
{
	printk(&amp;quot;sample target read processed: 0x%02x\n&amp;quot;, *val);
	*val = 0x43;
	return 0;
}

/*
 * @brief Callback which is called when the master sends a stop condition.
 * @param config Pointer to the target configuration.
 */
int sample_target_stop_cb(struct i2c_target_config *config)
{
	printk(&amp;quot;sample target stop callback\n&amp;quot;);
	return 0;
}

#ifdef CONFIG_I2C_TARGET_BUFFER_MODE
/*
 * @brief Callback which is called when a write buffer is received from the master.
 * @param config Pointer to the target configuration.
 * @param data Pointer to the buffer received from the master.
 * @param size Size of the buffer received from the master.
 */
static void sample_target_buf_write_received_cb(struct i2c_target_config *config,
					     uint8_t *data, uint32_t size)
{
	printk(&amp;quot;sample target buffer write received, size: %d\n&amp;quot;, size);
	for (uint32_t i = 0; i &amp;lt; size; i++) {
		printk(&amp;quot;byte %d: 0x%02x\n&amp;quot;, i, data[i]);
	}
}

/*
 * @brief Callback which is called when a read buffer is requested from the master.
 * @param config Pointer to the target configuration.
 * @param data Pointer to the buffer to be sent to the master.
 * @param size Size of the buffer to be sent to the master.
 */
static int sample_target_buf_read_requested_cb(struct i2c_target_config *config,
					    uint8_t **data, uint32_t *size)
{
	printk(&amp;quot;sample target buffer read requested\n&amp;quot;);
	static uint8_t buffer[5] = {0x44, 0x45, 0x46, 0x47, 0x48};
	*data = buffer;
	*size = sizeof(buffer);
	return 0;
}
#endif /* CONFIG_I2C_TARGET_BUFFER_MODE */

static struct i2c_target_callbacks sample_target_callbacks = {
	.write_requested = sample_target_write_requested_cb,
	.write_received = sample_target_write_received_cb,
	.read_requested = sample_target_read_requested_cb,
	.read_processed = sample_target_read_processed_cb,
	.stop = sample_target_stop_cb,
#ifdef CONFIG_I2C_TARGET_BUFFER_MODE
	.buf_write_received = sample_target_buf_write_received_cb,
	.buf_read_requested = sample_target_buf_read_requested_cb,
#endif
};

int main(void)
{
	struct i2c_target_config target_cfg = {
		.address = 0x60,
		.callbacks = &amp;amp;sample_target_callbacks,
	};

	printk(&amp;quot;i2c custom target sample\n&amp;quot;);

	if (i2c_target_register(bus, &amp;amp;target_cfg) &amp;lt; 0) {
		printk(&amp;quot;Failed to register target\n&amp;quot;);
		return -1;
	}
	

	while(1) {
		k_sleep(K_SECONDS(10));
	}

	// never reached, but unregister the target before exiting
	if (i2c_target_unregister(bus, &amp;amp;target_cfg) &amp;lt; 0) {
		printk(&amp;quot;Failed to unregister target\n&amp;quot;);
		return -1;
	}

	return 0;
}
&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;&lt;code&gt;nrf5340dk_nrf5340_cpuapp.overlay&lt;/code&gt;&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;/ {
	aliases {
		i2c-target = &amp;amp;i2c1;
	};
};

&amp;amp;i2c1 {
	compatible = &amp;quot;nordic,nrf-twis&amp;quot;;
	pinctrl-0 = &amp;lt;&amp;amp;i2c1_default&amp;gt;;
	pinctrl-1 = &amp;lt;&amp;amp;i2c1_sleep&amp;gt;;
	pinctrl-names = &amp;quot;default&amp;quot;, &amp;quot;sleep&amp;quot;;
	status = &amp;quot;okay&amp;quot;;
};

&amp;amp;pinctrl {
    i2c1_default: i2c1_default {
		group1 {
			psels = &amp;lt;NRF_PSEL(TWIS_SDA, 1, 2)&amp;gt;,
				&amp;lt;NRF_PSEL(TWIS_SCL, 1, 3)&amp;gt;;
			bias-pull-up;
		};
	};

	i2c1_sleep: i2c1_sleep {
		group1 {
			psels = &amp;lt;NRF_PSEL(TWIS_SDA, 1, 2)&amp;gt;,
				&amp;lt;NRF_PSEL(TWIS_SCL, 1, 3)&amp;gt;;
			low-power-enable;
		};
	};
};
&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;&lt;code&gt;prj.conf&lt;/code&gt;&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;CONFIG_I2C=y
CONFIG_I2C_NRFX=y
CONFIG_I2C_TARGET=y
CONFIG_I2C_TARGET_BUFFER_MODE=y&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;If you have any more questions / issue with the i2c target driver, feel free to ask !&lt;/p&gt;
&lt;p&gt;Best regards,&lt;/p&gt;
&lt;p&gt;Simon D-M&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: I2C communication between  Renesas MCU(master) -&gt; nRF5340(slave).</title><link>https://devzone.nordicsemi.com/thread/561687?ContentTypeID=1</link><pubDate>Fri, 20 Feb 2026 10:49:39 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:68ae5d01-e1f8-46d7-873d-9b6eaded2fe1</guid><dc:creator>Embedded developer0</dc:creator><description>&lt;p&gt;i tried with your suggestion and face this issue. where data is not receiving by nrf5340 i2c target&lt;br /&gt;log&lt;br /&gt;&lt;pre class="ui-code" data-mode="text"&gt;*** Booting nRF Connect SDK v3.2.1-d8887f6f32df ***
*** Using Zephyr OS v4.2.99-ec78104f1569 ***
i2c custom target sample
***** USAGE FAULT *****
  Illegal use of the EPSR
r0/a1:  0x200019e4  r1/a2:  0x20000cbb  r2/a3:  0x00000001
r3/a4:  0x00000000 r12/ip:  0xc5c9c6ed r14/lr:  0x00002e19
 xpsr:  0x60000019
Faulting instruction address (r15/pc): 0x00000000&lt;/pre&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;logic analyzer&amp;nbsp;&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/Screenshot-2026_2D00_02_2D00_20-160404.png" /&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/Screenshot-2026_2D00_02_2D00_20-160513.png" /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;overlay file&lt;br /&gt;&lt;pre class="ui-code" data-mode="text"&gt;/ {
    aliases {
        i2c-target = &amp;amp;i2c1;
    };
};

&amp;amp;i2c1 {
    compatible = &amp;quot;nordic,nrf-twis&amp;quot;;
    status = &amp;quot;okay&amp;quot;;
    clock-frequency = &amp;lt;I2C_BITRATE_STANDARD&amp;gt;;
    pinctrl-0 = &amp;lt;&amp;amp;i2c1_default&amp;gt;;
    pinctrl-1 = &amp;lt;&amp;amp;i2c1_sleep&amp;gt;;
    pinctrl-names = &amp;quot;default&amp;quot;, &amp;quot;sleep&amp;quot;;

};

&amp;amp;pinctrl {
    i2c1_default: i2c1_default {
        group1 {
            psels = &amp;lt;NRF_PSEL(TWIS_SDA, 1, 2)&amp;gt;,
                    &amp;lt;NRF_PSEL(TWIS_SCL, 1, 3)&amp;gt;;
            bias-pull-up;
        };
    };

    i2c1_sleep: i2c1_sleep {
        group1 {
            psels = &amp;lt;NRF_PSEL(TWIS_SDA, 1, 2)&amp;gt;,
                    &amp;lt;NRF_PSEL(TWIS_SCL, 1, 3)&amp;gt;;
            low-power-enable;
        };
    };
};&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;main.c&lt;br /&gt;&lt;br /&gt;&lt;pre class="ui-code" data-mode="c_cpp"&gt;#include &amp;lt;zephyr/kernel.h&amp;gt;
#include &amp;lt;zephyr/sys/printk.h&amp;gt;
#include &amp;lt;zephyr/drivers/i2c.h&amp;gt;

static const struct device *bus = DEVICE_DT_GET(DT_ALIAS(i2c_target));
static char last_byte;

int sample_target_write_requested_cb(struct i2c_target_config *config)
{
	printk(&amp;quot;sample target write requested\n&amp;quot;);
	return 0;
}

int sample_target_write_received_cb(struct i2c_target_config *config, uint8_t val)
{
	printk(&amp;quot;sample target write received: 0x%02x\n&amp;quot;, val);
	last_byte = val;
	return 0;
}

int sample_target_read_requested_cb(struct i2c_target_config *config, uint8_t *val)
{
	printk(&amp;quot;sample target read request: 0x%02x\n&amp;quot;, *val);
	*val = 0x42;
	return 0;
}

int sample_target_read_processed_cb(struct i2c_target_config *config, uint8_t *val)
{
	printk(&amp;quot;sample target read processed: 0x%02x\n&amp;quot;, *val);
	*val = 0x43;
	return 0;
}

int sample_target_stop_cb(struct i2c_target_config *config)
{
	printk(&amp;quot;sample target stop callback\n&amp;quot;);
	return 0;
}

static struct i2c_target_callbacks sample_target_callbacks = {
	.write_requested = sample_target_write_requested_cb,
	.write_received = sample_target_write_received_cb,
	.read_requested = sample_target_read_requested_cb,
	.read_processed = sample_target_read_processed_cb,
	.stop = sample_target_stop_cb,
};

int main(void)
{
	struct i2c_target_config target_cfg = {
		.address = 0x55,
		.callbacks = &amp;amp;sample_target_callbacks,
	};

	printk(&amp;quot;i2c custom target sample\n&amp;quot;);

	if (i2c_target_register(bus, &amp;amp;target_cfg) &amp;lt; 0)
	{
		printk(&amp;quot;Failed to register target\n&amp;quot;);
		return -1;
	}

	k_msleep(5000);

	if (i2c_target_unregister(bus, &amp;amp;target_cfg) &amp;lt; 0)
	{
		printk(&amp;quot;Failed to unregister target\n&amp;quot;);
		return -1;
	}

	while (1)
	{
	}
	return 0;
}&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;/p&gt;
&lt;p&gt;&lt;br /&gt;&lt;br /&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: I2C communication between  Renesas MCU(master) -&gt; nRF5340(slave).</title><link>https://devzone.nordicsemi.com/thread/561665?ContentTypeID=1</link><pubDate>Fri, 20 Feb 2026 09:08:48 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:93eeb16a-8b3a-4b6a-897d-6710de09eddf</guid><dc:creator>Embedded developer0</dc:creator><description>&lt;p&gt;yeah please if you can make small smaple using zephyr&amp;#39;s driver for nrf5340 i2c target. please do it.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: I2C communication between  Renesas MCU(master) -&gt; nRF5340(slave).</title><link>https://devzone.nordicsemi.com/thread/561658?ContentTypeID=1</link><pubDate>Fri, 20 Feb 2026 08:04:02 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:8ef29d59-6161-4fb8-b8c8-c864297dc8d7</guid><dc:creator>Simon D-M</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;The naming &amp;quot;master&amp;quot; and &amp;quot;slave&amp;quot; is getting slowly removed from all the documentation. It refers to slavery which is not very nice. It is being replaced by other nomenclature. The one used in this sample is &amp;quot;controller&amp;quot; (master) and &amp;quot;target&amp;quot; (slave).&lt;/p&gt;
&lt;p&gt;So this sample should be the right one for your needs.&lt;/p&gt;
[quote user="Embedded developer0"]i seen in nordic community discussion zephyr os driver is not able to work with&amp;nbsp; Nordic slave hardware is it true?[/quote]
&lt;p&gt;I&amp;#39;ve never tried using our drivers for an i2c target, but I don&amp;#39;t see why it shouldn&amp;#39;t work. If you want, I can try to make a small sample using zephyr&amp;#39;s driver. &lt;em&gt;However, I can&amp;#39;t make it before Monday (CET time).&amp;nbsp;&lt;/em&gt;&lt;/p&gt;
&lt;p&gt;Best regards,&lt;/p&gt;
&lt;p&gt;Simon D-M&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: I2C communication between  Renesas MCU(master) -&gt; nRF5340(slave).</title><link>https://devzone.nordicsemi.com/thread/561645?ContentTypeID=1</link><pubDate>Fri, 20 Feb 2026 05:05:28 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:083f8264-bd45-44e6-8584-e00d462576c5</guid><dc:creator>Embedded developer0</dc:creator><description>&lt;p data-start="181" data-end="184"&gt;Hi,&lt;/p&gt;
&lt;p data-start="186" data-end="262"&gt;I want to use &lt;strong data-start="200" data-end="227"&gt;nRF5340 as an I2C Slave&lt;/strong&gt; and &lt;strong data-start="232" data-end="261"&gt;Renesas MCU as I2C Master&lt;/strong&gt;.&lt;/p&gt;
&lt;p data-start="264" data-end="282"&gt;My requirement is:&lt;/p&gt;
&lt;ul data-start="284" data-end="460"&gt;
&lt;li data-section-id="6g9lcg" data-start="284" data-end="324"&gt;
&lt;p data-start="286" data-end="324"&gt;Renesas MCU will act as &lt;strong data-start="310" data-end="324"&gt;I2C Master&lt;/strong&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li data-section-id="1qz5bht" data-start="325" data-end="374"&gt;
&lt;p data-start="327" data-end="374"&gt;nRF5340 will act as &lt;strong data-start="347" data-end="374"&gt;I2C Slave (using TWIS0)&lt;/strong&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li data-section-id="o5a9d0" data-start="375" data-end="410"&gt;
&lt;p data-start="377" data-end="410"&gt;Renesas will send data to nRF5340&lt;/p&gt;
&lt;/li&gt;
&lt;li data-section-id="1ht5auu" data-start="411" data-end="460"&gt;
&lt;p data-start="413" data-end="460"&gt;nRF5340 should receive that data and process it&lt;br /&gt;&lt;br /&gt;&lt;/p&gt;
&lt;p data-start="611" data-end="626"&gt;My question is:&lt;/p&gt;
&lt;p data-start="628" data-end="808"&gt;If Renesas sends data using I2C write so is this your given code will act as slave and receive data?&lt;br /&gt;i means nrf5340 will work as slave ? i seen in nordic community discussion zephyr os driver is not able to work with&amp;nbsp; Nordic slave hardware is it true?&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: I2C communication between  Renesas MCU(master) -&gt; nRF5340(slave).</title><link>https://devzone.nordicsemi.com/thread/561627?ContentTypeID=1</link><pubDate>Thu, 19 Feb 2026 15:24:19 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:2ffd658f-bb58-4f9b-babd-33a599601dcd</guid><dc:creator>Simon D-M</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;Sorry, I looked a bit more into details into the samples that I sent you before, and I don&amp;#39;t really like how they are implementing things...&lt;/p&gt;
&lt;p&gt;However, I found this sample called &lt;a href="https://github.com/zephyrproject-rtos/zephyr/tree/main/samples/drivers/i2c/custom_target"&gt;custom_target&lt;/a&gt;. This uses the default Zephyr i2c library &lt;em&gt;(which will use the nrfx library under the hood for Nordic chips)&lt;/em&gt;, and I like much more how this was implemented. It uses devicetree and has a higher level of abstraction.&lt;/p&gt;
&lt;p&gt;By default, the nRF5340 DK is not supported, but the port to the nRF5340 DK is not hard. Here is how to do it:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Create a devicetree overlay file that contains the i2c node and the corresponding pinctrls.&lt;br /&gt;&lt;code&gt;nrf5340dk_nrf5340_cpuapp.overlay&lt;/code&gt; :&lt;br /&gt;&lt;pre class="ui-code" data-mode="text"&gt;/ {
	aliases {
		i2c-target = &amp;amp;i2c1;
	};
};

&amp;amp;i2c1 {
	compatible = &amp;quot;nordic,nrf-twis&amp;quot;;
	pinctrl-0 = &amp;lt;&amp;amp;i2c1_default&amp;gt;;
	pinctrl-1 = &amp;lt;&amp;amp;i2c1_sleep&amp;gt;;
	pinctrl-names = &amp;quot;default&amp;quot;, &amp;quot;sleep&amp;quot;;
	status = &amp;quot;okay&amp;quot;;
};

&amp;amp;pinctrl {
    i2c1_default: i2c1_default {
		group1 {
			psels = &amp;lt;NRF_PSEL(TWIS_SDA, 1, 2)&amp;gt;,
				&amp;lt;NRF_PSEL(TWIS_SCL, 1, 3)&amp;gt;;
			bias-pull-up;
		};
	};

	i2c1_sleep: i2c1_sleep {
		group1 {
			psels = &amp;lt;NRF_PSEL(TWIS_SDA, 1, 2)&amp;gt;,
				&amp;lt;NRF_PSEL(TWIS_SCL, 1, 3)&amp;gt;;
			low-power-enable;
		};
	};
};
&lt;/pre&gt;&lt;/li&gt;
&lt;li&gt;Change the main.c to use the newly created node.&lt;br /&gt;&lt;code&gt;main.c&lt;/code&gt; :&lt;br /&gt;&lt;pre class="ui-code" data-mode="text"&gt;/*
 * Copyright (c) 2024 Open Pixel Systems
 *
 * SPDX-License-Identifier: Apache-2.0
 */

#include &amp;lt;zephyr/kernel.h&amp;gt;
#include &amp;lt;zephyr/sys/printk.h&amp;gt;
#include &amp;lt;zephyr/drivers/i2c.h&amp;gt;

static const struct device *bus = DEVICE_DT_GET(DT_ALIAS(i2c_target));
static char last_byte;

/*
 * @brief Callback which is called when a write request is received from the master.
 * @param config Pointer to the target configuration.
 */
int sample_target_write_requested_cb(struct i2c_target_config *config)
{
	printk(&amp;quot;sample target write requested\n&amp;quot;);
	return 0;
}

/*
 * @brief Callback which is called when a write is received from the master.
 * @param config Pointer to the target configuration.
 * @param val The byte received from the master.
 */
int sample_target_write_received_cb(struct i2c_target_config *config, uint8_t val)
{
	printk(&amp;quot;sample target write received: 0x%02x\n&amp;quot;, val);
	last_byte = val;
	return 0;
}

/*
 * @brief Callback which is called when a read request is received from the master.
 * @param config Pointer to the target configuration.
 * @param val Pointer to the byte to be sent to the master.
 */
int sample_target_read_requested_cb(struct i2c_target_config *config, uint8_t *val)
{
	printk(&amp;quot;sample target read request: 0x%02x\n&amp;quot;, *val);
	*val = 0x42;
	return 0;
}

/*
 * @brief Callback which is called when a read is processed from the master.
 * @param config Pointer to the target configuration.
 * @param val Pointer to the next byte to be sent to the master.
 */
int sample_target_read_processed_cb(struct i2c_target_config *config, uint8_t *val)
{
	printk(&amp;quot;sample target read processed: 0x%02x\n&amp;quot;, *val);
	*val = 0x43;
	return 0;
}

/*
 * @brief Callback which is called when the master sends a stop condition.
 * @param config Pointer to the target configuration.
 */
int sample_target_stop_cb(struct i2c_target_config *config)
{
	printk(&amp;quot;sample target stop callback\n&amp;quot;);
	return 0;
}

static struct i2c_target_callbacks sample_target_callbacks = {
	.write_requested = sample_target_write_requested_cb,
	.write_received = sample_target_write_received_cb,
	.read_requested = sample_target_read_requested_cb,
	.read_processed = sample_target_read_processed_cb,
	.stop = sample_target_stop_cb,
};

int main(void)
{
	struct i2c_target_config target_cfg = {
		.address = 0x60,
		.callbacks = &amp;amp;sample_target_callbacks,
	};

	printk(&amp;quot;i2c custom target sample\n&amp;quot;);

	if (i2c_target_register(bus, &amp;amp;target_cfg) &amp;lt; 0) {
		printk(&amp;quot;Failed to register target\n&amp;quot;);
		return -1;
	}

	k_msleep(5000);

	if (i2c_target_unregister(bus, &amp;amp;target_cfg) &amp;lt; 0) {
		printk(&amp;quot;Failed to unregister target\n&amp;quot;);
		return -1;
	}

	return 0;
}
&lt;/pre&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;After applying these changes you should be able to run the sample on a nRF5340 DK (&lt;em&gt;It builds, flashes, and runs, but I didn&amp;#39;t try to actually use it&lt;/em&gt;).&lt;/p&gt;
&lt;p&gt;From that sample you should be able to implement a cleaner application.&lt;/p&gt;
&lt;p&gt;If you need more help on how to implement the logic inside the slave, feel free to ask. I can try to make a small example.&lt;/p&gt;
&lt;p&gt;Best regards,&lt;/p&gt;
&lt;p&gt;Simon D-M&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: I2C communication between  Renesas MCU(master) -&gt; nRF5340(slave).</title><link>https://devzone.nordicsemi.com/thread/561550?ContentTypeID=1</link><pubDate>Thu, 19 Feb 2026 04:55:44 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:5f58af9e-aa70-4587-a69a-70b60b308cc5</guid><dc:creator>Embedded developer0</dc:creator><description>&lt;p&gt;based on you recommendation&amp;nbsp; i change devicetree, prj.conf and main.c&amp;nbsp; file which i will attaching.&lt;br /&gt;&lt;br /&gt;1. main.c&lt;br /&gt;&lt;br /&gt;&lt;pre class="ui-code" data-mode="c_cpp"&gt;/*
 * nRF5340 I2C Slave - Simple 3-byte Array
 * Compatible with RA6M5 Master
 * Based on Nordic nrfx example
 */

#include &amp;lt;zephyr/kernel.h&amp;gt;
#include &amp;lt;zephyr/logging/log.h&amp;gt;
#include &amp;lt;zephyr/irq.h&amp;gt;
#include &amp;lt;zephyr/devicetree.h&amp;gt;
#include &amp;lt;nrfx_twis.h&amp;gt;

LOG_MODULE_REGISTER(i2c_slave, LOG_LEVEL_INF);

/* Configuration */
#define SLAVE_ADDR 0x55
#define DATA_SIZE 3

/* Pin definitions (CORRECTED) */
#define SCL_PIN 35 /* P1.03 */
#define SDA_PIN 34 /* P1.02 */

/* TWIS instance */
// static nrfx_twis_t m_twis = NRFX_TWIS_INSTANCE(1);
static nrfx_twis_t m_twis_inst = NRFX_TWIS_INSTANCE(0);

/* Data buffers */
static uint8_t m_tx_buffer[DATA_SIZE] = {25, 50, 100}; /* Data to send to master */
static uint8_t m_rx_buffer[DATA_SIZE];                 /* Data received from master */

/* ========== TWIS Event Handler ========== */
static void twis_handler(nrfx_twis_event_t const *p_event)
{
    int status;
    (void)status;

    switch (p_event-&amp;gt;type)
    {
    case NRFX_TWIS_EVT_WRITE_REQ:
        /* Master wants to write - prepare to receive */
        status = nrfx_twis_rx_prepare(&amp;amp;m_twis_inst, m_rx_buffer, DATA_SIZE);
        NRFX_ASSERT(status == 0);
        break;

    case NRFX_TWIS_EVT_WRITE_DONE:
        /* Data received from master */
        m_tx_buffer[0] = 0X11;
        m_tx_buffer[1] = 0X12;
        m_tx_buffer[2] = 0X13;
        break;

    case NRFX_TWIS_EVT_READ_REQ:
        /* Master wants to read - send TX buffer */
        status = nrfx_twis_tx_prepare(&amp;amp;m_twis_inst, m_tx_buffer, DATA_SIZE);
        NRFX_ASSERT(status == 0);
        break;

    case NRFX_TWIS_EVT_READ_DONE:
        break;

    default:
        break;
    }
}
/* ========== IRQ Handler Wrapper ========== */
static void twis_irq_wrapper(const void *param)
{
    ARG_UNUSED(param);
    nrfx_twis_0_irq_handler();
}
/* ========== Main ========== */
int main(void)
{
    int status;
    /*
     *  irq_p = IRQ line number.
     *  priority_p = Interrupt priority.
     *  isr_p = Address of interrupt service routine.
     *  isr_param_p =  Parameter passed to interrupt service routine.
     *  flags_p = Architecture-specific IRQ configuration flags..
     * */
    /* Connect IRQ (CRITICAL for Zephyr) */
    IRQ_CONNECT(DT_IRQN(DT_NODELABEL(i2c0)),
                DT_IRQ(DT_NODELABEL(i2c0), priority),
                nrfx_isr,
                nrfx_twis_0_irq_handler,
                0);

    irq_enable(DT_IRQN(DT_NODELABEL(i2c0)));

    /* Configure TWIS - CORRECTED PIN ORDER */
    nrfx_twis_config_t config = NRFX_TWIS_DEFAULT_CONFIG(
        SCL_PIN, /* P1.03 = SCL ✅ */
        SDA_PIN, /* P1.02 = SDA ✅ */
        SLAVE_ADDR);

    /* Initialize TWIS */
    status = nrfx_twis_init(&amp;amp;m_twis_inst, &amp;amp;config, twis_handler);
    NRFX_ASSERT(status == NRFX_SUCCESS);

    /* Enable TWIS */
    nrfx_twis_enable(&amp;amp;m_twis_inst);

    while (1)
    {
        k_sleep(K_SECONDS(1));
    }

    return 0;
}&lt;/pre&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;div&gt;
&lt;div&gt;&lt;span&gt;IRQ_CONNECT&lt;/span&gt;&lt;span&gt;(&lt;/span&gt;&lt;span&gt;NRFX_IRQ_NUMBER_GET&lt;/span&gt;&lt;span&gt;(&lt;/span&gt;&lt;span&gt;NRF_TWIS_INST_GET&lt;/span&gt;&lt;span&gt;(&lt;/span&gt;&lt;span&gt;TWIS_INST_IDX&lt;/span&gt;&lt;span&gt;)), &lt;/span&gt;&lt;span&gt;IRQ_PRIO_LOWEST&lt;/span&gt;&lt;span&gt;,&amp;nbsp;&lt;/span&gt;&lt;span&gt;nrfx_twis_irq_handler&lt;/span&gt;&lt;span&gt;, &lt;/span&gt;&lt;span&gt;&amp;amp;&lt;/span&gt;&lt;span&gt;m_twis_inst&lt;/span&gt;&lt;span&gt;, &lt;/span&gt;&lt;span&gt;0&lt;/span&gt;&lt;span&gt;);&amp;nbsp;&lt;br /&gt;&lt;br /&gt;note :above&amp;nbsp; line is form twim_twia_txrx sample code.&lt;br /&gt;i&amp;#39;m facing challenges here.&amp;nbsp;&lt;/span&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;2.devicetree .overlay file&lt;br /&gt;&lt;br /&gt;&lt;pre class="ui-code" data-mode="text"&gt;&amp;amp;i2c1 {
    status = &amp;quot;disabled&amp;quot;;
};&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;i only mention i2c1 disabled because of I&amp;#39;m configuring&amp;nbsp; twis for nordic driver.&lt;br /&gt;if you think i should configure through devicetree(.overlay file) let me know what should i write and what should i ignore&amp;nbsp;&lt;br /&gt;&lt;br /&gt;my requirement&amp;nbsp; is Renesas is my hot mcu which is i2c master and i have EV-WT02C40C fanstle board where nrf5340 mcu is twis (as i2c slave )&amp;nbsp;&lt;br /&gt;currently is using i2c1 and pin port is (SCL = 1.03 &amp;amp; SDA =1.02).&lt;br /&gt;&lt;br /&gt;3.prj.conf&amp;nbsp;&lt;br /&gt;&lt;br /&gt;&lt;/p&gt;
&lt;div&gt;
&lt;div&gt;&lt;span&gt;#i2c&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span&gt;CONFIG_NRFX_TWIS&lt;/span&gt;&lt;span&gt;=y&lt;/span&gt;&lt;/div&gt;
&lt;br /&gt;common.conf&lt;br /&gt;
&lt;div&gt;
&lt;div&gt;&lt;span&gt;CONFIG_LOG&lt;/span&gt;&lt;span&gt;=y&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span&gt;CONFIG_BOOT_BANNER&lt;/span&gt;&lt;span&gt;=n&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span&gt;CONFIG_NCS_BOOT_BANNER&lt;/span&gt;&lt;span&gt;=n&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span&gt;CONFIG_ASSERT&lt;/span&gt;&lt;span&gt;=y&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span&gt;CONFIG_LOG_PROCESS_THREAD&lt;/span&gt;&lt;span&gt;=n&lt;/span&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;br /&gt;4.and in log im facing this&amp;nbsp;&lt;pre class="ui-code" data-mode="text"&gt;[00:00:00.253,234] &amp;lt;err&amp;gt; os: ***** MPU FAULT *****
[00:00:00.253,234] &amp;lt;err&amp;gt; os:   Data Access Violation
[00:00:00.253,265] &amp;lt;err&amp;gt; os:   MMFAR Address: 0x501
[00:00:00.253,265] &amp;lt;err&amp;gt; os: r0/a1:  0x20000000  r1/a2:  0x20001e98  r2/a3:  0x00000165
[00:00:00.253,295] &amp;lt;err&amp;gt; os: r3/a4:  0x00000000 r12/ip:  0x00000000 r14/lr:  0x00000209
[00:00:00.253,295] &amp;lt;err&amp;gt; os:  xpsr:  0x29000000
[00:00:00.253,295] &amp;lt;err&amp;gt; os: Faulting instruction address (r15/pc): 0x00005c3e
[00:00:00.253,326] &amp;lt;err&amp;gt; os: &amp;gt;&amp;gt;&amp;gt; ZEPHYR FATAL ERROR 19: Unknown error on CPU 0
[00:00:00.253,356] &amp;lt;err&amp;gt; os: Current thread: 0x20000718 (main)
[00:00:00.315,582] &amp;lt;err&amp;gt; os: Halting system
&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: I2C communication between  Renesas MCU(master) -&gt; nRF5340(slave).</title><link>https://devzone.nordicsemi.com/thread/561522?ContentTypeID=1</link><pubDate>Wed, 18 Feb 2026 15:37:26 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:b5f6d141-b108-4b73-b09e-2f265185c3ab</guid><dc:creator>Simon D-M</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;Can you please give more information on when does the crash happen? Can you also give the full serial logs?&lt;/p&gt;
&lt;p&gt;Best regards,&lt;/p&gt;
&lt;p&gt;Simon D-M&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: I2C communication between  Renesas MCU(master) -&gt; nRF5340(slave).</title><link>https://devzone.nordicsemi.com/thread/561367?ContentTypeID=1</link><pubDate>Tue, 17 Feb 2026 14:17:40 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:a23a39b0-de5e-4511-b8ca-00cd252f32f7</guid><dc:creator>Embedded developer0</dc:creator><description>&lt;p&gt;hi,&lt;/p&gt;
&lt;p&gt;i tried with my main.c file.&lt;br /&gt;&amp;nbsp;&lt;pre class="ui-code" data-mode="c_cpp"&gt;#include &amp;lt;zephyr/kernel.h&amp;gt;
#include &amp;lt;zephyr/device.h&amp;gt;
#include &amp;lt;zephyr/drivers/i2c.h&amp;gt;
#include &amp;lt;zephyr/logging/log.h&amp;gt;
#include &amp;lt;string.h&amp;gt;

LOG_MODULE_REGISTER(i2c_slave, LOG_LEVEL_INF);

#define I2C_SLAVE_NODE DT_NODELABEL(i2c1)
#define I2C_SLAVE_ADDR 0x55

#define RX_BUFFER_SIZE 32
#define TX_BUFFER_SIZE 32

static uint8_t rx_buffer[RX_BUFFER_SIZE];
static uint8_t tx_buffer[TX_BUFFER_SIZE];

static size_t rx_index = 0;
static size_t tx_index = 0;
static size_t tx_length = 0;

static const struct device *i2c_dev;

/* Data received from Master */
static struct
{
    uint8_t temperature;
    uint8_t humidity;
    uint8_t pressure;
} sensor_data;

/* ================= I2C Callbacks ================= */

static int write_requested_cb(struct i2c_target_config *config)
{
    rx_index = 0;
    return 0;
}

static int write_received_cb(struct i2c_target_config *config, uint8_t val)
{
    if (rx_index &amp;lt; RX_BUFFER_SIZE)
    {
        rx_buffer[rx_index++] = val;
        return 0;
    }
    return -ENOMEM;
}

static int read_requested_cb(struct i2c_target_config *config, uint8_t *val)
{
    tx_index = 0;

    /* Prepare 3 uint8_t values = 3 bytes */
    tx_buffer[0] = sensor_data.temperature;
    tx_buffer[1] = sensor_data.humidity;
    tx_buffer[2] = sensor_data.pressure;

    tx_length = 3;

    *val = tx_buffer[tx_index++];
    return 0;
}

static int read_processed_cb(struct i2c_target_config *config, uint8_t *val)
{
    if (tx_index &amp;lt; tx_length)
    {
        *val = tx_buffer[tx_index++];
    }
    else
    {
        *val = 0xFF;
    }

    return 0;
}

static int stop_cb(struct i2c_target_config *config)
{
    /* Expecting 3 uint8_t = 3 bytes */
    if (rx_index == 3)
    {
        memcpy(&amp;amp;sensor_data.temperature, &amp;amp;rx_buffer[0], sizeof(uint8_t));
        memcpy(&amp;amp;sensor_data.humidity, &amp;amp;rx_buffer[1], sizeof(uint8_t));
        memcpy(&amp;amp;sensor_data.pressure, &amp;amp;rx_buffer[2], sizeof(uint8_t));

        LOG_INF(&amp;quot;Received from Master:&amp;quot;);
        LOG_INF(&amp;quot;Temp: %d&amp;quot;, sensor_data.temperature);
        LOG_INF(&amp;quot;Humidity: %d&amp;quot;, sensor_data.humidity);
        LOG_INF(&amp;quot;Pressure: %d&amp;quot;, sensor_data.pressure);
    }
    else if (rx_index &amp;gt; 0)
    {
        LOG_WRN(&amp;quot;Unexpected data length: %d&amp;quot;, rx_index);
    }

    rx_index = 0;
    return 0;
}

/* Callback structure */
static struct i2c_target_callbacks callbacks = {
    .write_requested = write_requested_cb,
    .write_received = write_received_cb,
    .read_requested = read_requested_cb,
    .read_processed = read_processed_cb,
    .stop = stop_cb,
};

static struct i2c_target_config target_config = {
    .address = I2C_SLAVE_ADDR,
    .callbacks = &amp;amp;callbacks,
};

/* ================= Main ================= */

int main(void)
{
    int ret;

    LOG_INF(&amp;quot;nRF5340 I2C Slave Started (Address 0x55)&amp;quot;);

    i2c_dev = DEVICE_DT_GET(I2C_SLAVE_NODE);

    if (!device_is_ready(i2c_dev))
    {
        LOG_ERR(&amp;quot;I2C device not ready&amp;quot;);
        return -ENODEV;
    }
    LOG_INF(&amp;quot;I2C device name: %s&amp;quot;, i2c_dev-&amp;gt;name);
    ret = i2c_target_register(i2c_dev, &amp;amp;target_config);
    if (ret)
    {
        LOG_ERR(&amp;quot;Failed to register I2C target: %d&amp;quot;, ret);
        return ret;
    }

    LOG_INF(&amp;quot;I2C Slave registered successfully&amp;quot;);

    while (1)
    {
        k_sleep(K_SECONDS(1));
    }

    return 0;
}&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;.overlay file&lt;br /&gt;&lt;pre class="ui-code" data-mode="text"&gt;&amp;amp;pinctrl {
i2c1_default: i2c1_default {
group1 {
psels = &amp;lt;NRF_PSEL(TWIS_SDA, 1, 2)&amp;gt;,
        &amp;lt;NRF_PSEL(TWIS_SCL, 1, 3)&amp;gt;;
        bias-pull-up;
    };
};

i2c1_sleep: i2c1_sleep {
group1 {
psels = &amp;lt;NRF_PSEL(TWIS_SDA, 1, 2)&amp;gt;,
        &amp;lt;NRF_PSEL(TWIS_SCL, 1, 3)&amp;gt;;
        low-power-enable;
        };
    };
};

&amp;amp;i2c1 {
compatible = &amp;quot;nordic,nrf-twis&amp;quot;;
pinctrl-0 = &amp;lt;&amp;amp;i2c1_default&amp;gt;;
pinctrl-1 = &amp;lt;&amp;amp;i2c1_sleep&amp;gt;;
pinctrl-names = &amp;quot;default&amp;quot;, &amp;quot;sleep&amp;quot;;
status = &amp;quot;okay&amp;quot;;
};&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;prj.conf file&lt;br /&gt;&lt;br /&gt;&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;#i2c
CONFIG_I2C=y
CONFIG_I2C_TARGET=y

# Logging
CONFIG_LOG=y
CONFIG_I2C_LOG_LEVEL_DBG=y
CONFIG_PRINTK=y
CONFIG_LOG_MODE_DEFERRED=y
CONFIG_I2C_LOG_LEVEL_INF=y&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;&lt;br /&gt;transmission from renesas&amp;nbsp; mcu(master) is working&lt;br /&gt;but receiving end something missing.&lt;/p&gt;
&lt;p&gt;logs.&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;00:00:49.113,372] &amp;lt;err&amp;gt; os: ***** USAGE FAULT *****
[00:00:49.113,372] &amp;lt;err&amp;gt; os:   Illegal use of the EPSR
[00:00:49.113,403] &amp;lt;err&amp;gt; os: r0/a1:  0x20000000  r1/a2:  0x2000122d  r2/a3:  0x00000003
[00:00:49.113,433] &amp;lt;err&amp;gt; os: r3/a4:  0x00000000 r12/ip:  0xd04ae020 r14/lr:  0x00005ff7
[00:00:49.113,433] &amp;lt;err&amp;gt; os:  xpsr:  0x60000019
[00:00:49.113,464] &amp;lt;err&amp;gt; os: Faulting instruction address (r15/pc): 0x00000000
[00:00:49.113,494] &amp;lt;err&amp;gt; os: &amp;gt;&amp;gt;&amp;gt; ZEPHYR FATAL ERROR 35: Unknown error on CPU 0
[00:00:49.113,494] &amp;lt;err&amp;gt; os: Fault during interrupt handling

[00:00:49.113,525] &amp;lt;err&amp;gt; os: Current thread: 0x20000678 (idle)
[00:00:49.306,213] &amp;lt;err&amp;gt; os: Halting system&lt;/pre&gt;&lt;br /&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/Screenshot-2026_2D00_02_2D00_17-194223.png" /&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/Screenshot-2026_2D00_02_2D00_17-194401.png" /&gt;this is the waveforms &amp;nbsp;&amp;nbsp;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: I2C communication between  Renesas MCU(master) -&gt; nRF5340(slave).</title><link>https://devzone.nordicsemi.com/thread/561251?ContentTypeID=1</link><pubDate>Mon, 16 Feb 2026 14:02:15 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:be6415e3-73d9-4db3-9a61-61f7bfff09fc</guid><dc:creator>Simon D-M</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;You can take a look at this guide &amp;quot;&lt;a href="https://devzone.nordicsemi.com/guides/nrf-connect-sdk-guides/b/peripherals/posts/twi-ic2-implementation-with-nrfx-twis-driver"&gt;TWI/I2C implementation with nRFx TWIS Driver&lt;/a&gt;&amp;quot;. It shows how to make a TWI/I2C slave. It has been made for the nRF52840 DK, but it shouldn&amp;#39;t be too hard to port it to the nRF5340 DK.&lt;/p&gt;
&lt;p&gt;We also have some sample concerning TWI master and slave implementation here [&lt;a href="https://github.com/zephyrproject-rtos/hal_nordic/tree/0dbbf4794156ca09dc2d4bad8c42dcdb54acd662/nrfx/samples/src/nrfx_twim_twis"&gt;GitHub - nrfx_twim_twis&lt;/a&gt;].&lt;/p&gt;
&lt;p&gt;If you need more information about TWI/I2C, feel free to ask it here.&lt;/p&gt;
&lt;p&gt;Best regards,&lt;/p&gt;
&lt;p&gt;Simon D-M&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>