<?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>Commands from phone App are going to the wrong UART in the BLE device - serial UART instead of the radio BLE UART. Debug flies off the stack.</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/89301/commands-from-phone-app-are-going-to-the-wrong-uart-in-the-ble-device---serial-uart-instead-of-the-radio-ble-uart-debug-flies-off-the-stack</link><description>Commands sent by phone App to BLE UART end up in serial UART stream. Debug with breakpoint in the uart_event_handle shows NO stack entries, as though it popped out of Main, and ends up in app_error_weak.c, line 100: NRF_BREAKPOINT_COND. 
 UART printf</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Wed, 29 Jun 2022 12:31:04 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/89301/commands-from-phone-app-are-going-to-the-wrong-uart-in-the-ble-device---serial-uart-instead-of-the-radio-ble-uart-debug-flies-off-the-stack" /><item><title>RE: Commands from phone App are going to the wrong UART in the BLE device - serial UART instead of the radio BLE UART. Debug flies off the stack.</title><link>https://devzone.nordicsemi.com/thread/374736?ContentTypeID=1</link><pubDate>Wed, 29 Jun 2022 12:31:04 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:0bb079a1-5caf-47a8-b3c7-25fe5f208c33</guid><dc:creator>Jared</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;The threads that I provided in my previous reply was meant to explain why a Softdevice application asserts after the CPU is halted. I didn&amp;#39;t mean to suggest you to disable interrupts by writing to the PRIMASK register. To be honest, I haven&amp;#39;t really tested this method, so I&amp;#39;m not sure how efficient debug method it is. I usually just move the breakpoint and restart the application after the halting the CPU. Either way, you can write to the PRIMASK register by starting a debug session in µVision and write to the register that is located under System in the register tab in debug view. See the left side of the screenshot.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;img style="max-height:240px;max-width:320px;" src="https://devzone.nordicsemi.com/resized-image/__size/640x480/__key/communityserver-discussions-components-files/4/zzaa.PNG" alt=" " /&gt;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;regards&lt;/p&gt;
&lt;p&gt;Jared&amp;nbsp;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Commands from phone App are going to the wrong UART in the BLE device - serial UART instead of the radio BLE UART. Debug flies off the stack.</title><link>https://devzone.nordicsemi.com/thread/374624?ContentTypeID=1</link><pubDate>Tue, 28 Jun 2022 20:13:17 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:c2fee178-55e5-4a9e-b71f-44d6ee82086f</guid><dc:creator>Steve</dc:creator><description>&lt;p&gt;Jared,&lt;/p&gt;
&lt;p&gt;I think I could really use a clear explanation of the use of&amp;nbsp;&lt;span&gt;setting &amp;#39;the PRIMASK bit&amp;#39; for debugging when using BLE and the SDK. Rather than spend a lot of time reducing the design to minimum to upload, I would rather grok the best debug methods. I&amp;#39;m having trouble finding any documentation on that bit, and reading an ad hoc Q/A thread is not explaining things very well...&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;Is there a more concise and clearly written document for setting and using the PRIMASK bit for debug?&lt;/p&gt;
&lt;p&gt;Is nrf_nvic the right module to look into?&lt;/p&gt;
&lt;p&gt;Does Keil/uVision have the ability to set up macros for setting and clearing the priority mask for the nTeenth time?&lt;/p&gt;
&lt;p&gt;Steve&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Commands from phone App are going to the wrong UART in the BLE device - serial UART instead of the radio BLE UART. Debug flies off the stack.</title><link>https://devzone.nordicsemi.com/thread/374541?ContentTypeID=1</link><pubDate>Tue, 28 Jun 2022 12:42:32 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:d2921c8f-1910-4342-a204-5fbad52ef4aa</guid><dc:creator>Jared</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;Could you provide a minimal example that would reproduce this behavior on a development kit? You can upload your project as a zip. Also, please specify what SDK and Softdevice version that you&amp;#39;re using.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;regards&lt;/p&gt;
&lt;p&gt;Jared&amp;nbsp;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Commands from phone App are going to the wrong UART in the BLE device - serial UART instead of the radio BLE UART. Debug flies off the stack.</title><link>https://devzone.nordicsemi.com/thread/374374?ContentTypeID=1</link><pubDate>Mon, 27 Jun 2022 15:02:51 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:ce26b200-663a-4970-a122-816af543f417</guid><dc:creator>Steve</dc:creator><description>&lt;p&gt;Yes, I am printing received commands in the uart handler, with annotation. But I am getting direct unannotated echoes of the commands sent by the App, and the uart handler is not doing it.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Commands from phone App are going to the wrong UART in the BLE device - serial UART instead of the radio BLE UART. Debug flies off the stack.</title><link>https://devzone.nordicsemi.com/thread/374150?ContentTypeID=1</link><pubDate>Fri, 24 Jun 2022 12:38:23 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:e6c4bef6-18ac-4d65-8840-e444eae288bb</guid><dc:creator>Jared</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
[quote user=""]Commands sent by phone App to BLE UART end up in serial UART stream. &lt;br /&gt;[/quote]
&lt;p&gt;And you&amp;#39;re not printing the received commands from the phone app to UART? I&amp;#39;m not entirely sure I understand what is happening. Could you elaborate a bit more on this?&lt;/p&gt;
[quote user=""]Debug with breakpoint in the uart_event_handle shows NO stack entries, as though it popped out of Main, and ends up in app_error_weak.c, line 100: NRF_BREAKPOINT_COND.[/quote]
&lt;p&gt;Halting the CPU and then resuming it will always throw an error if you&amp;#39;re using the Softdeivce. You would need to restart the entire application between each time it&amp;#39;s paused. See &lt;a href="https://devzone.nordicsemi.com/f/nordic-q-a/9622/application-debug-with-softdevice"&gt;this &lt;/a&gt;and &lt;a href="https://devzone.nordicsemi.com/f/nordic-q-a/17/how-can-i-debug-a-softdevice-application"&gt;this&lt;/a&gt;.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;regards&lt;/p&gt;
&lt;p&gt;Jared&amp;nbsp;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>