<?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 Memory exception when writing to Quicc Engine User PRAM in CodeWarrior for StarCore</title>
    <link>https://community.nxp.com/t5/CodeWarrior-for-StarCore/Memory-exception-when-writing-to-Quicc-Engine-User-PRAM/m-p/271799#M433</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi&lt;/P&gt;&lt;P style="min- padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Hopefully I am posting this to the correct area.&lt;/P&gt;&lt;P style="min- padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am modifying a single core network driver to one that will service all cores for the MSC8156 (running on a MSC8156EVM).&amp;nbsp; This driver is used on another OS (i.e. not SmartDSP)&lt;/P&gt;&lt;P style="min- padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have setup the registers on the quicc engine to allow for 6 Tx and Rx queues (i.e. one per core).&amp;nbsp; The receive side appears to be working as expected however I have a slight issue with the Tx side.&lt;/P&gt;&lt;P&gt;I place the data into the buffer and set the BD up and then when I come to increment the CPU counter in the scheduler I get an exception (0x158 - DMMUAE).&lt;/P&gt;&lt;P style="min- padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The M_DVA register indicates that it is the correct location within the Multi User RAM of the Quicc Engine (0xFEE1BD20) but the M_DSR specifies&lt;/P&gt;&lt;P&gt;"A data access does not match an enabled data segment descriptor"&lt;/P&gt;&lt;P style="min- padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The line of code and the asemmbler is below&lt;/P&gt;&lt;P style="min- padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;DIV class="j-rte-table"&gt;&lt;TABLE&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD style=""&gt;1410&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/TD&gt;&lt;TD style=""&gt;(*(driver_info-&amp;gt;tx_packet_CPU_Counter))++;&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;/DIV&gt;&lt;P&gt;c0002760:&amp;nbsp;&amp;nbsp; move.w #$38,r2&lt;/P&gt;&lt;P&gt;c0002762:&amp;nbsp;&amp;nbsp; move.l (sp-$24),r3&lt;/P&gt;&lt;P&gt;c0002764:&amp;nbsp;&amp;nbsp; adda r3,r2&lt;/P&gt;&lt;P&gt;c0002766:&amp;nbsp;&amp;nbsp; move.l r2,(sp-$20)&lt;/P&gt;&lt;P&gt;c0002768:&amp;nbsp;&amp;nbsp; move.l (sp-$20),r4&lt;/P&gt;&lt;P&gt;c000276a:&amp;nbsp;&amp;nbsp; move.l (r4),d0&lt;/P&gt;&lt;P&gt;c000276c:&amp;nbsp;&amp;nbsp; move.l d0,(sp-$20)&lt;/P&gt;&lt;P&gt;c000276e:&amp;nbsp;&amp;nbsp; [ move.l (sp-$20),r1&amp;nbsp;&amp;nbsp; syncio&amp;nbsp; ]&lt;/P&gt;&lt;P&gt;c0002774:&amp;nbsp;&amp;nbsp; [ moveu.w (r1),d1&amp;nbsp;&amp;nbsp; syncio&amp;nbsp; ] &amp;lt;-- Exception&lt;/P&gt;&lt;P style="min- padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have even tried setting it to a value rather than an increment but still get the same result.&lt;/P&gt;&lt;P style="min- padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I believe I have set the registers up as they should.&amp;nbsp; For example if I was to stop the code using the JTAG at the point I should increment the counter and increment it manually using the debugger watch window (or memory window) then the packet is sent out as expected.&lt;/P&gt;&lt;P style="min- padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have tried a few experiments to see when I can write to the MURAM and when I can't.&amp;nbsp; It seems to be in the following order&lt;/P&gt;&lt;P&gt;Write to MURAM causes an exception before a reset command is sent to QE&lt;/P&gt;&lt;P&gt;Write to MURAM is ok (i.e. while I set up all the Eth Structures)&lt;/P&gt;&lt;P&gt;Write to MURAM causes an exception after the Init ENET command&lt;/P&gt;&lt;P style="min- padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Any help would be appreciated as I have drawn a blank.&lt;/P&gt;&lt;P style="min- padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks in advance&lt;/P&gt;&lt;P&gt;Paul&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Original Attachment has been moved to: &lt;A _jive_internal="true" href="https://community.nxp.com/docs/DOC-338717"&gt;exceptionafterincrement.regs.zip&lt;/A&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 03 Mar 2014 11:46:09 GMT</pubDate>
    <dc:creator>shermie</dc:creator>
    <dc:date>2014-03-03T11:46:09Z</dc:date>
    <item>
      <title>Memory exception when writing to Quicc Engine User PRAM</title>
      <link>https://community.nxp.com/t5/CodeWarrior-for-StarCore/Memory-exception-when-writing-to-Quicc-Engine-User-PRAM/m-p/271799#M433</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi&lt;/P&gt;&lt;P style="min- padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Hopefully I am posting this to the correct area.&lt;/P&gt;&lt;P style="min- padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am modifying a single core network driver to one that will service all cores for the MSC8156 (running on a MSC8156EVM).&amp;nbsp; This driver is used on another OS (i.e. not SmartDSP)&lt;/P&gt;&lt;P style="min- padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have setup the registers on the quicc engine to allow for 6 Tx and Rx queues (i.e. one per core).&amp;nbsp; The receive side appears to be working as expected however I have a slight issue with the Tx side.&lt;/P&gt;&lt;P&gt;I place the data into the buffer and set the BD up and then when I come to increment the CPU counter in the scheduler I get an exception (0x158 - DMMUAE).&lt;/P&gt;&lt;P style="min- padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The M_DVA register indicates that it is the correct location within the Multi User RAM of the Quicc Engine (0xFEE1BD20) but the M_DSR specifies&lt;/P&gt;&lt;P&gt;"A data access does not match an enabled data segment descriptor"&lt;/P&gt;&lt;P style="min- padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The line of code and the asemmbler is below&lt;/P&gt;&lt;P style="min- padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;DIV class="j-rte-table"&gt;&lt;TABLE&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD style=""&gt;1410&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/TD&gt;&lt;TD style=""&gt;(*(driver_info-&amp;gt;tx_packet_CPU_Counter))++;&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;/DIV&gt;&lt;P&gt;c0002760:&amp;nbsp;&amp;nbsp; move.w #$38,r2&lt;/P&gt;&lt;P&gt;c0002762:&amp;nbsp;&amp;nbsp; move.l (sp-$24),r3&lt;/P&gt;&lt;P&gt;c0002764:&amp;nbsp;&amp;nbsp; adda r3,r2&lt;/P&gt;&lt;P&gt;c0002766:&amp;nbsp;&amp;nbsp; move.l r2,(sp-$20)&lt;/P&gt;&lt;P&gt;c0002768:&amp;nbsp;&amp;nbsp; move.l (sp-$20),r4&lt;/P&gt;&lt;P&gt;c000276a:&amp;nbsp;&amp;nbsp; move.l (r4),d0&lt;/P&gt;&lt;P&gt;c000276c:&amp;nbsp;&amp;nbsp; move.l d0,(sp-$20)&lt;/P&gt;&lt;P&gt;c000276e:&amp;nbsp;&amp;nbsp; [ move.l (sp-$20),r1&amp;nbsp;&amp;nbsp; syncio&amp;nbsp; ]&lt;/P&gt;&lt;P&gt;c0002774:&amp;nbsp;&amp;nbsp; [ moveu.w (r1),d1&amp;nbsp;&amp;nbsp; syncio&amp;nbsp; ] &amp;lt;-- Exception&lt;/P&gt;&lt;P style="min- padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have even tried setting it to a value rather than an increment but still get the same result.&lt;/P&gt;&lt;P style="min- padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I believe I have set the registers up as they should.&amp;nbsp; For example if I was to stop the code using the JTAG at the point I should increment the counter and increment it manually using the debugger watch window (or memory window) then the packet is sent out as expected.&lt;/P&gt;&lt;P style="min- padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have tried a few experiments to see when I can write to the MURAM and when I can't.&amp;nbsp; It seems to be in the following order&lt;/P&gt;&lt;P&gt;Write to MURAM causes an exception before a reset command is sent to QE&lt;/P&gt;&lt;P&gt;Write to MURAM is ok (i.e. while I set up all the Eth Structures)&lt;/P&gt;&lt;P&gt;Write to MURAM causes an exception after the Init ENET command&lt;/P&gt;&lt;P style="min- padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Any help would be appreciated as I have drawn a blank.&lt;/P&gt;&lt;P style="min- padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks in advance&lt;/P&gt;&lt;P&gt;Paul&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Original Attachment has been moved to: &lt;A _jive_internal="true" href="https://community.nxp.com/docs/DOC-338717"&gt;exceptionafterincrement.regs.zip&lt;/A&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 03 Mar 2014 11:46:09 GMT</pubDate>
      <guid>https://community.nxp.com/t5/CodeWarrior-for-StarCore/Memory-exception-when-writing-to-Quicc-Engine-User-PRAM/m-p/271799#M433</guid>
      <dc:creator>shermie</dc:creator>
      <dc:date>2014-03-03T11:46:09Z</dc:date>
    </item>
    <item>
      <title>Re: Memory exception when writing to Quicc Engine User PRAM</title>
      <link>https://community.nxp.com/t5/CodeWarrior-for-StarCore/Memory-exception-when-writing-to-Quicc-Engine-User-PRAM/m-p/271800#M434</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Managed to solve the issue.&amp;nbsp; Just incase someone else hits a similar problem and finds this question the answer is below.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The reason is that during certain operations on the QUICC Engine memory the MPE bit in the MMU Control Register needs to be cleared to ensure an exception isn't raised when modifying memory.&amp;nbsp; This bit should be set again once finished.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 19 Mar 2014 08:35:20 GMT</pubDate>
      <guid>https://community.nxp.com/t5/CodeWarrior-for-StarCore/Memory-exception-when-writing-to-Quicc-Engine-User-PRAM/m-p/271800#M434</guid>
      <dc:creator>shermie</dc:creator>
      <dc:date>2014-03-19T08:35:20Z</dc:date>
    </item>
  </channel>
</rss>

