<?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>LPC MicrocontrollersのトピックRe: FreeRTOS on M0 Core</title>
    <link>https://community.nxp.com/t5/LPC-Microcontrollers/FreeRTOS-on-M0-Core/m-p/572455#M18581</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;STRONG&gt;Content originally posted in LPCWare by Flo on Wed Apr 03 06:19:46 MST 2013&lt;/STRONG&gt;&lt;BR /&gt;&lt;SPAN&gt;Hey there,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;i found the problem. So for people having similar issues:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I didn't used the naked attribute for xPortPendSVHandler and the vPortSVCHandler.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;I used:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;void xPortPendSVHandler( void )&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;void vPortSVCHandler( void )&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;instead of:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;void xPortPendSVHandler( void ) __attribute__ (( naked ));&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;void vPortSVCHandler( void ) __attribute__ (( naked ));&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;This caused a additional context switch.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Regards,&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Flo&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 15 Jun 2016 18:55:27 GMT</pubDate>
    <dc:creator>lpcware</dc:creator>
    <dc:date>2016-06-15T18:55:27Z</dc:date>
    <item>
      <title>FreeRTOS on M0 Core</title>
      <link>https://community.nxp.com/t5/LPC-Microcontrollers/FreeRTOS-on-M0-Core/m-p/572454#M18580</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;STRONG&gt;Content originally posted in LPCWare by Flo on Thu Mar 28 09:23:30 MST 2013&lt;/STRONG&gt;&lt;BR /&gt;&lt;SPAN&gt;Hi there,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I would like to use FreeRTOS on the M0-Core in a LPC4357. The development board is a Embedded Artists LPC4357 with the 4,3" LCD-Addon.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;For the development and debugging I use Code Red's Red Suite with the Red Probe+. It looks like the PC runs into the wrong memory area.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;So here's the situation:&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;My aim is a simple task running on the M0-Core, that is able to get delayed.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;I used the LPCOpen FreeRTOS Blinky Example to set up my system. So the M0 Core uses the RIT-Timer to generate the freeRTOS SystemTick, wich is working.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Also the pendSVHandles gets called. The RIT CTRL is configured with 0x0F, so the counter is automatically cleared.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Anyway, after starting the programm my task runs into vTaskDelay(configTICK_RATE_HZ / 6) but than never returns.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Pause the Core ends up at "0xce" Programm Code, but I did not define any code or data there.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;So here is a overview over my memory settings:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Programm Data M4: Flash A&amp;nbsp;&amp;nbsp; at 0x1a000000 - 0x80000&amp;nbsp;&amp;nbsp; Length&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Data Section M4 : SRAM&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; at 0x10000000 - 0x8000&amp;nbsp;&amp;nbsp;&amp;nbsp; Length&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;GUI Data M4&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; : SRAM&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; at 0x28000000 - 0x2000000 Length&amp;nbsp; // Used for emWin GUI&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Program Data M0 : Flash B&amp;nbsp;&amp;nbsp; at 0x1b000000 - 0x80000&amp;nbsp;&amp;nbsp; Length&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Data Section M0 : SRAM&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; at 0x10080000 - 0xa000&amp;nbsp;&amp;nbsp;&amp;nbsp; Length&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I already started to find the location, where something goes wrong.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;It looks like the pendSV-Interrupt doesn't work correct.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;I commented out the Set of the pendSV-Interrupt and the program does not run to 0xce anymore, but &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;my tasks also does not "wake up".&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;However, i also debugged the pendSVHandel (take a look below). As I use ARM GCC i am not able to single step trough the asm code.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;But i was able to re-enter the Handler a lot of times. Deactivating the breakpoint and pause a few seconds later ends up in 0xce again.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;So it looks like there is something wrong with the handler, but i got no clue what could be happening. Espacially because it is the same like the&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;one provided with lpcOpen.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Anyway, here are the Code Sections:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;/* Watch attachment txt-File */&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I can't see any problem with the code, but I have no clue, what could be the cause of the problem. On the M4-Core the the RTOS runs, just using the original SysTick-Timer.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;So is here somebody who sees the problem or could give me a hint.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Greetings,&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Florian&lt;/SPAN&gt;&lt;P&gt;&lt;STRONG&gt;Original Attachment has been moved to: &lt;A _jive_internal="true" href="https://community.nxp.com/docs/DOC-337894"&gt;code_1.txt.zip&lt;/A&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 15 Jun 2016 18:55:26 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPC-Microcontrollers/FreeRTOS-on-M0-Core/m-p/572454#M18580</guid>
      <dc:creator>lpcware</dc:creator>
      <dc:date>2016-06-15T18:55:26Z</dc:date>
    </item>
    <item>
      <title>Re: FreeRTOS on M0 Core</title>
      <link>https://community.nxp.com/t5/LPC-Microcontrollers/FreeRTOS-on-M0-Core/m-p/572455#M18581</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;STRONG&gt;Content originally posted in LPCWare by Flo on Wed Apr 03 06:19:46 MST 2013&lt;/STRONG&gt;&lt;BR /&gt;&lt;SPAN&gt;Hey there,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;i found the problem. So for people having similar issues:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I didn't used the naked attribute for xPortPendSVHandler and the vPortSVCHandler.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;I used:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;void xPortPendSVHandler( void )&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;void vPortSVCHandler( void )&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;instead of:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;void xPortPendSVHandler( void ) __attribute__ (( naked ));&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;void vPortSVCHandler( void ) __attribute__ (( naked ));&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;This caused a additional context switch.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Regards,&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Flo&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 15 Jun 2016 18:55:27 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPC-Microcontrollers/FreeRTOS-on-M0-Core/m-p/572455#M18581</guid>
      <dc:creator>lpcware</dc:creator>
      <dc:date>2016-06-15T18:55:27Z</dc:date>
    </item>
  </channel>
</rss>

