<?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: [MPC574XG] FreeRTOS Port in MPC5xxx</title>
    <link>https://community.nxp.com/t5/MPC5xxx/MPC574XG-FreeRTOS-Port/m-p/659778#M7201</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I think I found the pages in the Reference Manual, are these the "Interrupt definitions" starting from page 2951?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 04 Oct 2016 10:57:38 GMT</pubDate>
    <dc:creator>jack_jones</dc:creator>
    <dc:date>2016-10-04T10:57:38Z</dc:date>
    <item>
      <title>[MPC574XG] FreeRTOS Port</title>
      <link>https://community.nxp.com/t5/MPC5xxx/MPC574XG-FreeRTOS-Port/m-p/659775#M7198</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello community,&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I need task handling and TCP/IP support for my application to run.&lt;/P&gt;&lt;P&gt;Therefore I want to use FreeRTOS. I am aware that there is already a port of FreeRTOS for the MPC57XX which can be downloaded from here: &lt;A _jive_internal="true" href="https://community.nxp.com/external-link.jspa?url=http%3A%2F%2Fwww.nxp.com%2Fproducts%2Fmicrocontrollers-and-processors%2Fpower-architecture-processors%2Fmpc5xxx-5xxx-32-bit-mcus%2Fmpc57xx-mcus%2Fultra-reliable-mcus-for-automotive-industrial-control-and-gateway%3AMPC574xB-C-D-G%3Ffpsp%3D1%26tab%3DDesign_Tools_Tab" rel="nofollow" target="_blank"&gt;MPC574xB/C/D/G|32-bit MCU|Gateway|NXP&lt;/A&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The problem is that this port is not directly usable with the S32 Design Studio.&lt;/P&gt;&lt;P&gt;The port uses own initialization functions (hw_intc.h, hw_pit.h, hw_gpio.h, etc.) and assembler code, which is different from the one in S32.&lt;/P&gt;&lt;P&gt;Nevertheless I managed to get it starting, but the PIT part still makes some problems.&lt;/P&gt;&lt;P&gt;Especially the OS_PlatformInit(). Additionally the prvPortTimerSetup() function in the xPortStartScheduler() in port.c.&lt;/P&gt;&lt;P&gt;If I comment out the OS_PlatformInit() and the prvPortTimerSetup(), I can manage to get one LED up and running as a task. But I guess, as the PIT is not configured, vTaskStartScheduler() cannot change between the tasks.&lt;/P&gt;&lt;P&gt;Here is a screen from the Trace32 Debugger:&lt;span class="lia-inline-image-display-wrapper"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/122290i065B5FF7A62D91B4/image-size/large?v=v2&amp;amp;px=999" title="165197_165197.png" alt="165197_165197.png" /&gt;&lt;/span&gt;&lt;span class="lia-inline-image-display-wrapper"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/1601iD12C68415FA3CB97/image-size/large?v=v2&amp;amp;px=999" title="FreeRTOS-support-in-Trace32-Task-List.png" alt="FreeRTOS-support-in-Trace32-Task-List.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;It would be great, if someone could guide me, how the PIT and the INTC in conjunction must be configured.&lt;/P&gt;&lt;P&gt;An own S32 project for FreeRTOS would of course be very useful.&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Best regards,&lt;/P&gt;&lt;P&gt;Jack&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 28 Sep 2016 13:13:46 GMT</pubDate>
      <guid>https://community.nxp.com/t5/MPC5xxx/MPC574XG-FreeRTOS-Port/m-p/659775#M7198</guid>
      <dc:creator>jack_jones</dc:creator>
      <dc:date>2016-09-28T13:13:46Z</dc:date>
    </item>
    <item>
      <title>Re: [MPC574XG] FreeRTOS Port</title>
      <link>https://community.nxp.com/t5/MPC5xxx/MPC574XG-FreeRTOS-Port/m-p/659776#M7199</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;Check the PIT configuration first.&lt;/P&gt;&lt;P&gt;Is PIT running ?&lt;/P&gt;&lt;P&gt;Is PIT set to request interrupt?&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/2903i6AE0F88337C1E4A3/image-size/large?v=v2&amp;amp;px=999" title="pastedImage_1.png" alt="pastedImage_1.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Verify if your PIT on timeout rise TIF flag.&lt;/P&gt;&lt;P&gt;If all conditions above are met, than check IVOR4 handler.&lt;/P&gt;&lt;P&gt;If you set breakpoint on IVOR4 handler on PIT timeout. Code will jump to IVOR4 handler. This means your interrupt is called properly.&lt;/P&gt;&lt;P&gt;If not check your INTC configuration. Correct IVPR placement and IVOR offset.&lt;/P&gt;&lt;P&gt;Peter&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 03 Oct 2016 11:24:56 GMT</pubDate>
      <guid>https://community.nxp.com/t5/MPC5xxx/MPC574XG-FreeRTOS-Port/m-p/659776#M7199</guid>
      <dc:creator>petervlna</dc:creator>
      <dc:date>2016-10-03T11:24:56Z</dc:date>
    </item>
    <item>
      <title>Re: [MPC574XG] FreeRTOS Port</title>
      <link>https://community.nxp.com/t5/MPC5xxx/MPC574XG-FreeRTOS-Port/m-p/659777#M7200</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hey Peter,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;thank you for your reply.&lt;/P&gt;&lt;P&gt;I got the PIT up and running. The PLL was not correctly configured.&lt;/P&gt;&lt;P&gt;Here is a screen of the configured PIT:&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/2432iD370A39D548BDC47/image-size/large?v=v2&amp;amp;px=999" title="FreeRTOS-PIT-config.png" alt="FreeRTOS-PIT-config.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;The TIF flag will be set on timeout (see screen above).&lt;/P&gt;&lt;P&gt;But now to the breakpoint and IVOR problematic.&lt;/P&gt;&lt;P&gt;The following screen is taken before the interrupt is performed:&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/2464i6E291D0B7D006BE2/image-size/large?v=v2&amp;amp;px=999" title="FreeRTOS-before-interrupt.png" alt="FreeRTOS-before-interrupt.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;The TIF flag is not set, as the timer did not reached 0 until then.&lt;/P&gt;&lt;P&gt;If I want to execute the next line in the program, Trace32 goes into the running mode and everything is blocked.&lt;/P&gt;&lt;P&gt;When I break, the code is at IVOR8 and the TIF flag was set, as can be seen on the next screen:&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/2507i65311E32574E15D9/image-size/large?v=v2&amp;amp;px=999" title="FreeRTOS-at-IVOR8.png" alt="FreeRTOS-at-IVOR8.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;So the code jumps to IVOR8 and not IVOR4. The question is why?&lt;/P&gt;&lt;P&gt;Is IVOR8 the watchdog interrupt? How can FreeRTOS know, that the interrupt happened?&lt;/P&gt;&lt;P&gt;In the Reference Manual I did not find anything about IVOR, is it under the INTC section?&lt;/P&gt;&lt;P&gt;The INTC configuration is the standard configuration from a fresh MPC5748G project.&lt;/P&gt;&lt;P&gt;Thank you again for your help, I hope we can managed to get it working.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Best regards,&lt;/P&gt;&lt;P&gt;Jack&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 04 Oct 2016 08:49:26 GMT</pubDate>
      <guid>https://community.nxp.com/t5/MPC5xxx/MPC574XG-FreeRTOS-Port/m-p/659777#M7200</guid>
      <dc:creator>jack_jones</dc:creator>
      <dc:date>2016-10-04T08:49:26Z</dc:date>
    </item>
    <item>
      <title>Re: [MPC574XG] FreeRTOS Port</title>
      <link>https://community.nxp.com/t5/MPC5xxx/MPC574XG-FreeRTOS-Port/m-p/659778#M7201</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I think I found the pages in the Reference Manual, are these the "Interrupt definitions" starting from page 2951?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 04 Oct 2016 10:57:38 GMT</pubDate>
      <guid>https://community.nxp.com/t5/MPC5xxx/MPC574XG-FreeRTOS-Port/m-p/659778#M7201</guid>
      <dc:creator>jack_jones</dc:creator>
      <dc:date>2016-10-04T10:57:38Z</dc:date>
    </item>
    <item>
      <title>Re: [MPC574XG] FreeRTOS Port</title>
      <link>https://community.nxp.com/t5/MPC5xxx/MPC574XG-FreeRTOS-Port/m-p/659779#M7202</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;IVOR8 is system call interrupt.&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/1922i0B1637D7CCDB1AA3/image-size/large?v=v2&amp;amp;px=999" title="pastedImage_2.png" alt="pastedImage_2.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;Microcontroller doesn't care if FreeRTOS know which interrupt it called.&lt;/P&gt;&lt;P&gt;INTC is hardware, working independantly on SW. SW has to check where the HW is pointing and serve interrupt according to HW event. For more details refer to INTC chapter in reference manual.&lt;/P&gt;&lt;P&gt;IVORx are described of course in core reference manual, as exceptions are part of core.&lt;/P&gt;&lt;P&gt;I suggest you to make simple project as &lt;A href="https://community.nxp.com/docs/DOC-104751"&gt;https://community.nxp.com/docs/DOC-104751&lt;/A&gt;&amp;nbsp; and exclude all OS and additional stuff or just use this example and test it.&lt;/P&gt;&lt;P&gt;Than you will have a good overview on how INTC and exceptions are working on MPC57xx.&lt;/P&gt;&lt;P&gt;Peter&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 04 Oct 2016 11:38:40 GMT</pubDate>
      <guid>https://community.nxp.com/t5/MPC5xxx/MPC574XG-FreeRTOS-Port/m-p/659779#M7202</guid>
      <dc:creator>petervlna</dc:creator>
      <dc:date>2016-10-04T11:38:40Z</dc:date>
    </item>
    <item>
      <title>Re: [MPC574XG] FreeRTOS Port</title>
      <link>https://community.nxp.com/t5/MPC5xxx/MPC574XG-FreeRTOS-Port/m-p/659780#M7203</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Greetings,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I got it up and running.&lt;/P&gt;&lt;P&gt;In the vector.c file the &lt;STRONG&gt;__external_interrupt_handler&lt;/STRONG&gt; for the &lt;STRONG&gt;IVOR4_Handler&lt;/STRONG&gt; and for the system call (IVOR8) the &lt;STRONG&gt;vPortYield&lt;/STRONG&gt; function must be chosen.&lt;/P&gt;&lt;PRE class="language-none"&gt;&lt;CODE&gt;//PPCASMF( e_b&amp;nbsp;&amp;nbsp; IVOR4_Handler );
PPCASMF( e_b&amp;nbsp;&amp;nbsp; __external_interrupt_handler );

//PPCASMF( e_b&amp;nbsp;&amp;nbsp; IVOR8_Vector );
PPCASMF( e_b&amp;nbsp;&amp;nbsp; vPortYield );‍‍‍‍‍
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;Thanks for your help.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Best regards,&lt;/P&gt;&lt;P&gt;Jack&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 06 Oct 2016 14:10:44 GMT</pubDate>
      <guid>https://community.nxp.com/t5/MPC5xxx/MPC574XG-FreeRTOS-Port/m-p/659780#M7203</guid>
      <dc:creator>jack_jones</dc:creator>
      <dc:date>2016-10-06T14:10:44Z</dc:date>
    </item>
  </channel>
</rss>

