<?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: CAN data register problem? in S32 Design Studio</title>
    <link>https://community.nxp.com/t5/S32-Design-Studio/CAN-data-register-problem/m-p/953662#M5262</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;First I'd suggest you to switch off compiler optimization if there is any.&lt;/P&gt;&lt;P&gt;Seems there are valid data in the buffer when switch statement is executed since it jumped into a valid switch case.&lt;/P&gt;&lt;P&gt;What is RPM? a variable or a macro?&lt;/P&gt;&lt;P&gt;Is there any interrupt routine transfer running on the background may overwrite Receive_Data variable?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;As a general debug suggestion I'd place a write watchpoint at address Receive_Data[3]. The execution stops at the moment any code is writing to this address.&lt;/P&gt;&lt;P&gt;This may help you to figure out what has changed the buffer.&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="pastedImage_2.png"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/90786i598267B2D06DD2AE/image-size/large?v=v2&amp;amp;px=999" role="button" title="pastedImage_2.png" alt="pastedImage_2.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="pastedImage_3.png"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/90820iAC06251305EFBAD4/image-size/large?v=v2&amp;amp;px=999" role="button" title="pastedImage_3.png" alt="pastedImage_3.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hope it helps.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Stan&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 10 Sep 2019 10:00:21 GMT</pubDate>
    <dc:creator>stanish</dc:creator>
    <dc:date>2019-09-10T10:00:21Z</dc:date>
    <item>
      <title>CAN data register problem?</title>
      <link>https://community.nxp.com/t5/S32-Design-Studio/CAN-data-register-problem/m-p/953661#M5261</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;My program like this:&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="breakpoint.jpg"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/83461iCCE6467411FA874B/image-size/large?v=v2&amp;amp;px=999" role="button" title="breakpoint.jpg" alt="breakpoint.jpg" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;"Check_CAN_MB_Status(0, 0, buffer_status);" is a subprogram what detect if there is new data in the CAN register.&lt;/P&gt;&lt;P&gt;When there is new data,"(buffer_status[0] == NEWDATA) "is true.&lt;/P&gt;&lt;P&gt;"Read_CAN_MB_Data(0, 0, Receive_Data);" is read &lt;SPAN&gt;CAN register&amp;nbsp;&lt;/SPAN&gt;date and save in "&lt;SPAN&gt;Receive_Data".&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Then,I add breakpoint at Switch case 0x0C "RPM_L = RPM &amp;amp; 0x00ff ;"&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;When I transfer data(0x01 0x41 0x0C 0xff 0xff) with CAN.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;The program stops in the right place. but,The&amp;nbsp;variable array"Receive_Data[3]"&amp;nbsp;display 0x00.&lt;/P&gt;&lt;P&gt;What happened with it?&lt;/P&gt;&lt;P&gt;If&amp;nbsp;t&lt;SPAN&gt;he&lt;/SPAN&gt;&lt;SPAN&gt;&amp;nbsp;variable array"&lt;/SPAN&gt;&lt;SPAN&gt;Receive_Data[3]" really is 0x00. Why&amp;nbsp;program stops in there?&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Program execution result :"RPM = 0"&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 06 Sep 2019 03:11:13 GMT</pubDate>
      <guid>https://community.nxp.com/t5/S32-Design-Studio/CAN-data-register-problem/m-p/953661#M5261</guid>
      <dc:creator>pg31321</dc:creator>
      <dc:date>2019-09-06T03:11:13Z</dc:date>
    </item>
    <item>
      <title>Re: CAN data register problem?</title>
      <link>https://community.nxp.com/t5/S32-Design-Studio/CAN-data-register-problem/m-p/953662#M5262</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;First I'd suggest you to switch off compiler optimization if there is any.&lt;/P&gt;&lt;P&gt;Seems there are valid data in the buffer when switch statement is executed since it jumped into a valid switch case.&lt;/P&gt;&lt;P&gt;What is RPM? a variable or a macro?&lt;/P&gt;&lt;P&gt;Is there any interrupt routine transfer running on the background may overwrite Receive_Data variable?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;As a general debug suggestion I'd place a write watchpoint at address Receive_Data[3]. The execution stops at the moment any code is writing to this address.&lt;/P&gt;&lt;P&gt;This may help you to figure out what has changed the buffer.&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="pastedImage_2.png"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/90786i598267B2D06DD2AE/image-size/large?v=v2&amp;amp;px=999" role="button" title="pastedImage_2.png" alt="pastedImage_2.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="pastedImage_3.png"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/90820iAC06251305EFBAD4/image-size/large?v=v2&amp;amp;px=999" role="button" title="pastedImage_3.png" alt="pastedImage_3.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hope it helps.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Stan&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 10 Sep 2019 10:00:21 GMT</pubDate>
      <guid>https://community.nxp.com/t5/S32-Design-Studio/CAN-data-register-problem/m-p/953662#M5262</guid>
      <dc:creator>stanish</dc:creator>
      <dc:date>2019-09-10T10:00:21Z</dc:date>
    </item>
  </channel>
</rss>

