<?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 Processor Expert FreeScaleCAN - Any ISR problems? in CodeWarrior for MCU</title>
    <link>https://community.nxp.com/t5/CodeWarrior-for-MCU/Processor-Expert-FreeScaleCAN-Any-ISR-problems/m-p/168764#M5093</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;CW 4,7 PE 2.99 and FreeScaleCAN bean, for HCS12XEP100.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have problems with the bean and the SendFrame procedure.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;If SendFrame is called while interrupts are disabled,&lt;/P&gt;&lt;P&gt;and immediately reenabled then it seems something goes wrong,&lt;/P&gt;&lt;P&gt;as interrupts remain disabled.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Example:&lt;/P&gt;&lt;P&gt;EnterCriticalSection(); // Borrowed literally from PE&lt;/P&gt;&lt;P&gt;SendFrame(....);&lt;/P&gt;&lt;P&gt;ExitCriticalSection(); // Borrowed literally from PE&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Without the CriticlSection code all works.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Perhaps my explanation is vague or not correct,&lt;/P&gt;&lt;P&gt;but this is more or less how I interpret the situation.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Background: The Tx procedure must be called from ISR and non ISR code.&lt;/P&gt;&lt;P&gt;To prevent reentrancy problems I need to disable interrupts while the it runs and then&lt;/P&gt;&lt;P&gt;restore the interrupt mask to whatever it was before it was disabled on entry.&lt;/P&gt;&lt;P&gt;This is where it all crashes, and I have isolated the problem to SendFrame.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Are there any related interrupt issues with SendFrame?&lt;/P&gt;&lt;P&gt;Alla ideas welcome.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Anders J&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 10 Dec 2010 18:36:00 GMT</pubDate>
    <dc:creator>AndersJ</dc:creator>
    <dc:date>2010-12-10T18:36:00Z</dc:date>
    <item>
      <title>Processor Expert FreeScaleCAN - Any ISR problems?</title>
      <link>https://community.nxp.com/t5/CodeWarrior-for-MCU/Processor-Expert-FreeScaleCAN-Any-ISR-problems/m-p/168764#M5093</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;CW 4,7 PE 2.99 and FreeScaleCAN bean, for HCS12XEP100.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have problems with the bean and the SendFrame procedure.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;If SendFrame is called while interrupts are disabled,&lt;/P&gt;&lt;P&gt;and immediately reenabled then it seems something goes wrong,&lt;/P&gt;&lt;P&gt;as interrupts remain disabled.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Example:&lt;/P&gt;&lt;P&gt;EnterCriticalSection(); // Borrowed literally from PE&lt;/P&gt;&lt;P&gt;SendFrame(....);&lt;/P&gt;&lt;P&gt;ExitCriticalSection(); // Borrowed literally from PE&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Without the CriticlSection code all works.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Perhaps my explanation is vague or not correct,&lt;/P&gt;&lt;P&gt;but this is more or less how I interpret the situation.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Background: The Tx procedure must be called from ISR and non ISR code.&lt;/P&gt;&lt;P&gt;To prevent reentrancy problems I need to disable interrupts while the it runs and then&lt;/P&gt;&lt;P&gt;restore the interrupt mask to whatever it was before it was disabled on entry.&lt;/P&gt;&lt;P&gt;This is where it all crashes, and I have isolated the problem to SendFrame.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Are there any related interrupt issues with SendFrame?&lt;/P&gt;&lt;P&gt;Alla ideas welcome.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Anders J&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 10 Dec 2010 18:36:00 GMT</pubDate>
      <guid>https://community.nxp.com/t5/CodeWarrior-for-MCU/Processor-Expert-FreeScaleCAN-Any-ISR-problems/m-p/168764#M5093</guid>
      <dc:creator>AndersJ</dc:creator>
      <dc:date>2010-12-10T18:36:00Z</dc:date>
    </item>
    <item>
      <title>Re: Processor Expert FreeScaleCAN - Any ISR problems?</title>
      <link>https://community.nxp.com/t5/CodeWarrior-for-MCU/Processor-Expert-FreeScaleCAN-Any-ISR-problems/m-p/168765#M5094</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Resolved.&lt;/P&gt;&lt;P&gt;PE Critical section macros cannot be nested.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 14 Dec 2010 03:17:22 GMT</pubDate>
      <guid>https://community.nxp.com/t5/CodeWarrior-for-MCU/Processor-Expert-FreeScaleCAN-Any-ISR-problems/m-p/168765#M5094</guid>
      <dc:creator>AndersJ</dc:creator>
      <dc:date>2010-12-14T03:17:22Z</dc:date>
    </item>
  </channel>
</rss>

