<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Unhandled Exception when performing _io_fflush() to UART in MQX Software Solutions</title>
    <link>https://community.nxp.com/t5/MQX-Software-Solutions/Unhandled-Exception-when-performing-io-fflush-to-UART/m-p/234263#M6484</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello panpwr,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;due to not having any fault with the constant string , this gives you a hint about a problem. It dwells in with _io_write parameters.&amp;nbsp; You might pass there address which is stacked and it might get destroyed and fflush still wants to access that address therefore it generates fault.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Please debug the code and check addresses of parameters :smileywink:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If unexpected_isr does not print anything, does your console print anything ,for instance hello world example? Anyway, you dont need a console to find out the cause. There are few threads dedicated to unexpected_isr and how to find out which fault did trigger it. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;MartinK&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 25 Jan 2013 07:11:59 GMT</pubDate>
    <dc:creator>c0170</dc:creator>
    <dc:date>2013-01-25T07:11:59Z</dc:date>
    <item>
      <title>Unhandled Exception when performing _io_fflush() to UART</title>
      <link>https://community.nxp.com/t5/MQX-Software-Solutions/Unhandled-Exception-when-performing-io-fflush-to-UART/m-p/234260#M6481</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I try to sent a short string (4 bytes) to UART, at the following way:&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; line-height: 1.5em;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="line-height: 1.5em; font-size: 10pt;"&gt;_io_write(uart_ch, stream_ptr, stream_len); &lt;SPAN style="color: #ff0000;"&gt;//&amp;lt;== After performing this line, only 2 bytes are actually transffered to UART&lt;/SPAN&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;_io_fflush(uart_ch);&amp;nbsp; &lt;SPAN style="color: #ff0000;"&gt;// &amp;lt;== Unhandled Exception&lt;/SPAN&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I use Keil uVision4 (4.60) IDE. It doesn't matter how I open the UART - it's the same result (either XON_XOFF or NON_BLOCKING modes).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;When I check the debug-&amp;gt;MQX-&amp;gt;Check for errors, I see under "Tasks": &lt;STRONG&gt;"Unhandled Exception"&lt;/STRONG&gt;, the &lt;STRONG&gt;Task ID&lt;/STRONG&gt;, and the &lt;STRONG&gt;Task Descriptor&lt;/STRONG&gt; (by the way - it's not the task that issued the UART write action, but a different task).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;1. Why doesn't it write all the bytes at once?&lt;/P&gt;&lt;P&gt;2. What can cause the "Flush" action to behave like that?&lt;/P&gt;&lt;P&gt;3. What can I do with the exception information? How can I get to the bottom of the problem (I have very little knowledge of MQX debugging...)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks,&lt;BR /&gt;Lior&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN class="mce_paste_marker"&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 23 Jan 2013 08:50:18 GMT</pubDate>
      <guid>https://community.nxp.com/t5/MQX-Software-Solutions/Unhandled-Exception-when-performing-io-fflush-to-UART/m-p/234260#M6481</guid>
      <dc:creator>panpwr</dc:creator>
      <dc:date>2013-01-23T08:50:18Z</dc:date>
    </item>
    <item>
      <title>Re: Unhandled Exception when performing _io_fflush() to UART</title>
      <link>https://community.nxp.com/t5/MQX-Software-Solutions/Unhandled-Exception-when-performing-io-fflush-to-UART/m-p/234261#M6482</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello panpwr,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;please read this thread about unhandled exception : &lt;A href="https://community.nxp.com/thread/104526"&gt;MQX UNHANDLED INTERRUPT&lt;/A&gt; . Function which might help you is&amp;nbsp; &lt;STRONG style=": ; color: #642880; font-size: 10pt;"&gt;_int_install_unexpected_isr&lt;/STRONG&gt;&lt;SPAN style="font-size: 10pt;"&gt;(). Check also MQX reference manual for more information.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt;"&gt; What's your board and which driver do you use (int or polled)? Step into _io_fflush (fio/io_fflush.c. If you skip fflush function, does it invoke unhandled exception as well? &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt;"&gt;Regards,&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt;"&gt;MartinK&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 24 Jan 2013 07:01:12 GMT</pubDate>
      <guid>https://community.nxp.com/t5/MQX-Software-Solutions/Unhandled-Exception-when-performing-io-fflush-to-UART/m-p/234261#M6482</guid>
      <dc:creator>c0170</dc:creator>
      <dc:date>2013-01-24T07:01:12Z</dc:date>
    </item>
    <item>
      <title>Re: Unhandled Exception when performing _io_fflush() to UART</title>
      <link>https://community.nxp.com/t5/MQX-Software-Solutions/Unhandled-Exception-when-performing-io-fflush-to-UART/m-p/234262#M6483</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello Kojto,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have the &lt;STRONG style="font-size: 10pt; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff; color: #642880;"&gt;_int_install_unexpected_isr&lt;/STRONG&gt;&lt;SPAN style="font-size: 10pt; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;()&lt;/SPAN&gt; already installed, but I didn't quite get how can I use it (i.e., nothing is printed to console).&lt;/P&gt;&lt;P&gt;My custom board is based on the TWR-K60D100M. I use interrupt mode. When not using the fflush function, it doesn't oocur, but only on the next writing to UART.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Also, I've found something else, pretty weird - When I write a constant string (not from a variable) to UART (it works fine!), and &lt;STRONG&gt;afterwards&lt;/STRONG&gt; the variable (which didn't work so far) - It suddenly works fine with no exception!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 24 Jan 2013 08:06:11 GMT</pubDate>
      <guid>https://community.nxp.com/t5/MQX-Software-Solutions/Unhandled-Exception-when-performing-io-fflush-to-UART/m-p/234262#M6483</guid>
      <dc:creator>panpwr</dc:creator>
      <dc:date>2013-01-24T08:06:11Z</dc:date>
    </item>
    <item>
      <title>Re: Unhandled Exception when performing _io_fflush() to UART</title>
      <link>https://community.nxp.com/t5/MQX-Software-Solutions/Unhandled-Exception-when-performing-io-fflush-to-UART/m-p/234263#M6484</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello panpwr,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;due to not having any fault with the constant string , this gives you a hint about a problem. It dwells in with _io_write parameters.&amp;nbsp; You might pass there address which is stacked and it might get destroyed and fflush still wants to access that address therefore it generates fault.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Please debug the code and check addresses of parameters :smileywink:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If unexpected_isr does not print anything, does your console print anything ,for instance hello world example? Anyway, you dont need a console to find out the cause. There are few threads dedicated to unexpected_isr and how to find out which fault did trigger it. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;MartinK&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 25 Jan 2013 07:11:59 GMT</pubDate>
      <guid>https://community.nxp.com/t5/MQX-Software-Solutions/Unhandled-Exception-when-performing-io-fflush-to-UART/m-p/234263#M6484</guid>
      <dc:creator>c0170</dc:creator>
      <dc:date>2013-01-25T07:11:59Z</dc:date>
    </item>
    <item>
      <title>Re: Unhandled Exception when performing _io_fflush() to UART</title>
      <link>https://community.nxp.com/t5/MQX-Software-Solutions/Unhandled-Exception-when-performing-io-fflush-to-UART/m-p/234264#M6485</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;After a long assembly level debugging (:smileyshocked:), I've found that the stack pointer of the current task, just before leaving the fflush -&amp;nbsp; points to a an area which is a different task's stack! (though I've used Keil's stack monitor, and haven't seen any shortage of stack memory for this task).&lt;/P&gt;&lt;P&gt;I've enlarged the stack size for this task and the problem went away (I hope it won't appear again in a different location:smileywink:).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Another small question regarding the &lt;SPAN style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;unexpected_isr&lt;/SPAN&gt;:&lt;/P&gt;&lt;P&gt;I do use printf() to print to console - so I would expect to see more information once an exception has been triggered. I must say that I haven't quite got the idea of how to debug such cases with my Keil's uVision (Keil support usually do not support MQX debugging issues....).&lt;/P&gt;&lt;P&gt;Thanks!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 29 Jan 2013 07:29:21 GMT</pubDate>
      <guid>https://community.nxp.com/t5/MQX-Software-Solutions/Unhandled-Exception-when-performing-io-fflush-to-UART/m-p/234264#M6485</guid>
      <dc:creator>panpwr</dc:creator>
      <dc:date>2013-01-29T07:29:21Z</dc:date>
    </item>
  </channel>
</rss>

