<?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>nrf_twi_mngr handling of transfers larger than 255 Bytes</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/36378/nrf_twi_mngr-handling-of-transfers-larger-than-255-bytes</link><description>I am trying to send more than 255 Bytes of data over I2C so I break it up into 255 byte transfers within a transaction. 
 I notice a stop/start condition is sent between I2C transfers even if I use the NRF_TWI_MNGR_NO_STOP flag for each transfer. 
 This</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Thu, 19 Jul 2018 18:09:45 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/36378/nrf_twi_mngr-handling-of-transfers-larger-than-255-bytes" /><item><title>RE: nrf_twi_mngr handling of transfers larger than 255 Bytes</title><link>https://devzone.nordicsemi.com/thread/140736?ContentTypeID=1</link><pubDate>Thu, 19 Jul 2018 18:09:45 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:2b2c213b-0650-4bc3-ad4e-aa138fc29f5a</guid><dc:creator>Daniel Veilleux</dc:creator><description>&lt;p&gt;It looks like the NRF_TWI_MNGR_NO_STOP flag just enables a repeated start instead of a stop followed by a start. From nrf_twi_mngr.h:&lt;/p&gt;
&lt;p style="padding-left:30px;"&gt;&amp;nbsp;* Use this flag when a stop condition is undesirable between two transfers,&lt;br /&gt;&amp;nbsp;* for example, when the first transfer is a write that sets an address in the slave&lt;br /&gt;&amp;nbsp;* device and the second one is a read that fetches certain data using this&lt;br /&gt;&amp;nbsp;* address. In this case, the second transfer should follow directly after the&lt;br /&gt;&amp;nbsp;* first transfer, with a repeated start condition instead of a stop and then&lt;br /&gt;&amp;nbsp;* a new start condition.&lt;/p&gt;
&lt;p&gt;However, I spent a few minutes looking at nrfx_twi.c and it looks like twi_send_byte executes the NRF_TWI_TASK_SUSPEND task when it gets to the end of the first data buffer and NRF_TWI_MNGR_NO_STOP is set (instead of executing NRF_TWI_TASK_STOP). Then twi_tx_start_transfer is called to send the second buffer and it&amp;#39;s in here that the NRF_TWI_TASK_RESUME and NRF_TWI_TASK_STARTTX tasks are executed. I think the NRF_TWI_TASK_STARTTX is the task that actually puts the repeated start condition and address on the bus again. To test this I used a static variable to remember if the TWI bus was previously suspended instead of stopped -- if so I allow twi_tx_start_transfer to execute the NRF_TWI_TASK_RESUME task but skip NRF_TWI_TASK_STARTTX . The result on my logic analyzer is start, address with write bit, 255 bytes, 255 more bytes, and then stop.&lt;/p&gt;
&lt;p&gt;I didn&amp;#39;t have time to test if this breaks something else in the driver but if I understand your question correctly this should at least prove that it&amp;#39;s possible to do what you&amp;#39;re looking for.&lt;/p&gt;
&lt;p&gt;&lt;a href="https://devzone.nordicsemi.com/cfs-file/__key/communityserver-discussions-components-files/4/nrfx_5F00_twi.c"&gt;devzone.nordicsemi.com/.../nrfx_5F00_twi.c&lt;/a&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nrf_twi_mngr handling of transfers larger than 255 Bytes</title><link>https://devzone.nordicsemi.com/thread/140102?ContentTypeID=1</link><pubDate>Fri, 13 Jul 2018 20:07:55 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:659171f5-ca13-4902-8f70-7c6a283635d1</guid><dc:creator>raemond</dc:creator><description>&lt;p&gt;I noticed the limitation on the length set by the usage of a uint8_t buffer length variable. So that&amp;#39;s why I broke it up into pieces. Comments with the twi_mngr indicated that they would be grouped if I used the&amp;nbsp;&lt;span&gt;NRF_TWI_MNGR_NO_STOP flag, but that doesn&amp;#39;t appear to be the case.&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nrf_twi_mngr handling of transfers larger than 255 Bytes</title><link>https://devzone.nordicsemi.com/thread/140101?ContentTypeID=1</link><pubDate>Fri, 13 Jul 2018 19:54:09 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:1226fc47-3041-443d-be96-c373fd97a8a3</guid><dc:creator>jakub</dc:creator><description>&lt;p&gt;I think I know what the problem is, twi_mngr is using legacy driver. Legacy driver has hard coded limitation set on transmit buffers to 8bits.&lt;/p&gt;
&lt;p&gt;One needs to migrate twi_mngr to use&amp;nbsp;nrfx driver and the problem will be solved. Nrfx driver is capable to use tx buffer according to used SoC:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&amp;nbsp;8&amp;nbsp; &amp;nbsp;bit for nrf52832&lt;/li&gt;
&lt;li&gt;10 bit for nrf52810&lt;/li&gt;
&lt;li&gt;16 bit for nrf52840&lt;/li&gt;
&lt;/ul&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nrf_twi_mngr handling of transfers larger than 255 Bytes</title><link>https://devzone.nordicsemi.com/thread/140100?ContentTypeID=1</link><pubDate>Fri, 13 Jul 2018 19:44:20 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:ad8dcb5a-ec98-4575-af0c-00f4656e4b75</guid><dc:creator>raemond</dc:creator><description>&lt;p&gt;It seems to happen whether or not EasyDMA is enabled.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nrf_twi_mngr handling of transfers larger than 255 Bytes</title><link>https://devzone.nordicsemi.com/thread/140098?ContentTypeID=1</link><pubDate>Fri, 13 Jul 2018 16:57:19 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:3ff01384-d02e-4186-8edf-3f38043437ae</guid><dc:creator>raemond</dc:creator><description>&lt;p&gt;1. SDK 15.0.0&lt;/p&gt;
&lt;p&gt;2. nRF52840&lt;/p&gt;
&lt;p&gt;3. EasyDMA is enabled for the interface.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nrf_twi_mngr handling of transfers larger than 255 Bytes</title><link>https://devzone.nordicsemi.com/thread/139996?ContentTypeID=1</link><pubDate>Fri, 13 Jul 2018 05:46:01 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:5a62caf0-c1fd-4e28-a50f-8a0bfc6d0677</guid><dc:creator>Jakub Rzeszutko</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;1. What SDK are you using?&lt;/p&gt;
&lt;p&gt;2. What uC are you using?&lt;/p&gt;
&lt;p&gt;3. Do you use I2C with EasyDMA support?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>