<?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>Issue including hardware peripherals to a project with softdevice loaded. TWI master communication issue.</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/53747/issue-including-hardware-peripherals-to-a-project-with-softdevice-loaded-twi-master-communication-issue</link><description>Hello, 
 
 I have program w/o using softdevice to drive an LED driver using I2C. I was able to get this to work very well with out a softdevice, however once I loaded a soft device, the program gets stuck in a while loop. 
 In order to get out of the</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Tue, 05 Nov 2019 07:04:13 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/53747/issue-including-hardware-peripherals-to-a-project-with-softdevice-loaded-twi-master-communication-issue" /><item><title>RE: Issue including hardware peripherals to a project with softdevice loaded. TWI master communication issue.</title><link>https://devzone.nordicsemi.com/thread/218410?ContentTypeID=1</link><pubDate>Tue, 05 Nov 2019 07:04:13 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:65f4fd6e-bd4a-4e48-b4ca-f2ad497d86bf</guid><dc:creator>Vidar Berg</dc:creator><description>&lt;p&gt;Glad to hear that you found the solution. Thanks for updating the thread. I didn&amp;#39;t get time to look at your project before.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Issue including hardware peripherals to a project with softdevice loaded. TWI master communication issue.</title><link>https://devzone.nordicsemi.com/thread/218386?ContentTypeID=1</link><pubDate>Tue, 05 Nov 2019 01:12:21 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:fa407d5a-b319-43e7-9b57-739a2ca257c9</guid><dc:creator>Tandon</dc:creator><description>&lt;p&gt;&lt;a href="https://devzone.nordicsemi.com/f/nordic-q-a/29041/how-to-enable-p0-09-and-p0-10-as-gpio-pins-on-the-nrf52-instead-of-nfc-pins"&gt;https://devzone.nordicsemi.com/f/nordic-q-a/29041/how-to-enable-p0-09-and-p0-10-as-gpio-pins-on-the-nrf52-instead-of-nfc-pins&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;This fixes it. NFC didn&amp;#39;t allow for data transfer.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Issue including hardware peripherals to a project with softdevice loaded. TWI master communication issue.</title><link>https://devzone.nordicsemi.com/thread/218367?ContentTypeID=1</link><pubDate>Mon, 04 Nov 2019 21:06:50 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:07e263f9-53f1-409c-8550-e36687f96956</guid><dc:creator>Tandon</dc:creator><description>&lt;p&gt;Any luck? Any questions I may be able to answer?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Issue including hardware peripherals to a project with softdevice loaded. TWI master communication issue.</title><link>https://devzone.nordicsemi.com/thread/218304?ContentTypeID=1</link><pubDate>Mon, 04 Nov 2019 15:25:03 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:9d480d55-91b9-4fb6-95b6-253ccf239637</guid><dc:creator>Tandon</dc:creator><description>&lt;p&gt;&lt;a href="https://devzone.nordicsemi.com/cfs-file/__key/communityserver-discussions-components-files/4/ble_5F00_app_5F00_uart_5F00_TWI.zip"&gt;devzone.nordicsemi.com/.../ble_5F00_app_5F00_uart_5F00_TWI.zip&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;Thanks I appreciate it. SDK 14.2.0 and softdevice is attached as well..&lt;a href="https://devzone.nordicsemi.com/cfs-file/__key/communityserver-discussions-components-files/4/7446.s132_5F00_nrf52_5F00_5.0.0_5F00_softdevice.hex"&gt;devzone.nordicsemi.com/.../7446.s132_5F00_nrf52_5F00_5.0.0_5F00_softdevice.hex&lt;/a&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Issue including hardware peripherals to a project with softdevice loaded. TWI master communication issue.</title><link>https://devzone.nordicsemi.com/thread/218297?ContentTypeID=1</link><pubDate>Mon, 04 Nov 2019 15:07:42 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:2009446f-1e3d-4561-a928-a1d0199f1f37</guid><dc:creator>Vidar Berg</dc:creator><description>&lt;p&gt;0x0&amp;nbsp;is the return code for&amp;nbsp;NRF_SUCCESS which is what you normally want a function call to return. Any other value indicates that an error occurred.&amp;nbsp;&lt;/p&gt;
[quote user="Tandon"]I see the same when everything in int main() is commented out. Only soft device is loaded. I have verified the functionality of the chip with out a softdevice loaded. Any similar issues youve encountered in the past? I also have raised the priority to 3[/quote]
&lt;p&gt;&amp;nbsp;The Softdevice should not impact the application if it&amp;#39;s not doing anything. E.g., maintaining active BLE connections, etc. It will not write anything to the GPIO or TWI registers.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Maybe you can upload your whole project (the last one with everything in main() commented out)? I&amp;nbsp;can try to do some debugging here.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Issue including hardware peripherals to a project with softdevice loaded. TWI master communication issue.</title><link>https://devzone.nordicsemi.com/thread/218087?ContentTypeID=1</link><pubDate>Sun, 03 Nov 2019 21:33:06 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:f236d0ab-5e3c-45ac-8c2f-08a020014cc2</guid><dc:creator>Tandon</dc:creator><description>&lt;p&gt;State of Pins: TCK: 0, TDI: 0, TDO: 0, TMS: 1, TRES: 1, TRST: 1&lt;/p&gt;
&lt;p&gt;is this pin config?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Issue including hardware peripherals to a project with softdevice loaded. TWI master communication issue.</title><link>https://devzone.nordicsemi.com/thread/218068?ContentTypeID=1</link><pubDate>Sun, 03 Nov 2019 02:35:59 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:f3b28698-fe6e-4666-bf27-da3608366f75</guid><dc:creator>Tandon</dc:creator><description>&lt;p&gt;after&amp;nbsp;nrf_drv_twi_tx; err_code is returned as 0x0000; what does that mean?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Issue including hardware peripherals to a project with softdevice loaded. TWI master communication issue.</title><link>https://devzone.nordicsemi.com/thread/218067?ContentTypeID=1</link><pubDate>Sun, 03 Nov 2019 02:26:09 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:a3d3a49c-6001-4f2c-9775-0c6aa3783a00</guid><dc:creator>Tandon</dc:creator><description>&lt;p&gt;How can I read back the pin config?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Issue including hardware peripherals to a project with softdevice loaded. TWI master communication issue.</title><link>https://devzone.nordicsemi.com/thread/218066?ContentTypeID=1</link><pubDate>Sun, 03 Nov 2019 02:25:35 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:8ac31d8b-51d2-45de-bc11-e3f3aa172657</guid><dc:creator>Tandon</dc:creator><description>&lt;p&gt;I see the same when everything in int main() is commented out. Only soft device is loaded. I have verified the functionality of the chip with out a softdevice loaded. Any similar issues youve encountered in the past? I also have raised the priority to 3&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Issue including hardware peripherals to a project with softdevice loaded. TWI master communication issue.</title><link>https://devzone.nordicsemi.com/thread/217493?ContentTypeID=1</link><pubDate>Wed, 30 Oct 2019 11:01:12 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:da247fe8-267f-46b3-9d4b-37b8a7d29d8a</guid><dc:creator>Vidar Berg</dc:creator><description>&lt;p&gt;Is it possible that one or both TWI pins are being overridden by BSP,etc?&amp;nbsp; Do you see the same if you comment this line in main():&amp;nbsp;buttons_leds_init(). Can you read-back the pin configuration when you&amp;#39;re stuck in the while loop?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Issue including hardware peripherals to a project with softdevice loaded. TWI master communication issue.</title><link>https://devzone.nordicsemi.com/thread/217405?ContentTypeID=1</link><pubDate>Tue, 29 Oct 2019 21:01:12 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:d5ac7fbe-4ba6-4c00-bc48-7f3ee861bbcb</guid><dc:creator>Tandon</dc:creator><description>&lt;p&gt;This is in I2C wrapper.c line 57&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Issue including hardware peripherals to a project with softdevice loaded. TWI master communication issue.</title><link>https://devzone.nordicsemi.com/thread/217404?ContentTypeID=1</link><pubDate>Tue, 29 Oct 2019 21:00:45 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:8fdff9b0-ab97-4b52-aceb-8f06ee94da86</guid><dc:creator>Tandon</dc:creator><description>&lt;p&gt;Seems like the data doesn&amp;#39;t transfer at all....&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;I stepped through the code and don&amp;#39;t any clock of data cycle when&amp;nbsp;&lt;/p&gt;
&lt;p&gt;err_code = nrf_drv_twi_tx(&amp;amp;I2C_twi_master, ptrDevice, m_txbuf, sizeof(m_txbuf), nostop);&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;is written&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Issue including hardware peripherals to a project with softdevice loaded. TWI master communication issue.</title><link>https://devzone.nordicsemi.com/thread/217374?ContentTypeID=1</link><pubDate>Tue, 29 Oct 2019 15:18:30 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:e6d28ccd-b172-452b-a1de-15173555df64</guid><dc:creator>Vidar Berg</dc:creator><description>&lt;p&gt;The frequency should be fine. Do you have access to a scope or logic analyzer so you can see if any data is being transferred at all? I think it&amp;#39;s a bit strange that the callback is not getting called.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Issue including hardware peripherals to a project with softdevice loaded. TWI master communication issue.</title><link>https://devzone.nordicsemi.com/thread/217371?ContentTypeID=1</link><pubDate>Tue, 29 Oct 2019 15:08:50 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:9931691c-2dc5-4c8c-a025-b0c8960214f1</guid><dc:creator>Tandon</dc:creator><description>&lt;p&gt;Yes, it is under I2C wrapper. c line 80&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;I lowered the priority and it is still stuck. I even had to to the highest priority?&lt;/p&gt;
&lt;p&gt;Should I change the frequency?&lt;/p&gt;
&lt;p&gt;My twi config is on main.c&amp;nbsp;&lt;span&gt;&amp;nbsp;lines 380-410&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Issue including hardware peripherals to a project with softdevice loaded. TWI master communication issue.</title><link>https://devzone.nordicsemi.com/thread/217369?ContentTypeID=1</link><pubDate>Tue, 29 Oct 2019 15:03:02 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:a6842e31-67e7-4763-ba56-a58cbfd6f8af</guid><dc:creator>Vidar Berg</dc:creator><description>&lt;p&gt;Is that while loop shown in the code you uploaded here? Have you tried changing the interrupt priority?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Issue including hardware peripherals to a project with softdevice loaded. TWI master communication issue.</title><link>https://devzone.nordicsemi.com/thread/217363?ContentTypeID=1</link><pubDate>Tue, 29 Oct 2019 14:44:18 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:1613addd-78ee-4b46-8fb8-43a254fac723</guid><dc:creator>Tandon</dc:creator><description>&lt;p&gt;The while loop is in the code for the TWI driver.&lt;/p&gt;
&lt;p&gt;I am unable to check for&amp;nbsp;NRF_DRV_TWI_EVT_DONE,&amp;nbsp;NRF_DRV_TWI_EVT_ADDRESS_NACK or&amp;nbsp;NRF_DRV_TWI_EVT_DATA_NACK&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;as the twi_handler is never called upon when softdevice is loaded.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;twi_handler gets called when softdevice is not loaded and using only the ARM processor.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Issue including hardware peripherals to a project with softdevice loaded. TWI master communication issue.</title><link>https://devzone.nordicsemi.com/thread/217361?ContentTypeID=1</link><pubDate>Tue, 29 Oct 2019 14:38:41 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:31c94205-6f23-4b2d-b485-391b629f178e</guid><dc:creator>Vidar Berg</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
[quote user=""]I was able to get this to work very well with out a softdevice, however once I loaded a soft device, the program gets stuck in a while loop.[/quote]
&lt;p&gt;&amp;nbsp;Is the while loop in your code, or is it inside the Softdevice? Also, are you able to check if you receive any&amp;nbsp;NRF_DRV_TWI_EVT_ADDRESS_NACK or&amp;nbsp;NRF_DRV_TWI_EVT_DATA_NACK in your callback?&lt;/p&gt;
&lt;p&gt;Thanks,&lt;/p&gt;
&lt;p&gt;Vidar&lt;/p&gt;
&lt;p&gt;edit: I would also have considered changing the interrupt priority of TWI to&amp;nbsp;APP_IRQ_PRIORITY_LOWEST to be aligned with the other SDK modules.&amp;nbsp;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Issue including hardware peripherals to a project with softdevice loaded. TWI master communication issue.</title><link>https://devzone.nordicsemi.com/thread/217201?ContentTypeID=1</link><pubDate>Mon, 28 Oct 2019 19:14:47 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:c1559c49-f89f-4191-b4a6-a1995953f55b</guid><dc:creator>Tandon</dc:creator><description>&lt;p&gt;Relevant code here is&amp;nbsp;&lt;/p&gt;
&lt;p&gt;main.c - lines 319 - 335; lines 380-410; called upon in line 1023&lt;/p&gt;
&lt;p&gt;I2C wrapper.c - lines 31 - 88&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>