<?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: KEAZ128 MSCAN in Kinetis Microcontrollers</title>
    <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/KEAZ128-MSCAN/m-p/1261649#M60201</link>
    <description>&lt;P&gt;Hi&amp;nbsp;&lt;SPAN class=""&gt;&lt;A id="link_12" class="lia-link-navigation lia-page-link lia-user-name-link" href="https://community.nxp.com/t5/user/viewprofilepage/user-id/185413" target="_self"&gt;Roc_Wang&lt;/A&gt;,&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN class=""&gt;&amp;nbsp; I think, it needs to use&amp;nbsp;Check_CAN_MB_Status, this API contains the ABuffer,&amp;nbsp; it should used to check the detail MB situation:&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;err_status = Check_CAN_MB_Status(0, 0, buffer_status);&lt;BR /&gt;while (buffer_status[0] != NEWDATA) //Wait for the Receive ISR to finish and change the buffer status, NEWDATA indicates that the buffer has receive a new data&lt;BR /&gt;{ &lt;BR /&gt;err_status = Check_CAN_MB_Status(0, 0, buffer_status);&lt;BR /&gt;}&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Wish it helps you!&lt;/P&gt;
&lt;P&gt;Best Regards,&lt;/P&gt;
&lt;P&gt;Kerry&lt;/P&gt;</description>
    <pubDate>Wed, 14 Apr 2021 03:23:05 GMT</pubDate>
    <dc:creator>kerryzhou</dc:creator>
    <dc:date>2021-04-14T03:23:05Z</dc:date>
    <item>
      <title>KEAZ128 MSCAN</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/KEAZ128-MSCAN/m-p/1260391#M60156</link>
      <description>Hi NXP, there are some questions when we use the mscan driver "MSCAN_KEA_DEVD". We have configured three MBs to transmit three different messages, after the message has been transimitted successfully ,the TX interrupt will be triggered. How to find which MB triggered the interrupt event in TX IRQ? Check_CAN_MB_Status ?</description>
      <pubDate>Mon, 12 Apr 2021 08:20:20 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/KEAZ128-MSCAN/m-p/1260391#M60156</guid>
      <dc:creator>Roc_Wang</dc:creator>
      <dc:date>2021-04-12T08:20:20Z</dc:date>
    </item>
    <item>
      <title>Re: KEAZ128 MSCAN</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/KEAZ128-MSCAN/m-p/1261119#M60174</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;SPAN&gt;Roc_Wang,&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; As you know, the KEA128 MSCAN TX has 3 MB,&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="kerryzhou_0-1618303148286.png" style="width: 400px;"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/142110iEBB6A0FCBE26C331/image-size/medium?v=v2&amp;amp;px=400" role="button" title="kerryzhou_0-1618303148286.png" alt="kerryzhou_0-1618303148286.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;So, you can use&amp;nbsp;MSCAN_CANTFLG[TXE] to check which MB.&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="kerryzhou_1-1618303213839.png" style="width: 400px;"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/142111iBAC0543052E4896A/image-size/medium?v=v2&amp;amp;px=400" role="button" title="kerryzhou_1-1618303213839.png" alt="kerryzhou_1-1618303213839.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;3bit means 3 related MB.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Wish it helps you!&lt;/P&gt;
&lt;P&gt;If you still have questions about it, please kindly let me know.&lt;/P&gt;
&lt;P&gt;Best Regards,&lt;/P&gt;
&lt;P&gt;Kerry&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 13 Apr 2021 08:40:44 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/KEAZ128-MSCAN/m-p/1261119#M60174</guid>
      <dc:creator>kerryzhou</dc:creator>
      <dc:date>2021-04-13T08:40:44Z</dc:date>
    </item>
    <item>
      <title>Re: KEAZ128 MSCAN</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/KEAZ128-MSCAN/m-p/1261165#M60175</link>
      <description>&lt;P&gt;Hi Kerry,&lt;/P&gt;&lt;P&gt;thank you for your help.&lt;/P&gt;&lt;P&gt;We are using the api function "Transmit_CAN_MB" and "Load_CAN_MB" in MSCAN_KEA_DEVD to transmit messages.&lt;/P&gt;&lt;P&gt;The MB is a data buffer struct defined&amp;nbsp;in MSCAN_KEA_DEVD.&lt;/P&gt;&lt;P&gt;We do not know&amp;nbsp;the&amp;nbsp;&lt;SPAN class="tran"&gt;correspondence&lt;/SPAN&gt;&amp;nbsp;between data buffers and MSCAN transmitter&lt;SPAN&gt;&amp;nbsp;,so can not use MSCAN_CANTFLG[TXE] directly.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;Sorry for the confusing.&lt;/P&gt;&lt;P&gt;Which API can we use ?&lt;/P&gt;</description>
      <pubDate>Tue, 13 Apr 2021 09:33:33 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/KEAZ128-MSCAN/m-p/1261165#M60175</guid>
      <dc:creator>Roc_Wang</dc:creator>
      <dc:date>2021-04-13T09:33:33Z</dc:date>
    </item>
    <item>
      <title>Re: KEAZ128 MSCAN</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/KEAZ128-MSCAN/m-p/1261194#M60176</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;SPAN&gt;Roc_Wang,&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;&amp;nbsp; Please let me know your IDE: CW or S32DS or KDS?&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;&amp;nbsp; Then I will help you to check this driver.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;Best Regards,&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;Kerry&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 13 Apr 2021 10:10:13 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/KEAZ128-MSCAN/m-p/1261194#M60176</guid>
      <dc:creator>kerryzhou</dc:creator>
      <dc:date>2021-04-13T10:10:13Z</dc:date>
    </item>
    <item>
      <title>Re: KEAZ128 MSCAN</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/KEAZ128-MSCAN/m-p/1261588#M60195</link>
      <description>&lt;P&gt;S32DS.&lt;/P&gt;&lt;P&gt;Thank you.&lt;/P&gt;</description>
      <pubDate>Wed, 14 Apr 2021 01:55:30 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/KEAZ128-MSCAN/m-p/1261588#M60195</guid>
      <dc:creator>Roc_Wang</dc:creator>
      <dc:date>2021-04-14T01:55:30Z</dc:date>
    </item>
    <item>
      <title>Re: KEAZ128 MSCAN</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/KEAZ128-MSCAN/m-p/1261649#M60201</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;SPAN class=""&gt;&lt;A id="link_12" class="lia-link-navigation lia-page-link lia-user-name-link" href="https://community.nxp.com/t5/user/viewprofilepage/user-id/185413" target="_self"&gt;Roc_Wang&lt;/A&gt;,&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN class=""&gt;&amp;nbsp; I think, it needs to use&amp;nbsp;Check_CAN_MB_Status, this API contains the ABuffer,&amp;nbsp; it should used to check the detail MB situation:&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;err_status = Check_CAN_MB_Status(0, 0, buffer_status);&lt;BR /&gt;while (buffer_status[0] != NEWDATA) //Wait for the Receive ISR to finish and change the buffer status, NEWDATA indicates that the buffer has receive a new data&lt;BR /&gt;{ &lt;BR /&gt;err_status = Check_CAN_MB_Status(0, 0, buffer_status);&lt;BR /&gt;}&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Wish it helps you!&lt;/P&gt;
&lt;P&gt;Best Regards,&lt;/P&gt;
&lt;P&gt;Kerry&lt;/P&gt;</description>
      <pubDate>Wed, 14 Apr 2021 03:23:05 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/KEAZ128-MSCAN/m-p/1261649#M60201</guid>
      <dc:creator>kerryzhou</dc:creator>
      <dc:date>2021-04-14T03:23:05Z</dc:date>
    </item>
    <item>
      <title>Re: KEAZ128 MSCAN</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/KEAZ128-MSCAN/m-p/1261663#M60202</link>
      <description>&lt;P&gt;Hi Kerry,&lt;/P&gt;&lt;P&gt;thank you for your help.&lt;/P&gt;&lt;P&gt;Yes, the MB situation can be checked by using &lt;SPAN&gt;Check_CAN_MB_Status, w&lt;/SPAN&gt;hen the Data Frame has been transmitted successfully, the status of the Message Buffer changes to TRANSMITTED.&lt;/P&gt;&lt;P&gt;But, how to clear this status ?&amp;nbsp; It always be&amp;nbsp;TRANSMITTED until a new message is loaded into th MB.&lt;/P&gt;</description>
      <pubDate>Wed, 14 Apr 2021 04:06:10 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/KEAZ128-MSCAN/m-p/1261663#M60202</guid>
      <dc:creator>Roc_Wang</dc:creator>
      <dc:date>2021-04-14T04:06:10Z</dc:date>
    </item>
    <item>
      <title>Re: KEAZ128 MSCAN</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/KEAZ128-MSCAN/m-p/1261673#M60203</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;SPAN&gt;Roc_Wang,&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;&amp;nbsp; I think the following code may helps your understanding, I think you can modify the related MB-&amp;gt;status:&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;bufferMode = (MSCANBuffers[AChn_Transformed]+ABuffer)-&amp;gt;Mode;&lt;BR /&gt;bufferStatus = (MSCANBuffers[AChn_Transformed]+ABuffer)-&amp;gt;Status;&lt;/P&gt;
&lt;P&gt;if (!((bufferMode == TXDF) || (bufferMode == TXRF)))&lt;BR /&gt;{&lt;BR /&gt;if (!(CCRcopy))&lt;BR /&gt;{&lt;BR /&gt;CLI; /* restore interrupt mask */&lt;BR /&gt;}&lt;BR /&gt;return (ERR_CONFIG);&lt;BR /&gt;}&lt;/P&gt;
&lt;P&gt;&lt;BR /&gt;if ((bufferMode == TXDF) &amp;amp;&amp;amp; (bufferStatus == NODATA))&lt;BR /&gt;{&lt;BR /&gt;if (!(CCRcopy))&lt;BR /&gt;{&lt;BR /&gt;CLI; /* restore interrupt mask */&lt;BR /&gt;}&lt;BR /&gt;return (ERR_NODATA);&lt;BR /&gt;}&lt;BR /&gt;if ((bufferStatus == QUEUED) /* MB already queued */&lt;BR /&gt;|| (bufferStatus == QUEUED2) &lt;BR /&gt;|| (bufferStatus == ABORTREQ))&lt;BR /&gt;{&lt;BR /&gt;if (!(CCRcopy))&lt;BR /&gt;{&lt;BR /&gt;CLI; /* restore interrupt mask */&lt;BR /&gt;}&lt;BR /&gt;return (ERR_QED);&lt;BR /&gt;}&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;Queue_CAN_MB ( AChn, ABuffer); /* queue buffer, copy to msCAN if buffer available, */&lt;BR /&gt;/* abort msCAN buffer if all full and this buffer higher priority */&lt;/P&gt;
&lt;P&gt;----------&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;You also can check this API:CAN_Transmit&lt;/P&gt;
&lt;P&gt;You can find the related MB clear code:&lt;/P&gt;
&lt;P&gt;else /* transmission completed */&lt;BR /&gt;{&lt;BR /&gt;if ((p_Buffer + buffer)-&amp;gt;Mode == TXRF) /* transmitted remote frame */&lt;BR /&gt;{ &lt;BR /&gt;(p_Buffer + buffer)-&amp;gt;Mode = RXDF; /* receive data frame */&lt;BR /&gt;(p_Buffer + buffer)-&amp;gt;Status = NODATA;&lt;BR /&gt;}&lt;BR /&gt;else /* transmitted Data TXDF or AUTOTXDF */&lt;BR /&gt;{ &lt;BR /&gt;(p_Buffer + buffer)-&amp;gt;Status = TRANSMITTED;&lt;BR /&gt;}&lt;BR /&gt;# if (TIMESTAMP_CAN)&lt;BR /&gt;if (TimeStampOption[AChn_Transformed])&lt;BR /&gt;{&lt;BR /&gt;p-&amp;gt;CANTBSEL.Byte = interruptBufferBit;&lt;BR /&gt;(p_Buffer + buffer)-&amp;gt;BufferTimeStamp_CAN = p-&amp;gt;CANTXTSR.Word; &lt;BR /&gt;}&lt;BR /&gt;# endif&lt;BR /&gt;}&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;You can modify the status to your wanted data.&lt;/P&gt;
&lt;P&gt;Wish it helps you!&lt;/P&gt;
&lt;P&gt;Best Regards,&lt;/P&gt;
&lt;P&gt;Kerry&lt;/P&gt;</description>
      <pubDate>Wed, 14 Apr 2021 04:37:53 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/KEAZ128-MSCAN/m-p/1261673#M60203</guid>
      <dc:creator>kerryzhou</dc:creator>
      <dc:date>2021-04-14T04:37:53Z</dc:date>
    </item>
    <item>
      <title>Re: KEAZ128 MSCAN</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/KEAZ128-MSCAN/m-p/1261681#M60204</link>
      <description>&lt;P&gt;Hi Kerry,&lt;/P&gt;&lt;P&gt;so do you mean there is not an existing API to clear it?&amp;nbsp;&lt;/P&gt;&lt;P&gt;It works normally if I used the code below:&lt;/P&gt;&lt;P&gt;uint8_t liMbSt[2] ;&lt;BR /&gt;/*Tx confirmed*/&lt;BR /&gt;if(MSCAN_CANTFLG &amp;amp; MSCAN_CANTIER)&lt;BR /&gt;{&lt;BR /&gt;&amp;nbsp; CAN_Transmit(0);&lt;BR /&gt;&amp;nbsp; McuAbs_Write_MsCanTransmittedInd(STD_ON);&lt;/P&gt;&lt;P&gt;&amp;nbsp; Check_CAN_MB_Status(0,MSG_BUFFER_ID_DIAG,liMbSt);&lt;BR /&gt;&amp;nbsp; if(TRANSMITTED == liMbSt[0])&lt;BR /&gt;&amp;nbsp; {&lt;BR /&gt;&amp;nbsp; &amp;nbsp; (MSCANBuffers[vChnIdx[0]]+MSG_BUFFER_ID_DIAG)-&amp;gt;Status = NODATA;&lt;BR /&gt;&amp;nbsp; &amp;nbsp; CanAif_MsgTxConfirm();&lt;BR /&gt;&amp;nbsp; }&lt;BR /&gt;}&lt;/P&gt;&lt;P&gt;Thank you !&lt;BR /&gt;&amp;nbsp; &amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 14 Apr 2021 05:17:43 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/KEAZ128-MSCAN/m-p/1261681#M60204</guid>
      <dc:creator>Roc_Wang</dc:creator>
      <dc:date>2021-04-14T05:17:43Z</dc:date>
    </item>
    <item>
      <title>Re: KEAZ128 MSCAN</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/KEAZ128-MSCAN/m-p/1261692#M60205</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;SPAN class=""&gt;&lt;A id="link_52" class="lia-link-navigation lia-page-link lia-user-name-link" href="https://community.nxp.com/t5/user/viewprofilepage/user-id/185413" target="_self"&gt;Roc_Wang&lt;/A&gt;,&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN class=""&gt;&amp;nbsp; &amp;nbsp;At least, I checked that related can driver, didn't find the specific API to clear it, just the status information updated code.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN class=""&gt;&amp;nbsp; You can use your mentioned code, I think this MSCAN driver just design like that.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN class=""&gt;&amp;nbsp; &amp;nbsp;Or you also can use the baremetal code, which control the register directly.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN class=""&gt;Wish it helps you!&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN class=""&gt;Best Regards,&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN class=""&gt;Kerry&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 14 Apr 2021 05:38:32 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/KEAZ128-MSCAN/m-p/1261692#M60205</guid>
      <dc:creator>kerryzhou</dc:creator>
      <dc:date>2021-04-14T05:38:32Z</dc:date>
    </item>
    <item>
      <title>Re: KEAZ128 MSCAN</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/KEAZ128-MSCAN/m-p/1262380#M60212</link>
      <description>&lt;P&gt;Get it !&lt;/P&gt;&lt;P&gt;Thank you !&lt;/P&gt;</description>
      <pubDate>Thu, 15 Apr 2021 01:39:25 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/KEAZ128-MSCAN/m-p/1262380#M60212</guid>
      <dc:creator>Roc_Wang</dc:creator>
      <dc:date>2021-04-15T01:39:25Z</dc:date>
    </item>
  </channel>
</rss>

