<?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>enabaling uart on nrf52840  causes soft device failure</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/46393/enabaling-uart-on-nrf52840-causes-soft-device-failure</link><description>We are using an NRF52840. After initializing a UART that uses P0.06-TX and P0.07-RX the following function calls fail: sd_ble_gap_device_name_set() and nrf_sdh_enable_rquest(). The debugger is unable to trace the calls. The calls are not returning and</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Tue, 23 Apr 2019 16:15:02 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/46393/enabaling-uart-on-nrf52840-causes-soft-device-failure" /><item><title>RE: enabaling uart on nrf52840  causes soft device failure</title><link>https://devzone.nordicsemi.com/thread/183208?ContentTypeID=1</link><pubDate>Tue, 23 Apr 2019 16:15:02 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:e2cd654d-fb89-4941-ba5f-be094b517ef8</guid><dc:creator>m2800</dc:creator><description>&lt;p&gt;&lt;span&gt;The root problem is the inability to write data out the UART from within a GCC Function Instrumentation call. It causes the program to consistently crash in&amp;nbsp;sd_ble_gap_device_name_set(). If I bypass that particular call the program will eventually crash somewhere else. This leads me to suspect SVCALL related functions.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&lt;/span&gt;&lt;span&gt;I&amp;#39;ve tried adding an &amp;#39;interrupt&amp;#39; attribute to various functions in the the function but tit still crashes.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&lt;/span&gt;&lt;span&gt;For now I have to look at alternatives.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&lt;/span&gt;&lt;span&gt;&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: enabaling uart on nrf52840  causes soft device failure</title><link>https://devzone.nordicsemi.com/thread/183192?ContentTypeID=1</link><pubDate>Tue, 23 Apr 2019 15:09:20 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:7f6278dc-4f79-439f-a76c-896379ce0c91</guid><dc:creator>Einar Thorsrud</dc:creator><description>&lt;p&gt;OK.&amp;nbsp;So what is the root problem?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: enabaling uart on nrf52840  causes soft device failure</title><link>https://devzone.nordicsemi.com/thread/183181?ContentTypeID=1</link><pubDate>Tue, 23 Apr 2019 14:45:35 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:0f0f7126-6bdd-4469-a3f0-8958e12f0952</guid><dc:creator>m2800</dc:creator><description>&lt;p&gt;Adding the UART did not cause the soft device problem.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;The problems were caused by using the UART in the instrumentation functions&amp;nbsp;&lt;span&gt;__cyg_profile_func_enter and&amp;nbsp;__cyg_profile_func_exit.&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: enabaling uart on nrf52840  causes soft device failure</title><link>https://devzone.nordicsemi.com/thread/183140?ContentTypeID=1</link><pubDate>Tue, 23 Apr 2019 13:28:07 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:bb9fd4eb-8c4f-470d-8613-e2a1efea4717</guid><dc:creator>Einar Thorsrud</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;I do not see any reason why initializing UART should have any effect on the SoftDevice. Do you do anything other than initializing the UART, or is that the only difference? Can you show us code demonstrating both cases?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: enabaling uart on nrf52840  causes soft device failure</title><link>https://devzone.nordicsemi.com/thread/182826?ContentTypeID=1</link><pubDate>Fri, 19 Apr 2019 15:45:08 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:d665327f-e151-4576-9125-1d2d55c301ad</guid><dc:creator>m2800</dc:creator><description>&lt;p&gt;The debugger and logging showed literally *nothing*.&amp;nbsp; One execution run showed the following:&lt;/p&gt;
&lt;p&gt;The system is halted.&lt;/p&gt;
&lt;p&gt;The debugger displays &amp;#39;Unknown function at 0x0000978&lt;/p&gt;
&lt;p&gt;If I hit GO (F5) the system then displays&lt;/p&gt;
&lt;p&gt;&amp;lt;error&amp;gt; app: SOFTDEVICE: ASSERTION FAILED&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;UPDATE&lt;/p&gt;
&lt;p&gt;I&amp;#39;ve isolated the problem.&amp;nbsp; For main.c, Options, Code Generation, &amp;#39;Instrument Functions is enabled. I am trying to output data to the UART in the instrumentation calls.&lt;/p&gt;
&lt;p&gt;GCC Instrumentation adds a call to&amp;nbsp;__cyg_profile_func_enter and&amp;nbsp;__cyg_profile_func_exit at the entrance to and exit from every function, respectively.&lt;/p&gt;
&lt;p&gt;This is the code that was added to test instrumentation:&lt;/p&gt;
&lt;p&gt;void main_constructor(void) __attribute__ ((no_instrument_function, constructor));&lt;/p&gt;
&lt;p&gt;void main_destructor(void) __attribute__ ((no_instrument_function, destructor));&lt;/p&gt;
&lt;p&gt;void __cyg_profile_func_enter(void *, void *) __attribute__ ((no_instrument_function));&lt;/p&gt;
&lt;p&gt;void __cyg_profile_func_exit(void *, void *) __attribute__ ((no_instrument_function));&lt;/p&gt;
&lt;p&gt;void __cyg_profile_func_enter(void *this, void *callsite)&lt;br /&gt;{&lt;br /&gt; UART_Char_Out(&amp;#39;X&amp;#39;);&lt;br /&gt;}&lt;/p&gt;
&lt;p&gt;void __cyg_profile_func_exit(void *this, void *callsite)&lt;br /&gt;{&lt;br /&gt; UART_Char_Out(&amp;#39;X&amp;#39;);&lt;br /&gt;}&amp;nbsp;&lt;/p&gt;
&lt;p&gt;I haven&amp;#39;t check the assembler output yet but&amp;nbsp; it would appear that hardware context is not sufficiently saved and restored. This would account for the different and seemingly random errors.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: enabaling uart on nrf52840  causes soft device failure</title><link>https://devzone.nordicsemi.com/thread/182773?ContentTypeID=1</link><pubDate>Thu, 18 Apr 2019 20:15:35 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:174cea33-27ed-4f2b-a181-e94f41632c31</guid><dc:creator>awneil</dc:creator><description>&lt;p&gt;Do you have the RTT logs enabled? Do they show any messages?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>