<?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>LPCXpresso IDE中的主题 Re: freertos and uart</title>
    <link>https://community.nxp.com/t5/LPCXpresso-IDE/freertos-and-uart/m-p/557209#M14474</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;STRONG&gt;Content originally posted in LPCWare by Polux rsv on Thu Dec 08 14:24:42 MST 2011&lt;/STRONG&gt;&lt;BR /&gt;&lt;SPAN&gt;My e-mail is down. So, here are the files for those interested.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;It is not an example of clarity and coding. :D&amp;nbsp; But it works.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;The gps.c file is still under development, but the others are quite good.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;[ATTACH]625[/ATTACH]&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Angelo&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 16 Jun 2016 00:44:28 GMT</pubDate>
    <dc:creator>lpcware</dc:creator>
    <dc:date>2016-06-16T00:44:28Z</dc:date>
    <item>
      <title>freertos and uart</title>
      <link>https://community.nxp.com/t5/LPCXpresso-IDE/freertos-and-uart/m-p/557199#M14464</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;STRONG&gt;Content originally posted in LPCWare by dragilla on Wed Dec 07 14:16:16 MST 2011&lt;/STRONG&gt;&lt;BR /&gt;&lt;SPAN&gt;Can I have an uart running in interrupt mode and freertos on one device?&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;I tried and got hard fault, some interrupt collision...&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Or maybe I should create a task where I will read uart in polling mode and give it low priority?&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 16 Jun 2016 00:44:22 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPCXpresso-IDE/freertos-and-uart/m-p/557199#M14464</guid>
      <dc:creator>lpcware</dc:creator>
      <dc:date>2016-06-16T00:44:22Z</dc:date>
    </item>
    <item>
      <title>Re: freertos and uart</title>
      <link>https://community.nxp.com/t5/LPCXpresso-IDE/freertos-and-uart/m-p/557200#M14465</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;STRONG&gt;Content originally posted in LPCWare by dragilla on Wed Dec 07 15:18:42 MST 2011&lt;/STRONG&gt;&lt;BR /&gt;&lt;SPAN&gt;Hm, It's the Uart_Init that is causing the hard fault... I think.&lt;/SPAN&gt;&lt;BR /&gt;&lt;TABLE border="1"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD bgcolor="#cacaca"&gt; &lt;PRE&gt;

tcl-freertos Debug [C/C++ MCU Application]
MCU GDB Debugger (12/7/11 11:11 PM) (Suspended)
Thread [1] (Suspended: Signal 'SIGSTOP' received. Description: Stopped (signal).)
11 HardFault_Handler() cr_startup_lpc17.c:301 0x0000027c
10 &amp;lt;signal handler called&amp;gt;()&amp;nbsp; 0xfffffff1
9 xPortPendSVHandler() port.c:224 0x00006ec8
8 &amp;lt;signal handler called&amp;gt;()&amp;nbsp; 0xfffffff1
7 xPortSysTickHandler() port.c:264 0x00006f14
6 &amp;lt;signal handler called&amp;gt;()&amp;nbsp; 0xfffffff9
5 __aeabi_uldivmod()&amp;nbsp; 0x0000963c
4 uart_set_divisors() lpc17xx_uart.c:110 0x000039f4
3 UART_Init() lpc17xx_uart.c:315 0x00003e88
2 setupHardware() main.c:155 0x000045f2
1 main() main.c:637 0x00005eb2
arm-none-eabi-gdb (12/7/11 11:11 PM)
/home/luke/Desktop/moje/work/workspace/tcl-freertos/Debug/tcl-freertos.axf (12/7/11 11:11 PM)
&lt;/PRE&gt; &lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 16 Jun 2016 00:44:23 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPCXpresso-IDE/freertos-and-uart/m-p/557200#M14465</guid>
      <dc:creator>lpcware</dc:creator>
      <dc:date>2016-06-16T00:44:23Z</dc:date>
    </item>
    <item>
      <title>Re: freertos and uart</title>
      <link>https://community.nxp.com/t5/LPCXpresso-IDE/freertos-and-uart/m-p/557201#M14466</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;STRONG&gt;Content originally posted in LPCWare by ArneB on Wed Dec 07 15:31:53 MST 2011&lt;/STRONG&gt;&lt;BR /&gt;&lt;HR /&gt;&lt;SPAN style="color: #0000ff;"&gt;&lt;STRONG&gt;Quote: &lt;/STRONG&gt;&lt;BR /&gt;5 __aeabi_uldivmod()&amp;nbsp; 0x0000963c&lt;/SPAN&gt;&lt;HR /&gt;&lt;SPAN&gt;Divsion by 0 error ?&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 16 Jun 2016 00:44:24 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPCXpresso-IDE/freertos-and-uart/m-p/557201#M14466</guid>
      <dc:creator>lpcware</dc:creator>
      <dc:date>2016-06-16T00:44:24Z</dc:date>
    </item>
    <item>
      <title>Re: freertos and uart</title>
      <link>https://community.nxp.com/t5/LPCXpresso-IDE/freertos-and-uart/m-p/557202#M14467</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;STRONG&gt;Content originally posted in LPCWare by DaveNadler on Wed Dec 07 18:36:54 MST 2011&lt;/STRONG&gt;&lt;BR /&gt;&lt;SPAN&gt;More specifically, division-by-zero at lpc17xx_uart.c:110 ?&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 16 Jun 2016 00:44:24 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPCXpresso-IDE/freertos-and-uart/m-p/557202#M14467</guid>
      <dc:creator>lpcware</dc:creator>
      <dc:date>2016-06-16T00:44:24Z</dc:date>
    </item>
    <item>
      <title>Re: freertos and uart</title>
      <link>https://community.nxp.com/t5/LPCXpresso-IDE/freertos-and-uart/m-p/557203#M14468</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;STRONG&gt;Content originally posted in LPCWare by Rob65 on Thu Dec 08 01:13:35 MST 2011&lt;/STRONG&gt;&lt;BR /&gt;&lt;HR /&gt;&lt;SPAN style="color: #0000ff;"&gt;&lt;STRONG&gt;Quote: dragilla&lt;/STRONG&gt;&lt;BR /&gt;Can I have an uart running in interrupt mode and freertos on one device?&lt;/SPAN&gt;&lt;HR /&gt;&lt;SPAN&gt;Yes you can. I have multiple UARTs running in interrupt mode in my FreeRTOS app.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;HR /&gt;&lt;SPAN style="color: #0000ff;"&gt;&lt;STRONG&gt;Quote: ArneB&lt;/STRONG&gt;&lt;BR /&gt;Divsion by 0 error ?&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;HR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Nope.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Have a look at the first piece of __aeabi_uldivmod():&lt;/SPAN&gt;&lt;BR /&gt;&lt;TABLE border="1"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD bgcolor="#cacaca"&gt; &lt;PRE&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; __aeabi_uldivmod:
00005b16: __aeabi_uldivmod+0&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; movs.w r12, #0
00005b1a: __aeabi_uldivmod+4&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; push {r4, r5, lr}
00005b1c: __aeabi_uldivmod+6&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; movs r4, r3
00005b1e: __aeabi_uldivmod+8&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; bne.n 0x5b66 &amp;lt;ldiv64&amp;gt;
00005b20: __aeabi_uldivmod+10&amp;nbsp;&amp;nbsp;&amp;nbsp; movs r2, r2
00005b22: __aeabi_uldivmod+12&amp;nbsp;&amp;nbsp;&amp;nbsp; beq.n 0x5c04 &amp;lt;ldiv_divzero&amp;gt;
00005b24: __aeabi_uldivmod+14&amp;nbsp;&amp;nbsp;&amp;nbsp; cmp r1, r2
00005b26: __aeabi_uldivmod+16&amp;nbsp;&amp;nbsp;&amp;nbsp; bcc.n 0x5b36 &amp;lt;ldiv32&amp;gt;
00005b28: __aeabi_uldivmod+18&amp;nbsp;&amp;nbsp;&amp;nbsp; mov r5, r0
00005b2a: __aeabi_uldivmod+20&amp;nbsp;&amp;nbsp;&amp;nbsp; mov r0, r1
00005b2c: __aeabi_uldivmod+22&amp;nbsp;&amp;nbsp;&amp;nbsp; movs r1, #0
00005b2e: __aeabi_uldivmod+24&amp;nbsp;&amp;nbsp;&amp;nbsp; bl 0x5c10 &amp;lt;udiv6432&amp;gt;
&lt;/PRE&gt; &lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;SPAN&gt;The code is trying to do a division of r1.r0 by r3.r2 (both 64 bit numbers).&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;The first check is to see if r3 is zero. If it is, ldiv32 is used to do an r1.r0/r2&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;The second check is to see if r2 is zero. If it is, the jump to ldiv_divzero just sets the result to 0.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;So there is no division by zero interrupt at all.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;This results in the same behavior as the uldiv instruction: a div by zero just results in a zero result.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Also, there are more lines above the uldivmod() (xPortSysTickHandler and xPostPendSVhandler) that point me in the direction of FreeRTOS as the target of the hardfault.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Please note that I am writing [I]target[/I] of the fault, not the [I]source[/I] of the fault ...&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;The source of the fault is most likely within your own application. You could try to use the OpenRTOS Viewer to have a look at your task structures. It is most likely that you will see that you have a stack overflow on your task resulting in a corrupt entry in the task table. &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Please have a look at [U]&lt;/SPAN&gt;&lt;A href="http://http://bikealive.nl/index.php/debugging-freertos.html" rel="nofollow noopener noreferrer" target="_blank"&gt;this page&lt;/A&gt;&lt;SPAN&gt;[/U], it contains some hints on how to use the OpenRTOS Viewer and locating the fault.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Only after :rolleyes: having seen this, enlarge your stack size and test again.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Regards,[INDENT]Rob&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;[/INDENT]&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 16 Jun 2016 00:44:25 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPCXpresso-IDE/freertos-and-uart/m-p/557203#M14468</guid>
      <dc:creator>lpcware</dc:creator>
      <dc:date>2016-06-16T00:44:25Z</dc:date>
    </item>
    <item>
      <title>Re: freertos and uart</title>
      <link>https://community.nxp.com/t5/LPCXpresso-IDE/freertos-and-uart/m-p/557204#M14469</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;STRONG&gt;Content originally posted in LPCWare by dragilla on Thu Dec 08 02:10:26 MST 2011&lt;/STRONG&gt;&lt;BR /&gt;&lt;SPAN&gt;Only this error occurs before I even create tasks. It's just a call to uart_init at almost the beginning of my main function. And it is a working code copied from my non-freertos app.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 16 Jun 2016 00:44:25 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPCXpresso-IDE/freertos-and-uart/m-p/557204#M14469</guid>
      <dc:creator>lpcware</dc:creator>
      <dc:date>2016-06-16T00:44:25Z</dc:date>
    </item>
    <item>
      <title>Re: freertos and uart</title>
      <link>https://community.nxp.com/t5/LPCXpresso-IDE/freertos-and-uart/m-p/557205#M14470</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;STRONG&gt;Content originally posted in LPCWare by Rob65 on Thu Dec 08 02:17:23 MST 2011&lt;/STRONG&gt;&lt;BR /&gt;&lt;SPAN&gt;Then there is a problem with the order of initialization.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;I see that the xPortSysTickHandler is being called.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;This handler call vTaskIncrementTick() (in tasks.c) and this is the part of the FreeRTOS scheduler that checks the tasklists to see if a task switch is needed.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;So you are actually asking the scheduler to check for something that is not yet initialized.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Rob&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 16 Jun 2016 00:44:26 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPCXpresso-IDE/freertos-and-uart/m-p/557205#M14470</guid>
      <dc:creator>lpcware</dc:creator>
      <dc:date>2016-06-16T00:44:26Z</dc:date>
    </item>
    <item>
      <title>Re: freertos and uart</title>
      <link>https://community.nxp.com/t5/LPCXpresso-IDE/freertos-and-uart/m-p/557206#M14471</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;STRONG&gt;Content originally posted in LPCWare by Rob65 on Thu Dec 08 02:27:28 MST 2011&lt;/STRONG&gt;&lt;BR /&gt;&lt;SPAN&gt;Just checked my app.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;You should not start the SysTick timer.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;This is done by xPortStartScheduler() in port.c after initializing the variables that are needed by FreeRTOS (xPortStartScheduler is called from vTaskStartScheduler).&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;This function then calls prvSetupTimerInterrupt() to program and start the SysTick timer.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 16 Jun 2016 00:44:27 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPCXpresso-IDE/freertos-and-uart/m-p/557206#M14471</guid>
      <dc:creator>lpcware</dc:creator>
      <dc:date>2016-06-16T00:44:27Z</dc:date>
    </item>
    <item>
      <title>Re: freertos and uart</title>
      <link>https://community.nxp.com/t5/LPCXpresso-IDE/freertos-and-uart/m-p/557207#M14472</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;STRONG&gt;Content originally posted in LPCWare by Polux rsv on Thu Dec 08 02:49:23 MST 2011&lt;/STRONG&gt;&lt;BR /&gt;&lt;SPAN&gt;Dragilla, send me again your e-mail address, I will send you my project which is based on Freertos, with uart drivers using interrupts and Freertos to handle transmit and receive buffers .&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Angelo&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 16 Jun 2016 00:44:27 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPCXpresso-IDE/freertos-and-uart/m-p/557207#M14472</guid>
      <dc:creator>lpcware</dc:creator>
      <dc:date>2016-06-16T00:44:27Z</dc:date>
    </item>
    <item>
      <title>Re: freertos and uart</title>
      <link>https://community.nxp.com/t5/LPCXpresso-IDE/freertos-and-uart/m-p/557208#M14473</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;STRONG&gt;Content originally posted in LPCWare by dragilla on Thu Dec 08 04:35:56 MST 2011&lt;/STRONG&gt;&lt;BR /&gt;&lt;SPAN&gt;my_nick at gmail dot com&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;thanks!&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 16 Jun 2016 00:44:28 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPCXpresso-IDE/freertos-and-uart/m-p/557208#M14473</guid>
      <dc:creator>lpcware</dc:creator>
      <dc:date>2016-06-16T00:44:28Z</dc:date>
    </item>
    <item>
      <title>Re: freertos and uart</title>
      <link>https://community.nxp.com/t5/LPCXpresso-IDE/freertos-and-uart/m-p/557209#M14474</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;STRONG&gt;Content originally posted in LPCWare by Polux rsv on Thu Dec 08 14:24:42 MST 2011&lt;/STRONG&gt;&lt;BR /&gt;&lt;SPAN&gt;My e-mail is down. So, here are the files for those interested.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;It is not an example of clarity and coding. :D&amp;nbsp; But it works.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;The gps.c file is still under development, but the others are quite good.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;[ATTACH]625[/ATTACH]&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Angelo&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 16 Jun 2016 00:44:28 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPCXpresso-IDE/freertos-and-uart/m-p/557209#M14474</guid>
      <dc:creator>lpcware</dc:creator>
      <dc:date>2016-06-16T00:44:28Z</dc:date>
    </item>
    <item>
      <title>Re: freertos and uart</title>
      <link>https://community.nxp.com/t5/LPCXpresso-IDE/freertos-and-uart/m-p/557210#M14475</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;STRONG&gt;Content originally posted in LPCWare by dandumit on Wed Aug 19 22:34:01 MST 2015&lt;/STRONG&gt;&lt;BR /&gt;&lt;SPAN&gt;Thank you Polux for example. For me it's relevant and instructive.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;By the way do you have an updated version of serial lib ?&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 16 Jun 2016 00:44:29 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPCXpresso-IDE/freertos-and-uart/m-p/557210#M14475</guid>
      <dc:creator>lpcware</dc:creator>
      <dc:date>2016-06-16T00:44:29Z</dc:date>
    </item>
  </channel>
</rss>

