<?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 init conflicting with BLE initialisation calls</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/117/twi-init-conflicting-with-ble-initialisation-calls</link><description>Hello. I&amp;#39;ve used the design template that initialises everything for Bluetooth communication. These are the initialisation calls made in main(): 
 // Initialize
leds_init();
timers_init();
gpiote_init();
buttons_init();
ble_stack_init();
scheduler_init</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Tue, 16 Jul 2013 11:24:07 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/117/twi-init-conflicting-with-ble-initialisation-calls" /><item><title>RE: TWI init conflicting with BLE initialisation calls</title><link>https://devzone.nordicsemi.com/thread/644?ContentTypeID=1</link><pubDate>Tue, 16 Jul 2013 11:24:07 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:a8f4f2fe-1d76-455b-8def-71920bb49650</guid><dc:creator>H&amp;#229;kon Alseth</dc:creator><description>&lt;p&gt;This file is something we at tech support have modified to make it softdevice compatible. I have pushed this to the R&amp;amp;D team to have them integrate a &amp;quot;softdevice&amp;quot; friendly library for all peripherals that are using restricted features (like PPI/random number generator etc).&lt;/p&gt;
&lt;p&gt;All peripherals that are blocked/restricted or open are shown in the S110 specification, so when you get an error like this, you&amp;#39;ll have to make sure that you are doing something &amp;quot;legal&amp;quot; in terms of which peripheral you are accessing.&lt;/p&gt;
&lt;p&gt;The TWI is open and can be accessed directly, but in this case it&amp;#39;s a couple of PPI channels that are being assigned inside the TWI library, which is very hidden and thats not fortunate.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: TWI init conflicting with BLE initialisation calls</title><link>https://devzone.nordicsemi.com/thread/643?ContentTypeID=1</link><pubDate>Tue, 16 Jul 2013 11:07:18 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:9592c892-7b63-4a6a-ac8a-8614150e0747</guid><dc:creator>sd</dc:creator><description>&lt;p&gt;YES! It&amp;#39;s working now! Phew. I was afraid of this being a huge time sink, so thank you for your patience and prompt replies! (If I didn&amp;#39;t go asking stuff on this forum, how would I have known that this file is needed and where to get it?)&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: TWI init conflicting with BLE initialisation calls</title><link>https://devzone.nordicsemi.com/thread/642?ContentTypeID=1</link><pubDate>Tue, 16 Jul 2013 11:01:34 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:170d4d2a-9aae-496f-801b-a6e1b3c0cb26</guid><dc:creator>H&amp;#229;kon Alseth</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;I uploaded it in this case:
&lt;a target="_blank" href="https://devzone.nordicsemi.com/index.php/best-place-to-get-started" rel="nofollow"&gt;https://devzone.nordicsemi.com/index.php/best-place-to-get-started&lt;/a&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: TWI init conflicting with BLE initialisation calls</title><link>https://devzone.nordicsemi.com/thread/641?ContentTypeID=1</link><pubDate>Tue, 16 Jul 2013 10:58:43 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:4ea420dd-12b2-471c-a778-dbf8e37118f2</guid><dc:creator>sd</dc:creator><description>&lt;p&gt;I&amp;#39;m including the &amp;quot;twi_hw_master.c&amp;quot; file. Is &amp;quot;sd_twi_hw_master.c&amp;quot; different? Where is it found (can&amp;#39;t find it in the package)? (I&amp;#39;m new to this dev environment and BLE, so be explicit where possible.)&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: TWI init conflicting with BLE initialisation calls</title><link>https://devzone.nordicsemi.com/thread/640?ContentTypeID=1</link><pubDate>Tue, 16 Jul 2013 10:52:50 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:7ae04035-db21-4ee9-b589-be2ae0c08924</guid><dc:creator>H&amp;#229;kon Alseth</dc:creator><description>&lt;p&gt;Did you add the &amp;quot;sd_twi_hw_master.c&amp;quot; file?
A hard-fault can be triggered by many things, but most likely it&amp;#39;s due to accessing peripherals that are blocked or restricted by the softdevice (S110 spec, chapter 8 for full overview).&lt;/p&gt;
&lt;p&gt;Try inserting breakpoints and single-step through to find where you are triggering the HardFault.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: TWI init conflicting with BLE initialisation calls</title><link>https://devzone.nordicsemi.com/thread/639?ContentTypeID=1</link><pubDate>Tue, 16 Jul 2013 10:49:56 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:a98769d0-62c3-466a-9ebf-ea9656540b7a</guid><dc:creator>sd</dc:creator><description>&lt;p&gt;Thanks for the quick reply! I&amp;#39;ve made the changes, and commented ble_stack_init() back. In the debug session, it gets stuck on the following:&lt;/p&gt;
&lt;p&gt;0x00014214 E7FE      B        HardFault_Handler (0x00014214)&lt;/p&gt;
&lt;p&gt;Is this the right place to look for the assertion? What does this mean, and where would be a reference that I can look up a meaning ;)?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: TWI init conflicting with BLE initialisation calls</title><link>https://devzone.nordicsemi.com/thread/638?ContentTypeID=1</link><pubDate>Tue, 16 Jul 2013 10:31:33 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:69196216-1c06-4bad-9cb0-617beccbef73</guid><dc:creator>H&amp;#229;kon Alseth</dc:creator><description>&lt;p&gt;Wow, that was unreadable. Sorry for this.
Here&amp;#39;s a small &amp;quot;howto&amp;quot; on getting assert info:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;Comment out the nvic_systemreset&lt;/li&gt;
&lt;li&gt;comment in the &amp;quot;ble_debug_assert_handler&amp;quot;&lt;/li&gt;
&lt;/ol&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: TWI init conflicting with BLE initialisation calls</title><link>https://devzone.nordicsemi.com/thread/637?ContentTypeID=1</link><pubDate>Tue, 16 Jul 2013 10:29:56 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:891d3d9c-27b9-4ebc-8b3d-9aac2c0d0d84</guid><dc:creator>H&amp;#229;kon Alseth</dc:creator><description>&lt;p&gt;Most likely, its not the pin numbering that is making the example not work.
Have you tried debugging and see what happens?&lt;/p&gt;
&lt;p&gt;Most likely, you are getting an assert somewhere.
If you comment in the assert handler, you are able to read out which line/file/error code you are getting:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;
void app_error_handler(uint32_t error_code, uint32_t line_num, const uint8_t * p_file_name)
{
    nrf_gpio_pin_set(ASSERT_LED_PIN_NO);

    // This call can be used for debug purposes during development of an application.
    // @note CAUTION: Activating this code will write the stack to flash on an error.
    //                This function should NOT be used in a final product.
    //                It is intended STRICTLY for development/debugging purposes.
    //                The flash write will happen EVEN if the radio is active, thus interrupting
    //                any communication.
    //                Use with care. Un-comment the line below to use.
    **ble_debug_assert_handler(error_code, line_num, p_file_name);**

    // On assert, the system can only recover on reset
    **//** NVIC_SystemReset();
}    
}
&lt;/code&gt;&lt;/pre&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>