<?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: 5746C core in MPC5xxx</title>
    <link>https://community.nxp.com/t5/MPC5xxx/5746C-core/m-p/1387252#M19897</link>
    <description>&lt;P&gt;could you share your code that works, thx&lt;/P&gt;</description>
    <pubDate>Wed, 15 Dec 2021 10:24:23 GMT</pubDate>
    <dc:creator>cdqwer123</dc:creator>
    <dc:date>2021-12-15T10:24:23Z</dc:date>
    <item>
      <title>5746C core</title>
      <link>https://community.nxp.com/t5/MPC5xxx/5746C-core/m-p/866979#M12766</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello!&lt;/P&gt;&lt;P&gt;I'm currently using a MPC5746C, and i'm trying to startup the second core(z2), but without any success.&lt;/P&gt;&lt;P&gt;The SW application is really simple, as this is just for a demo project.&lt;/P&gt;&lt;P&gt;What I have done so far:&lt;/P&gt;&lt;P&gt;In the startup file for core0, I have the following code in the beginning:&lt;/P&gt;&lt;BLOCKQUOTE class="jive_macro_quote jive-quote jive_text_macro"&gt;&lt;P&gt;; RCHW/ Boot header placement&lt;BR /&gt; .org base ; RCHW location&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;; base is set to&amp;nbsp;0x00FA0000&lt;BR /&gt; .long RCHW_VALUE&amp;nbsp; &amp;nbsp; &amp;nbsp;; This value is set to&amp;nbsp;0x005A0002&lt;BR /&gt; .long _start2 ; CPU2 entry point --&amp;gt;&amp;nbsp;&lt;SPAN style="background-color: #f6f6f6;"&gt;0x00fa4020&lt;/SPAN&gt;&lt;BR /&gt; .long 0&lt;BR /&gt; .long 0&lt;BR /&gt; .long _start ; CPU0 entry point&lt;BR /&gt; .long 0 ;&lt;BR /&gt; .long 0&lt;/P&gt;&lt;P&gt;; Startup code&lt;BR /&gt;_start:&lt;/P&gt;&lt;P&gt;/*A lot of RAM init code and so on...*&lt;/P&gt;&lt;P&gt;e_b&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;main ; Jump to main&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;/*interrupt vectors allocated below*/&lt;/P&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;In main():&lt;/P&gt;&lt;BLOCKQUOTE class="jive_macro_quote jive-quote jive_text_macro"&gt;&lt;P&gt;#define KEY_VALUE1 0x5AF0ul&lt;BR /&gt;#define KEY_VALUE2 0xA50Ful&lt;/P&gt;&lt;P&gt;uint32_t mctl = MC_ME.MCTL.R;&lt;BR /&gt; /* enable core 2 in all modes */&lt;BR /&gt; MC_ME.CCTL3.R = 0x00FE;&lt;BR /&gt; /* Set Start address for core 2: Will reset and start */&lt;BR /&gt; MC_ME.CADDR3.R = (0x00fa4020 &amp;lt;&amp;lt;2) | 0x1;&lt;BR /&gt; MC_ME.MCTL.R = (mctl &amp;amp; 0xffff0000ul) | KEY_VALUE1;&lt;BR /&gt; MC_ME.MCTL.R = (mctl &amp;amp; 0xffff0000ul) | KEY_VALUE2; /* key value 2 always from MCTL */&lt;BR /&gt; while(1)&lt;BR /&gt; {&lt;BR /&gt; }&lt;/P&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;The main code is taken from a example in "S32 Design studio Power Architecture" I donwloaded from NXP.com&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;core2 startup code:&lt;/P&gt;&lt;BLOCKQUOTE class="jive_macro_quote jive-quote jive_text_macro"&gt;&lt;P&gt;.globl _start2&lt;BR /&gt;; Startup code&lt;BR /&gt; .org 0x00fa4020&lt;BR /&gt;_start2:&lt;/P&gt;&lt;P&gt;; Write 8000 dec to 0x40000500 in RAM&lt;BR /&gt;&amp;nbsp; e_li r2,8000&lt;BR /&gt;&amp;nbsp;e_li r3,0x4000&lt;BR /&gt;&amp;nbsp;e_slwi r3,r3,16&lt;BR /&gt;&amp;nbsp;e_add16i r3,r3,0x0500&lt;BR /&gt;&amp;nbsp;se_stw r2,00(r3)&lt;/P&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The main idea about this code:&lt;/P&gt;&lt;P&gt;I want to startup core2, and write a value(8000) to the memory address 0x40000500 ( This address is set to zero in core0's startup code).&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The problem:&lt;/P&gt;&lt;P&gt;When I run this, it seems that core2 does not start up at all, as the address 0x40000500 still is zero after some time.&lt;/P&gt;&lt;P&gt;Or maybe core2 is starting up, but running somewhere else...&lt;/P&gt;&lt;P&gt;I have a breakpoint in core0's _start function, so I don't think that any resets is occurring. The core0s is running as expected, and ends up in my while(1) loop.&lt;/P&gt;&lt;P&gt;I can see&amp;nbsp;the following in the debugger:&lt;/P&gt;&lt;P&gt;Current mode is DRUN&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="pastedImage_7.png"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/76873i72ACDB6E394A268B/image-size/large?v=v2&amp;amp;px=999" role="button" title="pastedImage_7.png" alt="pastedImage_7.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;Both cores seems to be running according to the register:&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="pastedImage_8.png"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/76907i2E673F0BD5AB3F7B/image-size/large?v=v2&amp;amp;px=999" role="button" title="pastedImage_8.png" alt="pastedImage_8.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;The ADDR register is set as I expect:&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="pastedImage_9.png"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/76953i2B67274780728910/image-size/large?v=v2&amp;amp;px=999" role="button" title="pastedImage_9.png" alt="pastedImage_9.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Does someone have any idea what I have forgot?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 11 Jan 2019 07:21:32 GMT</pubDate>
      <guid>https://community.nxp.com/t5/MPC5xxx/5746C-core/m-p/866979#M12766</guid>
      <dc:creator>mattias_back1</dc:creator>
      <dc:date>2019-01-11T07:21:32Z</dc:date>
    </item>
    <item>
      <title>Re: 5746C core</title>
      <link>https://community.nxp.com/t5/MPC5xxx/5746C-core/m-p/866980#M12767</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I solved the issue during the weekend.&lt;/P&gt;&lt;P&gt;The problem was that the startup code for the second core where doing something strange, and made core2 crash.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 14 Jan 2019 05:47:16 GMT</pubDate>
      <guid>https://community.nxp.com/t5/MPC5xxx/5746C-core/m-p/866980#M12767</guid>
      <dc:creator>mattias_back1</dc:creator>
      <dc:date>2019-01-14T05:47:16Z</dc:date>
    </item>
    <item>
      <title>Re: 5746C core</title>
      <link>https://community.nxp.com/t5/MPC5xxx/5746C-core/m-p/1387252#M19897</link>
      <description>&lt;P&gt;could you share your code that works, thx&lt;/P&gt;</description>
      <pubDate>Wed, 15 Dec 2021 10:24:23 GMT</pubDate>
      <guid>https://community.nxp.com/t5/MPC5xxx/5746C-core/m-p/1387252#M19897</guid>
      <dc:creator>cdqwer123</dc:creator>
      <dc:date>2021-12-15T10:24:23Z</dc:date>
    </item>
  </channel>
</rss>

