<?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 and S140 BLE controller conflict on nrf52840 dk using Zephyr</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/66714/twi-and-s140-ble-controller-conflict-on-nrf52840-dk-using-zephyr</link><description>I have TWI sensor comms running fine in Zephyr on nrf52840_dk and separately Bluetooth controller in low latency mode using S140 softdevice also running fine in Zephyr on the nrf52840_dk. 
 When combined into one project, if the BT stack is enabled (even</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Wed, 07 Oct 2020 12:55:32 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/66714/twi-and-s140-ble-controller-conflict-on-nrf52840-dk-using-zephyr" /><item><title>RE: TWI and S140 BLE controller conflict on nrf52840 dk using Zephyr</title><link>https://devzone.nordicsemi.com/thread/273503?ContentTypeID=1</link><pubDate>Wed, 07 Oct 2020 12:55:32 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:9fb6f96d-13cf-429e-b087-c30ed4abea13</guid><dc:creator>Sigurd</dc:creator><description>&lt;p&gt;Great! Happy to help&amp;nbsp;&lt;span class="emoticon" data-url="https://devzone.nordicsemi.com/cfs-file/__key/system/emoji/263a.svg" title="Relaxed"&gt;&amp;#x263a;&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: TWI and S140 BLE controller conflict on nrf52840 dk using Zephyr</title><link>https://devzone.nordicsemi.com/thread/273475?ContentTypeID=1</link><pubDate>Wed, 07 Oct 2020 11:56:31 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:dad42144-db3e-433f-a6f5-4073214be068</guid><dc:creator>JustinL</dc:creator><description>&lt;p&gt;Brilliant!! Those config settings fixed it immediately. Thank you so much, that had me stuck for several days.&lt;/p&gt;
&lt;p&gt;This was using the zephyr version in nrf sdk 1.3.1.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: TWI and S140 BLE controller conflict on nrf52840 dk using Zephyr</title><link>https://devzone.nordicsemi.com/thread/273430?ContentTypeID=1</link><pubDate>Wed, 07 Oct 2020 09:58:00 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:e1ba34dd-1fb1-4e17-a32f-27779035c18d</guid><dc:creator>Sigurd</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
[quote user=""]Are you able to clarify if the Zephyr nrf TWI or TWIM drivers are expected to be compatible with enabling Softdevice Bluetooth controller on Zephyr?[/quote]
&lt;p&gt;&amp;nbsp;Yes, they are expected to be compatible.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;What tag/branch/commit are you using ?&lt;/p&gt;
&lt;p&gt;How have you configured the stack/heap ?&lt;/p&gt;
&lt;p&gt;Do you see any changes if you set the stack/heap like this ?&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;# Heap and stacks
CONFIG_HEAP_MEM_POOL_SIZE=16384
CONFIG_MAIN_STACK_SIZE=8192
CONFIG_SYSTEM_WORKQUEUE_STACK_SIZE=2048
CONFIG_HW_STACK_PROTECTION=y&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
[quote userid="93997" url="~/f/nordic-q-a/66714/twi-and-s140-ble-controller-conflict-on-nrf52840-dk-using-zephyr"]Bluetooth controller in low latency mode[/quote]
&lt;p&gt;Do you see any difference in behavior if you are not using low latency mode?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: TWI and S140 BLE controller conflict on nrf52840 dk using Zephyr</title><link>https://devzone.nordicsemi.com/thread/273188?ContentTypeID=1</link><pubDate>Tue, 06 Oct 2020 11:02:30 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:553a2c07-1be7-4b6b-92ba-6b6c048dd882</guid><dc:creator>JustinL</dc:creator><description>&lt;p&gt;I have now removed USB CDC initialization&amp;nbsp;and now only log via RTT debug. So I now only have a BT stack and the TWI.&lt;br /&gt;I have also set the TWI priority to be the same as the main thread.&lt;br /&gt;&lt;br /&gt;With these changes Bluetooth advertising starts and TWI access works alongside bluetooth.&lt;br /&gt;A BT client can connect and subscribe to a characteristic.&lt;br /&gt;&lt;br /&gt;&lt;/p&gt;
&lt;p&gt;However, when bt_gatt_notify() or bt_gatt_notify_cb() are called (whilst the client is subscribed), a few msec later there is a fatal error.&lt;/p&gt;
&lt;p&gt;I have even tried putting the main thread into a while(1) loop after calling bt_gatt_notify(), but still a few msec later crash even though my code is literally doing nothing.&amp;nbsp;&lt;br /&gt;&lt;br /&gt;Here is the debug log showing the timing when bt_gatt_notify() is called and the exception.&lt;br /&gt;&lt;br /&gt;&lt;pre class="ui-code" data-mode="text"&gt;[00:00:22.843,475]&amp;lt;inf&amp;gt; main: About to call bt_gatt_notify_cb()
[00:00:22.862,823]&amp;lt;inf&amp;gt; main: In ble_send_compressed_quaternion_olny
[00:00:25.315,155]&amp;lt;err&amp;gt; os: ***** USAGE FAULT *****
[00:00:25.315,185]&amp;lt;err&amp;gt; os:   Illegal use of the EPSR
[00:00:25.315,185]&amp;lt;err&amp;gt; os: r0/a1:  0x00000000  r1/a2:  0xe000ed00  r2/a3:  0x20007eb4
[00:00:25.315,185]&amp;lt;err&amp;gt; os: r3/a4:  0x00000000 r12/ip:  0x00000000 r14/lr:  0x000322e1
[00:00:25.315,185]&amp;lt;err&amp;gt; os:  xpsr:  0x60000000
[00:00:25.315,216]&amp;lt;err&amp;gt; os: Faulting instruction address (r15/pc): 0x00000000
[00:00:25.315,216]&amp;lt;err&amp;gt; os: &amp;gt;&amp;gt;&amp;gt; ZEPHYR FATAL ERROR 0: CPU exception on CPU 0
[00:00:25.315,216]&amp;lt;err&amp;gt; os: Current thread: 0x2000716c (unknown)
[00:00:27.911,712]&amp;lt;err&amp;gt; fatal_error: Resetting system&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Unfortunately with logging on the debugger now has nothing in the stack trace when it breaks on the fault so I can&amp;#39;t see what function it is in except that with the while(1) test, it can&amp;#39;t be a fault in my code after the bt_gatt_notify is called.&lt;br /&gt;&lt;br /&gt;Thanks&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>