<?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>Can&amp;#39;t write more than 16 bytes using i2c_transfer() on nRF5340 DK</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/106481/can-t-write-more-than-16-bytes-using-i2c_transfer-on-nrf5340-dk</link><description>I am developing a device that reads/writes data blocks to a proprietary sensor over i2c. There is a 2 byte hdr to the data block message so I was using i2c_transfer() to create a 2 msg transaction to write the header, then write the data block with no</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Tue, 12 Dec 2023 00:22:58 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/106481/can-t-write-more-than-16-bytes-using-i2c_transfer-on-nrf5340-dk" /><item><title>RE: Can't write more than 16 bytes using i2c_transfer() on nRF5340 DK</title><link>https://devzone.nordicsemi.com/thread/459805?ContentTypeID=1</link><pubDate>Tue, 12 Dec 2023 00:22:58 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:013e3005-ef29-45d5-8eee-b5f7b208851d</guid><dc:creator>tozz88</dc:creator><description>&lt;p&gt;Great. this answers all my questions. So this ticket is closed in my mind. I&amp;#39;m new to this page so let me know if there is something I&amp;#39;m supposed to do to close this out.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;thanks for your help&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;BobT&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Can't write more than 16 bytes using i2c_transfer() on nRF5340 DK</title><link>https://devzone.nordicsemi.com/thread/459791?ContentTypeID=1</link><pubDate>Mon, 11 Dec 2023 21:58:50 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:686df3a8-dbc3-4e24-a5e7-2cfb8fb1ab65</guid><dc:creator>Kenneth</dc:creator><description>&lt;p&gt;Glad to hear the problem is solved.&lt;/p&gt;
&lt;p&gt;Regarding the &amp;quot;DMA&amp;quot; it simply means that the buffer need to be in RAM, not code flash.&lt;/p&gt;
&lt;p&gt;Kenneth&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Can't write more than 16 bytes using i2c_transfer() on nRF5340 DK</title><link>https://devzone.nordicsemi.com/thread/459780?ContentTypeID=1</link><pubDate>Mon, 11 Dec 2023 20:44:10 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:ea46a924-1d1e-40c2-9bcf-69f510269c80</guid><dc:creator>tozz88</dc:creator><description>&lt;p&gt;Great. Thanks for your help. I already have an overlay file so adding the following to my &amp;amp;i2c1 entry did the trick:&lt;/p&gt;
&lt;div&gt;
&lt;div&gt;&lt;span&gt;&amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span&gt;zephyr,concat-buf-size&lt;/span&gt;&lt;span&gt; &lt;/span&gt;&lt;span&gt;=&lt;/span&gt;&lt;span&gt; &amp;lt;&lt;/span&gt;&lt;span&gt;514&lt;/span&gt;&lt;span&gt;&amp;gt;;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;/div&gt;
&lt;div&gt;The code from my original post works for arbitrary sizes up to 512 bytes.&lt;/div&gt;
&lt;div&gt;However, I wanted to look into this more as I may be simply delaying the copy step to the driver&amp;#39;s code if the buffer I supply isn&amp;#39;t accessible to DMA.&amp;nbsp; How do I allocate my buffers to ensure they are accessible to the DMA engine?&lt;/div&gt;
&lt;div&gt;thanks.&lt;/div&gt;
&lt;/div&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Can't write more than 16 bytes using i2c_transfer() on nRF5340 DK</title><link>https://devzone.nordicsemi.com/thread/459665?ContentTypeID=1</link><pubDate>Mon, 11 Dec 2023 10:53:08 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:dd898ee5-9765-4fb7-8d0c-cc101f7f8700</guid><dc:creator>Kenneth</dc:creator><description>&lt;p&gt;Hello,&lt;/p&gt;
&lt;p&gt;It looks to be a few things that can cause this:&lt;br /&gt;if statement:&amp;nbsp;&lt;a href="https://github.com/zephyrproject-rtos/zephyr/blob/zephyr-v3.5.0/drivers/i2c/i2c_nrfx_twim.c#L92"&gt;https://github.com/zephyrproject-rtos/zephyr/blob/zephyr-v3.5.0/drivers/i2c/i2c_nrfx_twim.c#L92&lt;/a&gt;&amp;nbsp;&lt;br /&gt;error code:&amp;nbsp;&lt;a href="https://github.com/zephyrproject-rtos/zephyr/blob/zephyr-v3.5.0/drivers/i2c/i2c_nrfx_twim.c#L103"&gt;https://github.com/zephyrproject-rtos/zephyr/blob/zephyr-v3.5.0/drivers/i2c/i2c_nrfx_twim.c#L103&lt;/a&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Not entirely sure which is kicking in here. Hopefully you can set a breakpoint here to find exactly what is causing that error code.&lt;/p&gt;
&lt;p&gt;Kenneth&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>