<?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>ColdFire/68K Microcontrollers and ProcessorsのトピックRe: how to fix &amp;quot;format error&amp;quot; due to improper stack frame?</title>
    <link>https://community.nxp.com/t5/ColdFire-68K-Microcontrollers/how-to-fix-quot-format-error-quot-due-to-improper-stack-frame/m-p/139027#M2119</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;DIV&gt;&lt;/DIV&gt;&lt;DIV&gt;Hi&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;You give us very little information (cpu, compiler, is your code C or assembler, ...) but I can give you some information.&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;Look in the Coldfire Programmer's Reference Manual, chapter 11, section 11.1.2. This gives you details of the exception stack frame. When the CPU executes the RTE instruction it will expect this frame to be on the stack. The Format exception means that the format field is incorrect.&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;Are you trying to write an exception (interrupt) handler in assembler? If so, when the interrupt occurs, the CPU will create a correct exception frame on the stack and it will then jump to your exception handler. Or maybe you are trying to write some code that may not be called by the Interrupt module but you have to return with RTE?&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;Please give some more details.&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;Paul.&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;Edit: spelling.&lt;/DIV&gt;&lt;BR /&gt;&lt;BR /&gt;Message Edited by mccp on &lt;SPAN class="date_text"&gt;2007-07-04&lt;/SPAN&gt; &lt;SPAN class="time_text"&gt;09:18 AM&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 04 Jul 2007 15:17:04 GMT</pubDate>
    <dc:creator>mccPaul</dc:creator>
    <dc:date>2007-07-04T15:17:04Z</dc:date>
    <item>
      <title>how to fix "format error" due to improper stack frame?</title>
      <link>https://community.nxp.com/t5/ColdFire-68K-Microcontrollers/how-to-fix-quot-format-error-quot-due-to-improper-stack-frame/m-p/139026#M2118</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;DIV&gt;Hello,&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;I need the timer to interrupt currently running subroutine and switch it to another. I change the SR and PC before I call RTE in the stack. In the manual it is says that before RTE is called the stack should look like :&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;SR&amp;nbsp; &amp;lt;- 4bytes&lt;/DIV&gt;&lt;DIV&gt;PC &amp;lt;-- 4bytes&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;but when I test it the stack pointer is misaligned by 8 bytes and it gives me error "fromat error"&lt;/DIV&gt;&lt;DIV&gt;Could anyone please help and tell me how RTE works and what I need to change to get my program to work properly?&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;Thank you very much.&lt;/DIV&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 04 Jul 2007 10:32:32 GMT</pubDate>
      <guid>https://community.nxp.com/t5/ColdFire-68K-Microcontrollers/how-to-fix-quot-format-error-quot-due-to-improper-stack-frame/m-p/139026#M2118</guid>
      <dc:creator>vskarine</dc:creator>
      <dc:date>2007-07-04T10:32:32Z</dc:date>
    </item>
    <item>
      <title>Re: how to fix "format error" due to improper stack frame?</title>
      <link>https://community.nxp.com/t5/ColdFire-68K-Microcontrollers/how-to-fix-quot-format-error-quot-due-to-improper-stack-frame/m-p/139027#M2119</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;DIV&gt;&lt;/DIV&gt;&lt;DIV&gt;Hi&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;You give us very little information (cpu, compiler, is your code C or assembler, ...) but I can give you some information.&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;Look in the Coldfire Programmer's Reference Manual, chapter 11, section 11.1.2. This gives you details of the exception stack frame. When the CPU executes the RTE instruction it will expect this frame to be on the stack. The Format exception means that the format field is incorrect.&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;Are you trying to write an exception (interrupt) handler in assembler? If so, when the interrupt occurs, the CPU will create a correct exception frame on the stack and it will then jump to your exception handler. Or maybe you are trying to write some code that may not be called by the Interrupt module but you have to return with RTE?&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;Please give some more details.&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;Paul.&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;Edit: spelling.&lt;/DIV&gt;&lt;BR /&gt;&lt;BR /&gt;Message Edited by mccp on &lt;SPAN class="date_text"&gt;2007-07-04&lt;/SPAN&gt; &lt;SPAN class="time_text"&gt;09:18 AM&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 04 Jul 2007 15:17:04 GMT</pubDate>
      <guid>https://community.nxp.com/t5/ColdFire-68K-Microcontrollers/how-to-fix-quot-format-error-quot-due-to-improper-stack-frame/m-p/139027#M2119</guid>
      <dc:creator>mccPaul</dc:creator>
      <dc:date>2007-07-04T15:17:04Z</dc:date>
    </item>
  </channel>
</rss>

