<?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 hanging in while (m_xfer_done == false); communicating with Arduino</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/65094/twi-hanging-in-while-m_xfer_done-false-communicating-with-arduino</link><description>I am trying to use I2C (TWI) to communicate between my custom nRF52811 board with an Arduino. Currently my program hangs at the while (m_xfer_done == false); loop as m_xfer_done never gets set to true. I believe that the nrf chip gets stuck at the end</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Mon, 24 Aug 2020 10:43:59 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/65094/twi-hanging-in-while-m_xfer_done-false-communicating-with-arduino" /><item><title>RE: TWI hanging in while (m_xfer_done == false); communicating with Arduino</title><link>https://devzone.nordicsemi.com/thread/265936?ContentTypeID=1</link><pubDate>Mon, 24 Aug 2020 10:43:59 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:f5baa289-733a-4d27-8b26-4dd6a5acdd00</guid><dc:creator>LimeItLess</dc:creator><description>&lt;p&gt;Got it to work, it was a issues with converting&amp;nbsp;&lt;span&gt;pca10056 to&amp;nbsp;pca10056e. &lt;a href="https://devzone.nordicsemi.com/f/nordic-q-a/57878/programming-custom-board-through-ses-corrupts-host-device-s-bootloader/235914#235914" rel="noopener noreferrer" target="_blank"&gt;This post&lt;/a&gt; was extremely helpful. TLDR quoting the solution:&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&amp;nbsp;&lt;/span&gt;&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;Right Click the project in the Project Explorer. In this case it will be named &amp;#39;twi_scanner_pca10056&amp;#39; (or other twi&amp;nbsp;&lt;span&gt;pca10056 project)&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;Select &amp;#39;Open Solution in Editor&amp;#39; from the menu that appears.&lt;/li&gt;
&lt;li&gt;Change&amp;nbsp;arm_fp_abi from &amp;quot;Hard&amp;quot; to &amp;quot;Soft&amp;quot;&lt;/li&gt;
&lt;li&gt;Change&amp;nbsp;arm_fpu_type from &amp;quot;FPv4-SP-D16&amp;quot; to &amp;quot;Soft&amp;quot;&lt;/li&gt;
&lt;li&gt;Change&amp;nbsp;arm_target_device_name from &amp;quot;nRF52840_xxAA&amp;quot; to&amp;nbsp;&lt;span&gt;&amp;quot;nRF52811_xxAA&amp;quot;&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;Add in any directories you might want to use to&amp;nbsp;c_user_include_directories&lt;/li&gt;
&lt;li&gt;Change in&amp;nbsp;c_preprocessor_definitions:
&lt;ol&gt;
&lt;li&gt;BOARD_PCA10056 to your custom board&lt;/li&gt;
&lt;li&gt;FLOAT_ABI_HARD to&amp;nbsp;FLOAT_ABI_SOFT&lt;/li&gt;
&lt;li&gt;NRF52840_XXAA to&amp;nbsp;NRF52811_XXAA&lt;/li&gt;
&lt;/ol&gt;
&lt;/li&gt;
&lt;li&gt;Change debug_register_definition_file from&amp;nbsp;&amp;quot;../../../../../../modules/nrfx/mdk/nrf52840.svd&amp;quot; to&amp;nbsp;&amp;quot;../../../../../../modules/nrfx/mdk/nrf52811.svd&amp;quot;&lt;/li&gt;
&lt;li&gt;Change linker_section_placement_macros:&lt;br /&gt;
&lt;ol&gt;
&lt;li&gt;FLASH_PH_SIZE=0x100000 to&amp;nbsp;0x30000&lt;/li&gt;
&lt;li&gt;RAM_PH_SIZE=0x40000 to&amp;nbsp;0x6000&lt;/li&gt;
&lt;li&gt;FLASH_SIZE=0x100000 to&amp;nbsp;0x30000&lt;/li&gt;
&lt;li&gt;RAM_SIZE=0x40000 to&amp;nbsp;0x6000&lt;/li&gt;
&lt;/ol&gt;
&lt;/li&gt;
&lt;li&gt;Under &amp;lt;folder Name=&amp;quot;None&amp;quot;&amp;gt;
&lt;ol&gt;
&lt;li&gt;&amp;lt;file file_name=&amp;quot;../../../../../../modules/nrfx/mdk/ses_startup_nrf52840.s&amp;quot; /&amp;gt; change to&amp;nbsp;&amp;lt;file file_name=&amp;quot;../../../../../../modules/nrfx/mdk/ses_startup_nrf52811.s&amp;quot; /&amp;gt;&lt;/li&gt;
&lt;li&gt;&amp;lt;file file_name=&amp;quot;../../../../../../modules/nrfx/mdk/system_nrf52840.c&amp;quot; /&amp;gt; change to&amp;nbsp;&amp;lt;file file_name=&amp;quot;../../../../../../modules/nrfx/mdk/system_nrf52811.c&amp;quot; /&amp;gt;&lt;/li&gt;
&lt;/ol&gt;
&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;&lt;strong&gt;sdk_config.h modifcations&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;The reason I have included these is to use them as an example of the things you might have to change in a separate example.&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;NRFX_TWIM0_ENABLED from 0 to 1&lt;/li&gt;
&lt;li&gt;NRFX_TWI0_ENABLED from 0 to 1&lt;/li&gt;
&lt;li&gt;TWI1_ENABLED from 1 to 0&lt;/li&gt;
&lt;li&gt;UART_LEGACY_SUPPORT from 1 to 0&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;&lt;em&gt;In order to get things printing in the Debug Terminal&lt;/em&gt;&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;NRF_LOG_BACKEND_RTT_ENABLED from 0 to 1&lt;/li&gt;
&lt;li&gt;NRF_FPRINTF_FLAG_AUTOMATIC_CR_ON_LF_ENABLED from 1 to 0&lt;/li&gt;
&lt;li&gt;NRF_LOG_BACKEND_UART_ENABLED from 1 to 0&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;&lt;strong&gt;main.c modifications&lt;/strong&gt;&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;Change your pin assignment&lt;/li&gt;
&lt;/ol&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>