<?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>CodeWarrior for MCU中的主题 Re: Local Value Corruption on MPC5675K | Stack pointer alignment</title>
    <link>https://community.nxp.com/t5/CodeWarrior-for-MCU/Local-Value-Corruption-on-MPC5675K-Stack-pointer-alignment/m-p/371286#M11366</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;SPE/SPE2 instructions are described in SPE2PIM document available here:&lt;/P&gt;&lt;P&gt;&lt;A href="http://cache.nxp.com/files/32bit/doc/ref_manual/SPE2PIM.pdf?fpsp=1&amp;amp;WT_TYPE=Reference%20Manuals&amp;amp;WT_VENDOR=FREESCALE&amp;amp;WT_FILE_FORMAT=pdf&amp;amp;WT_ASSET=Documentation&amp;amp;fileExt=.pdf" title="http://cache.nxp.com/files/32bit/doc/ref_manual/SPE2PIM.pdf?fpsp=1&amp;amp;WT_TYPE=Reference%20Manuals&amp;amp;WT_VENDOR=FREESCALE&amp;amp;WT_FILE_FORMAT=pdf&amp;amp;WT_ASSET=Documentation&amp;amp;fileExt=.pdf"&gt;http://cache.nxp.com/files/32bit/doc/ref_manual/SPE2PIM.pdf?fpsp=1&amp;amp;WT_TYPE=Reference%20Manuals&amp;amp;WT_VENDOR=FREESCALE&amp;amp;WT_FI…&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The issue you observe is caused by the fact that&amp;nbsp; R0 has special meaning in most of store instructions - destination address is 0x0 instead of a real register value.&lt;/P&gt;&lt;P&gt;See the instruction description:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="evstdd_instruction.png"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/23285i276730552CEAB520/image-size/large?v=v2&amp;amp;px=999" role="button" title="evstdd_instruction.png" alt="evstdd_instruction.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;So the solution is easy - use other register then R0 as a destination address register&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hope it helps.&lt;/P&gt;&lt;P&gt;Stan&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 17 Mar 2016 16:35:40 GMT</pubDate>
    <dc:creator>stanish</dc:creator>
    <dc:date>2016-03-17T16:35:40Z</dc:date>
    <item>
      <title>Local Value Corruption on MPC5675K | Stack pointer alignment</title>
      <link>https://community.nxp.com/t5/CodeWarrior-for-MCU/Local-Value-Corruption-on-MPC5675K-Stack-pointer-alignment/m-p/371276#M11356</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Greetings,&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;We're running uC/OS-II on the MPC5675K and are facing a few issues in development. We're using CW IDE 10.5&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have two questions in particular and would greatly appreciate if someone can help us debug or resolve the issue. Thanks in advance!&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Question 1&lt;/STRONG&gt;&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;At some points in task execution, we notice that the values of global variables and local variables are not in agreement.&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;For example, as part of the task, we read the global value and store it into the local variable.&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;However, at certain times, we notice that these values are different from each other.&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;We have ensured that non-atomic accesses are not the issue, since we have kept mutexes in place.&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Also, this issue occurs when the system is handling a lot of interrupts (FlexCAN, UART).&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Any pointers on how to debug this?&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Question 2&lt;/STRONG&gt;&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;To comply with the EABI, does the stack pointer need to be 8-byte aligned or 16-byte aligned, for Power e200z760n3?&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Also, depending on that, could someone provide an example on how to correctly set up the stack frame for context switching?&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks once again.&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Any help is much appreciated.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 06 Oct 2014 19:12:31 GMT</pubDate>
      <guid>https://community.nxp.com/t5/CodeWarrior-for-MCU/Local-Value-Corruption-on-MPC5675K-Stack-pointer-alignment/m-p/371276#M11356</guid>
      <dc:creator>dhirajshetty</dc:creator>
      <dc:date>2014-10-06T19:12:31Z</dc:date>
    </item>
    <item>
      <title>Re: Local Value Corruption on MPC5675K | Stack pointer alignment</title>
      <link>https://community.nxp.com/t5/CodeWarrior-for-MCU/Local-Value-Corruption-on-MPC5675K-Stack-pointer-alignment/m-p/371277#M11357</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;regarding Q#1:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If SPE compiler support is enabled the compiler might use o&lt;SPAN style="font-size: 10pt; line-height: 1.5em;"&gt;ptimization which takes advantage of the unused &lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt; line-height: 1.5em;"&gt;high half of the gpr vectors as storage and therefore avoids loading and storing to &lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt; line-height: 1.5em;"&gt;the stack.&lt;/SPAN&gt;&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;SPAN style="font-size: 10pt; line-height: 1.5em;"&gt;It may cause some problems if interrupt prolog/epilog does not save/restore entire 64bit GPRs.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;So it would be worth trying to disable this optimization by pragma below:&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; line-height: 1.5em;"&gt;#pragma spill_to_spe off&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;or you can pass it via command line:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;-pragma "spill_to_spe off"&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Stan&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 08 Oct 2014 13:39:33 GMT</pubDate>
      <guid>https://community.nxp.com/t5/CodeWarrior-for-MCU/Local-Value-Corruption-on-MPC5675K-Stack-pointer-alignment/m-p/371277#M11357</guid>
      <dc:creator>stanish</dc:creator>
      <dc:date>2014-10-08T13:39:33Z</dc:date>
    </item>
    <item>
      <title>Re: Local Value Corruption on MPC5675K | Stack pointer alignment</title>
      <link>https://community.nxp.com/t5/CodeWarrior-for-MCU/Local-Value-Corruption-on-MPC5675K-Stack-pointer-alignment/m-p/371278#M11358</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Stan,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thank you very much for your reply.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;We will try this and update you.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Dhiraj&lt;/STRONG&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 09 Oct 2014 01:33:44 GMT</pubDate>
      <guid>https://community.nxp.com/t5/CodeWarrior-for-MCU/Local-Value-Corruption-on-MPC5675K-Stack-pointer-alignment/m-p/371278#M11358</guid>
      <dc:creator>dhirajshetty</dc:creator>
      <dc:date>2014-10-09T01:33:44Z</dc:date>
    </item>
    <item>
      <title>Re: Local Value Corruption on MPC5675K | Stack pointer alignment</title>
      <link>https://community.nxp.com/t5/CodeWarrior-for-MCU/Local-Value-Corruption-on-MPC5675K-Stack-pointer-alignment/m-p/371279#M11359</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Stan,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Our interrupt prologue/epilogue is saving and restroring the entire 64-bit GPRs.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I took a look at the stack frame defined as part of the "&lt;EM&gt;Stack Frame Requirements&lt;/EM&gt;" under "&lt;EM&gt;Function Calling Sequence&lt;/EM&gt;" in the document &lt;STRONG&gt;Power-Arch-32-bit-ABI-supp-1.0-Embedded&lt;/STRONG&gt; .&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Do you have any suggestions/pointers about the rules to be followed for stack frame population by Interrupt handlers?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Are we expected to adhere to the stack frame requirements mentioned in the above document? Or does it just suffice that we save and restore all the register values, but using a stack frame not as defined by the document above?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks in advance.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 10 Oct 2014 06:55:09 GMT</pubDate>
      <guid>https://community.nxp.com/t5/CodeWarrior-for-MCU/Local-Value-Corruption-on-MPC5675K-Stack-pointer-alignment/m-p/371279#M11359</guid>
      <dc:creator>dhirajshetty</dc:creator>
      <dc:date>2014-10-10T06:55:09Z</dc:date>
    </item>
    <item>
      <title>Re: Re: Local Value Corruption on MPC5675K | Stack pointer alignment</title>
      <link>https://community.nxp.com/t5/CodeWarrior-for-MCU/Local-Value-Corruption-on-MPC5675K-Stack-pointer-alignment/m-p/371280#M11360</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Dhiraj,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Yes, stack frame has to be 16 bytes aligned.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You can inspire by the interrupt prologue/epilogue generated by the compiler:&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;;&amp;nbsp;&amp;nbsp; 13:&amp;nbsp; &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;;&amp;nbsp;&amp;nbsp; 14: __declspec(interrupt)&amp;nbsp; &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;;&amp;nbsp;&amp;nbsp; 15: void TestIsr(void)&amp;nbsp; &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;;&amp;nbsp;&amp;nbsp; 16: { &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;//interrupt prolog&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: courier new,courier;"&gt; stwu&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; rsp,-160(rsp) &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: courier new,courier;"&gt; stw&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; r0,36(rsp)&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: courier new,courier;"&gt; mfmsr&amp;nbsp;&amp;nbsp;&amp;nbsp; r0&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: courier new,courier;"&gt; oris&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; r0,r0,0x0200&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: courier new,courier;"&gt; mtmsr&amp;nbsp;&amp;nbsp;&amp;nbsp; r0&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: courier new,courier;"&gt; evmergelohi r0,r0,r0&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: courier new,courier;"&gt; stw&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; r0,32(rsp)&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: courier new,courier;"&gt; mfctr&amp;nbsp;&amp;nbsp;&amp;nbsp; r0&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: courier new,courier;"&gt; stw&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; r0,16(rsp)&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: courier new,courier;"&gt; mfxer&amp;nbsp;&amp;nbsp;&amp;nbsp; r0&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: courier new,courier;"&gt; stw&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; r0,20(rsp)&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: courier new,courier;"&gt; mfcr&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; r0&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: courier new,courier;"&gt; stw&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; r0,24(rsp)&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: courier new,courier;"&gt; mflr&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; r0&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: courier new,courier;"&gt; stw&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; r0,28(rsp)&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: courier new,courier;"&gt; evstdd&amp;nbsp;&amp;nbsp; r3,40(rsp)&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: courier new,courier;"&gt; evstdd&amp;nbsp;&amp;nbsp; r4,48(rsp)&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: courier new,courier;"&gt; evstdd&amp;nbsp;&amp;nbsp; r5,56(rsp)&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: courier new,courier;"&gt; evstdd&amp;nbsp;&amp;nbsp; r6,64(rsp)&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: courier new,courier;"&gt; evstdd&amp;nbsp;&amp;nbsp; r7,72(rsp)&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: courier new,courier;"&gt; evstdd&amp;nbsp;&amp;nbsp; r8,80(rsp)&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: courier new,courier;"&gt; evstdd&amp;nbsp;&amp;nbsp; r9,88(rsp)&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: courier new,courier;"&gt; evstdd&amp;nbsp;&amp;nbsp; r10,96(rsp)&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: courier new,courier;"&gt; evstdd&amp;nbsp;&amp;nbsp; r11,104(rsp)&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: courier new,courier;"&gt; evstdd&amp;nbsp;&amp;nbsp; r12,112(rsp)&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: courier new,courier;"&gt; li&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; r0,152&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: courier new,courier;"&gt; evstddx&amp;nbsp; r31,rsp,r0&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: courier new,courier;"&gt; li&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; r0,144&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: courier new,courier;"&gt; evstddx&amp;nbsp; r30,rsp,r0&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: courier new,courier;"&gt; li&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; r0,136&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: courier new,courier;"&gt; evstddx&amp;nbsp; r29,rsp,r0&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;//...jump to a ISR or execute ISR code here&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;//interrupt epilog&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: courier new,courier;"&gt; li&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; r0,152&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: courier new,courier;"&gt; evlddx&amp;nbsp;&amp;nbsp; r31,rsp,r0&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: courier new,courier;"&gt; li&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; r0,144&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: courier new,courier;"&gt; evlddx&amp;nbsp;&amp;nbsp; r30,rsp,r0&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: courier new,courier;"&gt; li&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; r0,136&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: courier new,courier;"&gt; evlddx&amp;nbsp;&amp;nbsp; r29,rsp,r0&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: courier new,courier;"&gt; evldd&amp;nbsp;&amp;nbsp;&amp;nbsp; r3,40(rsp)&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: courier new,courier;"&gt; evldd&amp;nbsp;&amp;nbsp;&amp;nbsp; r4,48(rsp)&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: courier new,courier;"&gt; evldd&amp;nbsp;&amp;nbsp;&amp;nbsp; r5,56(rsp)&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: courier new,courier;"&gt; evldd&amp;nbsp;&amp;nbsp;&amp;nbsp; r6,64(rsp)&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: courier new,courier;"&gt; evldd&amp;nbsp;&amp;nbsp;&amp;nbsp; r7,72(rsp)&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: courier new,courier;"&gt; evldd&amp;nbsp;&amp;nbsp;&amp;nbsp; r8,80(rsp)&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: courier new,courier;"&gt; evldd&amp;nbsp;&amp;nbsp;&amp;nbsp; r9,88(rsp)&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: courier new,courier;"&gt; evldd&amp;nbsp;&amp;nbsp;&amp;nbsp; r10,96(rsp)&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: courier new,courier;"&gt; evldd&amp;nbsp;&amp;nbsp;&amp;nbsp; r11,104(rsp)&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: courier new,courier;"&gt; evldd&amp;nbsp;&amp;nbsp;&amp;nbsp; r12,112(rsp)&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: courier new,courier;"&gt; lwz&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; r0,16(rsp)&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: courier new,courier;"&gt; mtctr&amp;nbsp;&amp;nbsp;&amp;nbsp; r0&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: courier new,courier;"&gt; lwz&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; r0,20(rsp)&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: courier new,courier;"&gt; mtxer&amp;nbsp;&amp;nbsp;&amp;nbsp; r0&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: courier new,courier;"&gt; lwz&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; r0,24(rsp)&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: courier new,courier;"&gt; mtcrf&amp;nbsp;&amp;nbsp;&amp;nbsp; 0xff,r0&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: courier new,courier;"&gt; lwz&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; r0,28(rsp)&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: courier new,courier;"&gt; mtlr&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; r0&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: courier new,courier;"&gt; evldd&amp;nbsp;&amp;nbsp;&amp;nbsp; r0,32(rsp)&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: courier new,courier;"&gt; addi&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; rsp,rsp,160&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: courier new,courier;"&gt; rfi&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;Hope it helps.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;Stan&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 16 Oct 2014 17:50:43 GMT</pubDate>
      <guid>https://community.nxp.com/t5/CodeWarrior-for-MCU/Local-Value-Corruption-on-MPC5675K-Stack-pointer-alignment/m-p/371280#M11360</guid>
      <dc:creator>stanish</dc:creator>
      <dc:date>2014-10-16T17:50:43Z</dc:date>
    </item>
    <item>
      <title>Re: Local Value Corruption on MPC5675K | Stack pointer alignment</title>
      <link>https://community.nxp.com/t5/CodeWarrior-for-MCU/Local-Value-Corruption-on-MPC5675K-Stack-pointer-alignment/m-p/371281#M11361</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Stan,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks very much for this.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I also tried to let the compiler generate the prolog/epilog for me by using __declspec(interrupt) but I do not see the vector instructions (&lt;SPAN style="color: #3d3d3d; font-family: 'courier new', courier;"&gt;evstdd/&lt;/SPAN&gt;&lt;SPAN style="color: #3d3d3d; font-family: 'courier new', courier;"&gt;evldd&lt;/SPAN&gt;) like yours.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I am seeing se_stw and se_lwz in my compiler generated code.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Any pointers?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks once again.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 29 Oct 2014 18:21:49 GMT</pubDate>
      <guid>https://community.nxp.com/t5/CodeWarrior-for-MCU/Local-Value-Corruption-on-MPC5675K-Stack-pointer-alignment/m-p/371281#M11361</guid>
      <dc:creator>dhirajshetty</dc:creator>
      <dc:date>2014-10-29T18:21:49Z</dc:date>
    </item>
    <item>
      <title>Re: Re: Local Value Corruption on MPC5675K | Stack pointer alignment</title>
      <link>https://community.nxp.com/t5/CodeWarrior-for-MCU/Local-Value-Corruption-on-MPC5675K-Stack-pointer-alignment/m-p/371282#M11362</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Dhiraj,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This prolog/epilog is generated by the compiler automatically e.g. if it detects usage of 64bit SPE&amp;nbsp; vector data type:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE __default_attr="c++" __jive_macro_name="code" class="_jivemacro_uid_1414773267290886 jive_text_macro jive_macro_code" jivemacro_uid="_1414773267290886"&gt;
&lt;P&gt;#include &amp;lt;spe.h&amp;gt;&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;__ev64_opaque__ ev64SaveReg;&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;void test()&lt;/P&gt;
&lt;P&gt;{&lt;/P&gt;
&lt;P&gt;&amp;nbsp; asm("nop");&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/P&gt;
&lt;P&gt;}&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;__declspec(interrupt) &lt;/P&gt;
&lt;P&gt;void TestIsr(void) &lt;/P&gt;
&lt;P&gt;{&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt; ev64SaveReg = __ev_create_u64(0);&amp;nbsp; &lt;/P&gt;
&lt;P&gt; test();&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/P&gt;
&lt;P&gt;}&lt;/P&gt;
&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Stan&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 31 Oct 2014 16:33:43 GMT</pubDate>
      <guid>https://community.nxp.com/t5/CodeWarrior-for-MCU/Local-Value-Corruption-on-MPC5675K-Stack-pointer-alignment/m-p/371282#M11362</guid>
      <dc:creator>stanish</dc:creator>
      <dc:date>2014-10-31T16:33:43Z</dc:date>
    </item>
    <item>
      <title>Re: Local Value Corruption on MPC5675K | Stack pointer alignment</title>
      <link>https://community.nxp.com/t5/CodeWarrior-for-MCU/Local-Value-Corruption-on-MPC5675K-Stack-pointer-alignment/m-p/371283#M11363</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Other option is to declare interrupt routine with "save_spe" option:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;__declspec(interrupt save_spe)&lt;/P&gt;&lt;P&gt;void testIsr()&lt;/P&gt;&lt;P&gt;{&lt;/P&gt;&lt;P&gt;...&lt;/P&gt;&lt;P&gt;}&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Stan&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 03 Nov 2014 10:57:05 GMT</pubDate>
      <guid>https://community.nxp.com/t5/CodeWarrior-for-MCU/Local-Value-Corruption-on-MPC5675K-Stack-pointer-alignment/m-p/371283#M11363</guid>
      <dc:creator>stanish</dc:creator>
      <dc:date>2014-11-03T10:57:05Z</dc:date>
    </item>
    <item>
      <title>Re: Local Value Corruption on MPC5675K | Stack pointer alignment</title>
      <link>https://community.nxp.com/t5/CodeWarrior-for-MCU/Local-Value-Corruption-on-MPC5675K-Stack-pointer-alignment/m-p/371284#M11364</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Stan,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thank you very much for your help and patient support.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;We seemed to have found the problem.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In our ISR Prolog/Epilog, some instructions (e_add2i.) were modifying the state of the Condition Register CR0 just after the interrupt arrived. This effectively changed the task's state from the time that it was interrupted.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;We were then saving the wrong CR value in the task's context.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;So, when we restored the tasks context, maybe it was branching absurdly due to wrong CR0, leading to strange code behaviour.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;After accounting for the CR0 change in our Prolog/Epilog, it looks like the problem seems to have been solved.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Please do let us know what you think about this.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thank you once again for your continued support.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Dhiraj&lt;/STRONG&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 04 Nov 2014 23:49:24 GMT</pubDate>
      <guid>https://community.nxp.com/t5/CodeWarrior-for-MCU/Local-Value-Corruption-on-MPC5675K-Stack-pointer-alignment/m-p/371284#M11364</guid>
      <dc:creator>dhirajshetty</dc:creator>
      <dc:date>2014-11-04T23:49:24Z</dc:date>
    </item>
    <item>
      <title>Re: Local Value Corruption on MPC5675K | Stack pointer alignment</title>
      <link>https://community.nxp.com/t5/CodeWarrior-for-MCU/Local-Value-Corruption-on-MPC5675K-Stack-pointer-alignment/m-p/371285#M11365</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi .Where can I find the manual for the spe instructions like evstdd / evldd. I cannot get evstdd r4, 8(r0) to work when r0 points to memory area.&amp;nbsp; But it passes compiling and linking process.I use MPC5675K evb and booke instruction set.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 13 Mar 2016 08:15:45 GMT</pubDate>
      <guid>https://community.nxp.com/t5/CodeWarrior-for-MCU/Local-Value-Corruption-on-MPC5675K-Stack-pointer-alignment/m-p/371285#M11365</guid>
      <dc:creator>zhouxian</dc:creator>
      <dc:date>2016-03-13T08:15:45Z</dc:date>
    </item>
    <item>
      <title>Re: Local Value Corruption on MPC5675K | Stack pointer alignment</title>
      <link>https://community.nxp.com/t5/CodeWarrior-for-MCU/Local-Value-Corruption-on-MPC5675K-Stack-pointer-alignment/m-p/371286#M11366</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;SPE/SPE2 instructions are described in SPE2PIM document available here:&lt;/P&gt;&lt;P&gt;&lt;A href="http://cache.nxp.com/files/32bit/doc/ref_manual/SPE2PIM.pdf?fpsp=1&amp;amp;WT_TYPE=Reference%20Manuals&amp;amp;WT_VENDOR=FREESCALE&amp;amp;WT_FILE_FORMAT=pdf&amp;amp;WT_ASSET=Documentation&amp;amp;fileExt=.pdf" title="http://cache.nxp.com/files/32bit/doc/ref_manual/SPE2PIM.pdf?fpsp=1&amp;amp;WT_TYPE=Reference%20Manuals&amp;amp;WT_VENDOR=FREESCALE&amp;amp;WT_FILE_FORMAT=pdf&amp;amp;WT_ASSET=Documentation&amp;amp;fileExt=.pdf"&gt;http://cache.nxp.com/files/32bit/doc/ref_manual/SPE2PIM.pdf?fpsp=1&amp;amp;WT_TYPE=Reference%20Manuals&amp;amp;WT_VENDOR=FREESCALE&amp;amp;WT_FI…&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The issue you observe is caused by the fact that&amp;nbsp; R0 has special meaning in most of store instructions - destination address is 0x0 instead of a real register value.&lt;/P&gt;&lt;P&gt;See the instruction description:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="evstdd_instruction.png"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/23285i276730552CEAB520/image-size/large?v=v2&amp;amp;px=999" role="button" title="evstdd_instruction.png" alt="evstdd_instruction.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;So the solution is easy - use other register then R0 as a destination address register&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hope it helps.&lt;/P&gt;&lt;P&gt;Stan&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 17 Mar 2016 16:35:40 GMT</pubDate>
      <guid>https://community.nxp.com/t5/CodeWarrior-for-MCU/Local-Value-Corruption-on-MPC5675K-Stack-pointer-alignment/m-p/371286#M11366</guid>
      <dc:creator>stanish</dc:creator>
      <dc:date>2016-03-17T16:35:40Z</dc:date>
    </item>
  </channel>
</rss>

