<?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>ASSERT message doesn&amp;#39;t get printed over UART while debugging in SEGGER EmbStudio</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/72800/assert-message-doesn-t-get-printed-over-uart-while-debugging-in-segger-embstudio</link><description>Hello, 
 I am currently trying out the assert mechanism of Zephyr. 
 I have added CONFIG_ASSERT=y to my prj.conf file and included &amp;quot; sys/__assert.h &amp;quot; in my main.c . 
 My program looks something like this: 
 
 I am using Putty on my PC to communicate with</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Mon, 22 Mar 2021 15:00:51 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/72800/assert-message-doesn-t-get-printed-over-uart-while-debugging-in-segger-embstudio" /><item><title>RE: ASSERT message doesn't get printed over UART while debugging in SEGGER EmbStudio</title><link>https://devzone.nordicsemi.com/thread/301254?ContentTypeID=1</link><pubDate>Mon, 22 Mar 2021 15:00:51 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:02e84502-5465-4914-a35f-bff01781d4e7</guid><dc:creator>Heidi</dc:creator><description>&lt;dl&gt;
&lt;dd&gt;
&lt;div&gt;&lt;span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;div&gt;
&lt;div&gt;
&lt;div&gt;
&lt;div&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;/dd&gt;
&lt;/dl&gt;
&lt;div&gt;​&lt;/div&gt;
&lt;div&gt;Can you add a printk or similar to the if statement, and see if&amp;nbsp;it gets printed every time?&lt;/div&gt;
&lt;div&gt;&lt;/div&gt;
&lt;div&gt;&lt;/div&gt;
&lt;div&gt;If the assert isn&amp;#39;t being printed, there might be some kind of race condition that triggers it occasionally.&lt;/div&gt;
&lt;div&gt;&lt;/div&gt;
&lt;div&gt;&lt;/div&gt;
&lt;div&gt;You can zip your whole working directory and attach it,&amp;nbsp;and I can try to reproduce what you are seeing and debug it for you.&lt;/div&gt;
&lt;div&gt;&lt;/div&gt;
&lt;dl&gt;
&lt;dt&gt;
&lt;div&gt;&lt;span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;/dt&gt;
&lt;/dl&gt;
&lt;dl&gt;
&lt;dt&gt;
&lt;div&gt;
&lt;div&gt;
&lt;div&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;/dt&gt;
&lt;/dl&gt;
&lt;div&gt;​&lt;/div&gt;
&lt;dl&gt;
&lt;dt&gt;&lt;/dt&gt;
&lt;/dl&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: ASSERT message doesn't get printed over UART while debugging in SEGGER EmbStudio</title><link>https://devzone.nordicsemi.com/thread/300306?ContentTypeID=1</link><pubDate>Wed, 17 Mar 2021 08:24:19 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:aedc6faf-c9d3-4719-be82-f1406e0b98f1</guid><dc:creator>WaStefan</dc:creator><description>&lt;p&gt;Hello Heidi,&lt;/p&gt;
&lt;p&gt;When I use stepwise debugging and step over an __assert() expression, I get the message on my serial monitor.&lt;/p&gt;
&lt;p&gt;But if I let the application run and I still have the debug context open in SEGGER Embedded Studio, I don&amp;#39;t get the assert message.&lt;/p&gt;
&lt;p&gt;If I run the application without any debugging, I get the assert message, but still not every single time.&lt;/p&gt;
&lt;p&gt;It would be nice, if the assert mechanism would provide the message consistently every time an assertion triggers.&lt;/p&gt;
&lt;p&gt;Are there any known issues with the Zephyr assert mechanism?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: ASSERT message doesn't get printed over UART while debugging in SEGGER EmbStudio</title><link>https://devzone.nordicsemi.com/thread/300187?ContentTypeID=1</link><pubDate>Tue, 16 Mar 2021 14:54:05 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:96f5ad4f-ec0c-48c1-b262-8ebb718a24cf</guid><dc:creator>Heidi</dc:creator><description>&lt;p&gt;Hi!&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Are you doing stepwise debugging? That can change the timing of the things happening in the application.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Best regards,&lt;/p&gt;
&lt;p&gt;Heidi&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>