<?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>TWI don&amp;#39;t work when BLE is running?</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/61554/twi-don-t-work-when-ble-is-running</link><description>Hi, 
 I&amp;#39;m using nrf52-pca10040 and sdk-15.3, I tested an eeprom chip following twi_scanner example, using no block nrf_drv_twi_xfer way, which works well, then I put it in ble_app_uart example with S112, neither ble nor eeprom can work. 
 I also tried</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Wed, 20 May 2020 14:58:28 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/61554/twi-don-t-work-when-ble-is-running" /><item><title>RE: TWI don't work when BLE is running?</title><link>https://devzone.nordicsemi.com/thread/251048?ContentTypeID=1</link><pubDate>Wed, 20 May 2020 14:58:28 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:0ac51ef6-a803-460c-a81a-a78e3f17783f</guid><dc:creator>zzzh</dc:creator><description>&lt;p&gt;I realized that a write cycle would need 5ms, that&amp;#39;s why&amp;nbsp;&lt;span&gt;clear&amp;nbsp;eep_busy in interrupt would not work, the printing must take more than 5ms, that&amp;#39;s why clear&amp;nbsp;eep_busy after printing works well.&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: TWI don't work when BLE is running?</title><link>https://devzone.nordicsemi.com/thread/250889?ContentTypeID=1</link><pubDate>Wed, 20 May 2020 09:33:18 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:065a7c8d-a059-4430-bdd0-35b32c08ae59</guid><dc:creator>zzzh</dc:creator><description>&lt;p&gt;To describe the next issue, I&amp;#39;ll introduce&amp;nbsp;how I do it first.&lt;/p&gt;
&lt;p&gt;An eeprom test program usually write something then read it out to verify it&amp;#39;s working correctly, so is my code.&lt;/p&gt;
&lt;p&gt;The eeprom chip I&amp;#39;m using only support write/read in 1 page once, so, to write/read data larger than one or more page size (128 bytes in this case),&amp;nbsp;have to do it in multiple parts, when there&amp;#39;s no BLE, that&amp;#39;s easy:&lt;/p&gt;
&lt;p&gt;1. divide the task to multiple parts&lt;/p&gt;
&lt;p&gt;2. when the first part is executing, waiting for the interrupt to tell you it&amp;#39;s finished, I put a signal in interrupt code called eep_busy, so when eep_busy is 0, stop waiting and do next part&lt;/p&gt;
&lt;p&gt;3. in interrupt code, I also do some printing to show the result, if it&amp;#39;s a read, there can be a lot of printing, to make it simple, I set eep_busy to 0 after after printing for the part is done,&amp;nbsp;&lt;/p&gt;
&lt;p&gt;When there&amp;#39;s BLE, put printing in interrupt looks bad, so&amp;nbsp;have to do it in scheduler way, that is, put the printing part in scheduler to run in main loop.&lt;/p&gt;
&lt;p&gt;The next issue is, it&amp;#39;s always waitting for the&amp;nbsp;&lt;span&gt;eep_busy to continue, which is in main loop, while my test code is before main loop. so it stuck before the main loop run. ( I tried to clear&amp;nbsp;eep_busy in interrupt, but it will stuck at waitting for it at last ( don&amp;#39;t know why ), and in this way, print the data in time is impossible)&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;So, how to arrange them to run in scheduler way?&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: TWI don't work when BLE is running?</title><link>https://devzone.nordicsemi.com/thread/250868?ContentTypeID=1</link><pubDate>Wed, 20 May 2020 08:25:46 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:57050985-2704-4afc-bbf5-fc01c14d387d</guid><dc:creator>zzzh</dc:creator><description>&lt;p&gt;It&amp;#39;s from&amp;nbsp;uart_event_handle, which is the EVT_HANDLER in&amp;nbsp;APP_UART_FIFO_INIT.&lt;/p&gt;
&lt;p&gt;It would pass this issue if I put serial cable on, to make it easier, I commented uart_init and printf to make it easier, though there&amp;#39;s another issue..&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: TWI don't work when BLE is running?</title><link>https://devzone.nordicsemi.com/thread/250862?ContentTypeID=1</link><pubDate>Wed, 20 May 2020 07:29:26 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:6b585343-56e0-4efd-b24f-1fc7d4b81806</guid><dc:creator>Kenneth</dc:creator><description>&lt;p&gt;I can&amp;#39;t see from your code which api return NRF_ERROR_NO_MEM?&lt;/p&gt;
&lt;p&gt;It may be because NRF_ERROR_NO_MEM by accident have the same numeric value (4) as FRAMING error:&lt;br /&gt;#define NRF_ERROR_NO_MEM&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; (NRF_ERROR_BASE_NUM + 4)&amp;nbsp; ///&amp;lt; No Memory for operation&lt;/p&gt;
&lt;p&gt;Kenneth&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: TWI don't work when BLE is running?</title><link>https://devzone.nordicsemi.com/thread/250859?ContentTypeID=1</link><pubDate>Wed, 20 May 2020 06:55:12 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:d855c4a0-1b57-4215-a533-10434bca332c</guid><dc:creator>zzzh</dc:creator><description>&lt;p&gt;Thank you, Kenneth.&lt;/p&gt;
&lt;p&gt;&lt;span&gt;FRAMING error m&lt;/span&gt;ake sense, but why it says&amp;nbsp;&lt;span&gt;ERROR 4 [NRF_ERROR_NO_MEM]? is this a bug?&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: TWI don't work when BLE is running?</title><link>https://devzone.nordicsemi.com/thread/250856?ContentTypeID=1</link><pubDate>Wed, 20 May 2020 06:29:31 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:7b0a6c16-5b58-43c1-a6e9-2b3d0792d95c</guid><dc:creator>Kenneth</dc:creator><description>&lt;p&gt;Seems you have included UART somewhere in your project, looks like the error here is:&lt;br /&gt;&lt;a href="https://infocenter.nordicsemi.com/topic/com.nordic.infocenter.nrf52832.ps.v1.1/uarte.html#register.ERRORSRC"&gt;https://infocenter.nordicsemi.com/topic/com.nordic.infocenter.nrf52832.ps.v1.1/uarte.html#register.ERRORSRC&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;FRAMING error, typically because you have enabled UART RX, and the pin is floating, e.g. not pulled high. You can pull it high using an external pull-up resistor if it&amp;#39;s not in use.&amp;nbsp;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: TWI don't work when BLE is running?</title><link>https://devzone.nordicsemi.com/thread/250762?ContentTypeID=1</link><pubDate>Tue, 19 May 2020 13:58:37 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:32fec329-2edf-4dc5-a185-7d29ff05c85e</guid><dc:creator>zzzh</dc:creator><description>&lt;p&gt;I put it in debug mode and found something.&lt;/p&gt;
&lt;p&gt;ERROR 4 [NRF_ERROR_NO_MEM] at&lt;/p&gt;
&lt;p&gt;case APP_UART_COMMUNICATION_ERROR:&lt;br /&gt; APP_ERROR_HANDLER(p_event-&amp;gt;data.error_communication);&lt;br /&gt; break;&lt;/p&gt;
&lt;p&gt;I do use 260 bytes in global ram space as read and write buffer,&amp;nbsp; if this is the reason, where should I change to afford them?&lt;/p&gt;
&lt;p&gt;Another question, I only used NRF_LOG_INFO in eeprom program, and the LOG backtend is RTT, not UART, why UART is complaining?&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: TWI don't work when BLE is running?</title><link>https://devzone.nordicsemi.com/thread/250744?ContentTypeID=1</link><pubDate>Tue, 19 May 2020 13:16:04 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:d4e72e37-5c8e-4b50-b9cd-a2d555d34e00</guid><dc:creator>zzzh</dc:creator><description>&lt;p&gt;Thanks for the quick reply.&lt;/p&gt;
&lt;p&gt;I did compare the 2 sdk_config.h at TWI part, and set NRFX_TWIM_ENABLED (the only difference in this part) to 1.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: TWI don't work when BLE is running?</title><link>https://devzone.nordicsemi.com/thread/250722?ContentTypeID=1</link><pubDate>Tue, 19 May 2020 12:38:36 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:ecb41af4-b46f-40df-8d25-46b0a1f86a43</guid><dc:creator>Kenneth</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;Have you copied all&amp;nbsp;defines of *TWI* from sdk_config.h to your new sdk_config.h?&lt;/p&gt;
&lt;p&gt;Best regards,&lt;br /&gt;Kenneth&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>