<?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: MCF52233 DEMO Interrupt Priorities and Levels in ColdFire/68K Microcontrollers and Processors</title>
    <link>https://community.nxp.com/t5/ColdFire-68K-Microcontrollers/MCF52233-DEMO-Interrupt-Priorities-and-Levels/m-p/133854#M1337</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;DIV&gt;&lt;/DIV&gt;I'm using the 52223 Coldfire EVB and 52221 Demo boards. I've noticed that none of the examples I saw used interrupts. Everything including the USB is polled. I does make bringing up a new system that much more challanging for the first timer. I've been able to create interrupts for the PIT.&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 23 May 2007 00:10:55 GMT</pubDate>
    <dc:creator>soccermike</dc:creator>
    <dc:date>2007-05-23T00:10:55Z</dc:date>
    <item>
      <title>MCF52233 DEMO Interrupt Priorities and Levels</title>
      <link>https://community.nxp.com/t5/ColdFire-68K-Microcontrollers/MCF52233-DEMO-Interrupt-Priorities-and-Levels/m-p/133853#M1336</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;I've been working with the DEMO board for a bit now and I've noticed that the code has assigned the same Interrupt Priority and Level to a number of interrupts.&amp;nbsp; This is expressly forbidden according to documentation, see below.&amp;nbsp; I only discovered this after indeed seeing some undefined behaviour with respect to interrupts.&amp;nbsp; This seems like a very elementary mistake as we came across this problem previously for a 5213 ColdFire.&amp;nbsp;&amp;nbsp; Providing unique and non-overlapping level and priority definitions avoided the undefined behaviour in 5213 and I'm hoping same is true of 52233.&amp;nbsp; Has anyone else caught this error?&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;STRONG&gt;&lt;/STRONG&gt;&lt;P align="left"&gt;&lt;STRONG&gt;&lt;SPAN style="font-family: Helvetica-Bold; font-size: 4;"&gt;15.3.6 Interrupt Control Register (ICR&lt;I&gt;&lt;SPAN style="font-family: Helvetica-BoldOblique; font-size: 4;"&gt;nx&lt;/SPAN&gt;&lt;/I&gt;&lt;SPAN style="font-family: Helvetica-Bold; font-size: 4;"&gt;)&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P align="left"&gt;&lt;SPAN style="font-family: 'Times New Roman';"&gt;Each ICR&lt;I&gt;&lt;SPAN style="font-family: 'Times New Roman';"&gt;nx&lt;/SPAN&gt;&lt;/I&gt;&lt;SPAN style="font-family: 'Times New Roman';"&gt;, where&lt;/SPAN&gt; &lt;I&gt;&lt;SPAN style="font-family: 'Times New Roman';"&gt;x&lt;/SPAN&gt;&lt;/I&gt; &lt;SPAN style="font-family: 'Times New Roman';"&gt;equals 1, 2,..., 63, specifies the interrupt level (1–7) and the priority within the level&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P align="left"&gt;&lt;SPAN style="font-family: 'Times New Roman';"&gt;(0–7). All ICR&lt;I&gt;&lt;SPAN style="font-family: 'Times New Roman';"&gt;nx&lt;/SPAN&gt;&lt;/I&gt; &lt;SPAN style="font-family: 'Times New Roman';"&gt;registers can be read, but only ICR&lt;/SPAN&gt;&lt;I&gt;&lt;SPAN style="font-family: 'Times New Roman';"&gt;n&lt;/SPAN&gt;&lt;/I&gt;&lt;SPAN style="font-family: 'Times New Roman';"&gt;8 to ICR&lt;/SPAN&gt;&lt;I&gt;&lt;SPAN style="font-family: 'Times New Roman';"&gt;n&lt;/SPAN&gt;&lt;/I&gt;&lt;SPAN style="font-family: 'Times New Roman';"&gt;63 can be written. It is the responsibility&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P align="left"&gt;&lt;SPAN style="font-family: 'Times New Roman';"&gt;of the software to program the ICR&lt;I&gt;&lt;SPAN style="font-family: 'Times New Roman';"&gt;nx&lt;/SPAN&gt;&lt;/I&gt; &lt;SPAN style="font-family: 'Times New Roman';"&gt;registers with unique and non-overlapping level and priority&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P align="left"&gt;&lt;SPAN style="font-family: 'Times New Roman';"&gt;definitions. Failure to program the ICR&lt;I&gt;&lt;SPAN style="font-family: 'Times New Roman';"&gt;nx&lt;/SPAN&gt;&lt;/I&gt; &lt;SPAN style="font-family: 'Times New Roman';"&gt;registers in this manner can result in undefined behavior. If a&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'Times New Roman';"&gt;specific interrupt request is completely unused, the ICR&lt;I&gt;&lt;SPAN style="font-family: 'Times New Roman';"&gt;nx&lt;/SPAN&gt;&lt;/I&gt; &lt;SPAN style="font-family: 'Times New Roman';"&gt;value can remain in its reset (and disabled) state&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/DIV&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 16 May 2007 20:34:04 GMT</pubDate>
      <guid>https://community.nxp.com/t5/ColdFire-68K-Microcontrollers/MCF52233-DEMO-Interrupt-Priorities-and-Levels/m-p/133853#M1336</guid>
      <dc:creator>jes</dc:creator>
      <dc:date>2007-05-16T20:34:04Z</dc:date>
    </item>
    <item>
      <title>Re: MCF52233 DEMO Interrupt Priorities and Levels</title>
      <link>https://community.nxp.com/t5/ColdFire-68K-Microcontrollers/MCF52233-DEMO-Interrupt-Priorities-and-Levels/m-p/133854#M1337</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;DIV&gt;&lt;/DIV&gt;I'm using the 52223 Coldfire EVB and 52221 Demo boards. I've noticed that none of the examples I saw used interrupts. Everything including the USB is polled. I does make bringing up a new system that much more challanging for the first timer. I've been able to create interrupts for the PIT.&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 23 May 2007 00:10:55 GMT</pubDate>
      <guid>https://community.nxp.com/t5/ColdFire-68K-Microcontrollers/MCF52233-DEMO-Interrupt-Priorities-and-Levels/m-p/133854#M1337</guid>
      <dc:creator>soccermike</dc:creator>
      <dc:date>2007-05-23T00:10:55Z</dc:date>
    </item>
    <item>
      <title>Re: MCF52233 DEMO Interrupt Priorities and Levels</title>
      <link>https://community.nxp.com/t5/ColdFire-68K-Microcontrollers/MCF52233-DEMO-Interrupt-Priorities-and-Levels/m-p/133855#M1338</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;DIV&gt;The FEC uses interrupts and the UART makes accommodations for them but the DEMO defaults to POLLED_UART via a #define.&amp;nbsp;&amp;nbsp; The PIT Timer is also being used.&amp;nbsp; eg. FEC_Init() assigned Priority and Level to 6 for vectors 23 - 36 (ie 0x30 in ICR23-ICR36 registers).&amp;nbsp; Check out - View -&amp;gt; Registers and take a look at ICRx assigned priorities and levels after reset.&amp;nbsp;&amp;nbsp; You'll find many&amp;nbsp;share value 0x18 and 0x30.&amp;nbsp;&amp;nbsp; Why it works at all without generating exceptions with this many non-unique vector priorities/levels is a mystery.&amp;nbsp; I modified the vectors to have unique priorities and levels.&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;I'm still having a bit of trouble with UART interrupts anyway.&amp;nbsp; I modified code to be UART interrupt driven and it works - for the most part.&amp;nbsp; The one remaining problem is an "Illegal Instruction" exception that is generated at reset when I use the DHCP_CLIENT (with some mods) and&amp;nbsp;demo code is&amp;nbsp;spitting out start-up messages via the printf statement.&amp;nbsp; When I get the above exception I can alter the PC to the RTE instruction and do a return from the exception.&amp;nbsp; But the instruction that it returns to is certainly not an illegal instruction.&amp;nbsp; I suspect this 'Undefined behavior' may have something to do with a conflicting&amp;nbsp;interrupt somewhere as I've seen similarly behavior&amp;nbsp;before in the 5213.&amp;nbsp; Or perhaps I'm missing something more obvious.&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;I'd have to say I'm not too pleased with the quality of the DEMO code.&amp;nbsp; Too many 'fixes' and other mods look to have been made to push the demo out the door.&amp;nbsp; Flip what you would think is a simple&amp;nbsp;alternative implementation via a #define and you have to fight your way thru the code to see why it now doesn't work.&amp;nbsp; UART is a good example of that.&amp;nbsp; Other code commented out with no explanation and other places questionable crumbs look to have been left.&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;PS&lt;/DIV&gt;&lt;DIV&gt;(Go AC Milan!&amp;nbsp; No crash and burns like in Istanbul hopefully.)&lt;/DIV&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 23 May 2007 01:46:38 GMT</pubDate>
      <guid>https://community.nxp.com/t5/ColdFire-68K-Microcontrollers/MCF52233-DEMO-Interrupt-Priorities-and-Levels/m-p/133855#M1338</guid>
      <dc:creator>jes</dc:creator>
      <dc:date>2007-05-23T01:46:38Z</dc:date>
    </item>
    <item>
      <title>Re: MCF52233 DEMO Interrupt Priorities and Levels</title>
      <link>https://community.nxp.com/t5/ColdFire-68K-Microcontrollers/MCF52233-DEMO-Interrupt-Priorities-and-Levels/m-p/133856#M1339</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;Thanks for the encouraging and helpful words.&amp;nbsp; We are making progress with many of the subsections.&amp;nbsp; Turns out that we won't have to write much USB code.&amp;nbsp; The example code did nearly everything we needed other than to make it interrupt driven instead of polled.&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;Do you have $50M to help AC Milan sign Henry, Drogba, Eto'o &amp;amp; Emerson.&amp;nbsp; Who would sit on the bench?&lt;BR /&gt;They are going after any name that is standing!&lt;BR /&gt;&lt;DIV&gt;&lt;/DIV&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 15 Jun 2007 01:52:38 GMT</pubDate>
      <guid>https://community.nxp.com/t5/ColdFire-68K-Microcontrollers/MCF52233-DEMO-Interrupt-Priorities-and-Levels/m-p/133856#M1339</guid>
      <dc:creator>soccermike</dc:creator>
      <dc:date>2007-06-15T01:52:38Z</dc:date>
    </item>
    <item>
      <title>Re: MCF52233 DEMO Interrupt Priorities and Levels</title>
      <link>https://community.nxp.com/t5/ColdFire-68K-Microcontrollers/MCF52233-DEMO-Interrupt-Priorities-and-Levels/m-p/133857#M1340</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;DIV&gt;&lt;BR /&gt;&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;BR /&gt;&lt;DIV&gt;I'd have to say I'm not too pleased with the quality of the DEMO code.&amp;nbsp; Too many 'fixes' and other mods look to have been made to push the demo out the door.&amp;nbsp; Flip what you would think is a simple&amp;nbsp;alternative implementation via a #define and you have to fight your way thru the code to see why it now doesn't work.&amp;nbsp; UART is a good example of that.&amp;nbsp; Other code commented out with no explanation and other places questionable crumbs look to have been left.&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;I agree. I call it "EMG considered harmful". The UART code included some support for different logical numbers vs. physical uart numbers, but that was broken when I tried to use it. The heap allocation stuff works but the statistics and debugging code with it is broken. There's a nasty bug in printf where they expand LF to CRLF in some cases but not in others; this will screw you up if you are using sprintf to build a multi-line web response where you need just 1 CR before the LF. I ended up discarding the entire EMG webserver and built a complete replacement.&lt;BR /&gt;&lt;BR /&gt;We see some strange things happening with the ethernet code that are still unresolved. I noticed that they used identical vectors and priorities, but I didn't see an easy way to change it so I haven't fixed that yet.&lt;BR /&gt;&lt;BR /&gt;There's an assembly language ISR (asm_exception_handler) that does not save D2, then calls into C code. Apparently CodeWarrior/Coldfire treats D2 as scratch like D0-D1 and A0-A1, while D2 is preserved by subroutine calls in GNU compiles.&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/DIV&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 16 Jun 2007 03:42:45 GMT</pubDate>
      <guid>https://community.nxp.com/t5/ColdFire-68K-Microcontrollers/MCF52233-DEMO-Interrupt-Priorities-and-Levels/m-p/133857#M1340</guid>
      <dc:creator>bkatt</dc:creator>
      <dc:date>2007-06-16T03:42:45Z</dc:date>
    </item>
  </channel>
</rss>

