<?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: LPC546 MCANRxFifo assert in LPC Microcontrollers</title>
    <link>https://community.nxp.com/t5/LPC-Microcontrollers/LPC546-MCANRxFifo-assert/m-p/2049713#M57738</link>
    <description>&lt;P&gt;Hello &lt;a href="https://community.nxp.com/t5/user/viewprofilepage/user-id/229957"&gt;@Harry_Zhang&lt;/a&gt;.&lt;/P&gt;&lt;P&gt;What if we ack the read and return failure? This return value could be checked when calling to &lt;STRONG&gt;&lt;EM&gt;MCAN_ReadRxFifo&lt;/EM&gt; &lt;/STRONG&gt;function and set a different status for CAN bus, like&amp;nbsp;&lt;FONT color="#0000FF"&gt;&lt;EM&gt;kStatus_MCAN_RxFifo0Lost&lt;/EM&gt;&lt;/FONT&gt;.&lt;/P&gt;&lt;LI-CODE lang="c"&gt;status_t MCAN_ReadRxFifo(CAN_Type *base, uint8_t fifoBlock, mcan_rx_buffer_frame_t *rxFrame)
{
    /* Assertion. */
    assert((0U == fifoBlock) || (1U == fifoBlock));
    if (NULL == rxFrame) {
    	/* Acknowledge the read. */
        if (0U == fifoBlock)
        {
            base-&amp;gt;RXF0A = (base-&amp;gt;RXF0S &amp;amp; CAN_RXF0S_F0GI_MASK) &amp;gt;&amp;gt; CAN_RXF0S_F0GI_SHIFT;
        }
        else
        {
            base-&amp;gt;RXF1A = (base-&amp;gt;RXF1S &amp;amp; CAN_RXF1S_F1GI_MASK) &amp;gt;&amp;gt; CAN_RXF1S_F1GI_SHIFT;
        }
        return kStatus_Fail;
    }
[...]&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Kind regards&lt;/P&gt;</description>
    <pubDate>Mon, 24 Feb 2025 08:18:14 GMT</pubDate>
    <dc:creator>Hector_Jimenez</dc:creator>
    <dc:date>2025-02-24T08:18:14Z</dc:date>
    <item>
      <title>LPC546 MCANRxFifo assert</title>
      <link>https://community.nxp.com/t5/LPC-Microcontrollers/LPC546-MCANRxFifo-assert/m-p/2049106#M57734</link>
      <description>&lt;P&gt;I'm using MCAN module in LPC54616 MCU in a very unstable environment, which causes assertion in&amp;nbsp;MCAN_ReadRxFifo function when receiving null frames (rxFrame = NULL).&lt;/P&gt;&lt;P&gt;fsl_mcan.c&lt;/P&gt;&lt;BLOCKQUOTE&gt;&lt;P&gt;[...]&lt;/P&gt;&lt;P&gt;status_t &lt;STRONG&gt;MCAN_ReadRxFifo&lt;/STRONG&gt;(CAN_Type *base, uint8_t fifoBlock, mcan_rx_buffer_frame_t *rxFrame)&lt;BR /&gt;{&lt;BR /&gt;/* Assertion. */&lt;BR /&gt;assert((0U == fifoBlock) || (1U == fifoBlock));&lt;BR /&gt;&lt;STRONG&gt;assert(NULL != rxFrame);&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;[...]&lt;/P&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;leading into MCU continiously stalling.&amp;nbsp;&lt;/P&gt;&lt;P&gt;Is this a real assertion reason or could it be sorted out by skipping that reading?&lt;/P&gt;&lt;P&gt;Perhaps it's already been solved in later versions of SDK, can anyone confirm this? My SDK version is 2.10.&lt;/P&gt;&lt;P&gt;Thank you!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 21 Feb 2025 13:24:37 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPC-Microcontrollers/LPC546-MCANRxFifo-assert/m-p/2049106#M57734</guid>
      <dc:creator>Hector_Jimenez</dc:creator>
      <dc:date>2025-02-21T13:24:37Z</dc:date>
    </item>
    <item>
      <title>Re: LPC546 MCANRxFifo assert</title>
      <link>https://community.nxp.com/t5/LPC-Microcontrollers/LPC546-MCANRxFifo-assert/m-p/2049706#M57737</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.nxp.com/t5/user/viewprofilepage/user-id/196227"&gt;@Hector_Jimenez&lt;/a&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;In the&amp;nbsp;MCAN_ReadRxFifo function,&amp;nbsp;&lt;/P&gt;
&lt;P&gt;assert(NULL != rxFrame)&amp;nbsp;&amp;nbsp;is a necessary condition.&lt;/P&gt;
&lt;DIV id="tinyMceEditorHarry_Zhang_0" class="mceNonEditable lia-copypaste-placeholder"&gt;&amp;nbsp;&lt;/DIV&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Snipaste_2025-02-24_16-03-00.png" style="width: 400px;"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/325308i84E70AD98EBDD98E/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Snipaste_2025-02-24_16-03-00.png" alt="Snipaste_2025-02-24_16-03-00.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;So it&amp;nbsp;&lt;SPAN&gt;could not be sorted out by skipping that reading.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;BR&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;Harry&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 24 Feb 2025 08:04:19 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPC-Microcontrollers/LPC546-MCANRxFifo-assert/m-p/2049706#M57737</guid>
      <dc:creator>Harry_Zhang</dc:creator>
      <dc:date>2025-02-24T08:04:19Z</dc:date>
    </item>
    <item>
      <title>Re: LPC546 MCANRxFifo assert</title>
      <link>https://community.nxp.com/t5/LPC-Microcontrollers/LPC546-MCANRxFifo-assert/m-p/2049713#M57738</link>
      <description>&lt;P&gt;Hello &lt;a href="https://community.nxp.com/t5/user/viewprofilepage/user-id/229957"&gt;@Harry_Zhang&lt;/a&gt;.&lt;/P&gt;&lt;P&gt;What if we ack the read and return failure? This return value could be checked when calling to &lt;STRONG&gt;&lt;EM&gt;MCAN_ReadRxFifo&lt;/EM&gt; &lt;/STRONG&gt;function and set a different status for CAN bus, like&amp;nbsp;&lt;FONT color="#0000FF"&gt;&lt;EM&gt;kStatus_MCAN_RxFifo0Lost&lt;/EM&gt;&lt;/FONT&gt;.&lt;/P&gt;&lt;LI-CODE lang="c"&gt;status_t MCAN_ReadRxFifo(CAN_Type *base, uint8_t fifoBlock, mcan_rx_buffer_frame_t *rxFrame)
{
    /* Assertion. */
    assert((0U == fifoBlock) || (1U == fifoBlock));
    if (NULL == rxFrame) {
    	/* Acknowledge the read. */
        if (0U == fifoBlock)
        {
            base-&amp;gt;RXF0A = (base-&amp;gt;RXF0S &amp;amp; CAN_RXF0S_F0GI_MASK) &amp;gt;&amp;gt; CAN_RXF0S_F0GI_SHIFT;
        }
        else
        {
            base-&amp;gt;RXF1A = (base-&amp;gt;RXF1S &amp;amp; CAN_RXF1S_F1GI_MASK) &amp;gt;&amp;gt; CAN_RXF1S_F1GI_SHIFT;
        }
        return kStatus_Fail;
    }
[...]&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Kind regards&lt;/P&gt;</description>
      <pubDate>Mon, 24 Feb 2025 08:18:14 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPC-Microcontrollers/LPC546-MCANRxFifo-assert/m-p/2049713#M57738</guid>
      <dc:creator>Hector_Jimenez</dc:creator>
      <dc:date>2025-02-24T08:18:14Z</dc:date>
    </item>
    <item>
      <title>Re: LPC546 MCANRxFifo assert</title>
      <link>https://community.nxp.com/t5/LPC-Microcontrollers/LPC546-MCANRxFifo-assert/m-p/2051305#M57761</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.nxp.com/t5/user/viewprofilepage/user-id/196227"&gt;@Hector_Jimenez&lt;/a&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Yes, you can add related code.&lt;/P&gt;
&lt;P&gt;Or&amp;nbsp; you can add a new function.&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;status_t CheckFrame(CAN_Type *base, uint8_t fifoBlock, mcan_rx_buffer_frame_t *rxFrame)
{
    /* Assertion. */
    assert((0U == fifoBlock) || (1U == fifoBlock));
    if (NULL == rxFrame) {
    	/* Acknowledge the read. */
        if (0U == fifoBlock)
        {
            base-&amp;gt;RXF0A = (base-&amp;gt;RXF0S &amp;amp; CAN_RXF0S_F0GI_MASK) &amp;gt;&amp;gt; CAN_RXF0S_F0GI_SHIFT;
        }
        else
        {
            base-&amp;gt;RXF1A = (base-&amp;gt;RXF1S &amp;amp; CAN_RXF1S_F1GI_MASK) &amp;gt;&amp;gt; CAN_RXF1S_F1GI_SHIFT;
        }
        return kStatus_Fail;
    }
    else {
     
         MCAN_ReadRxFifo(base, fifoBlock, rxFrame);
    
}
[...]&lt;/LI-CODE&gt;
&lt;P&gt;BR&lt;/P&gt;
&lt;P&gt;Harry&lt;/P&gt;</description>
      <pubDate>Wed, 26 Feb 2025 03:41:13 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPC-Microcontrollers/LPC546-MCANRxFifo-assert/m-p/2051305#M57761</guid>
      <dc:creator>Harry_Zhang</dc:creator>
      <dc:date>2025-02-26T03:41:13Z</dc:date>
    </item>
    <item>
      <title>Re: LPC546 MCANRxFifo assert</title>
      <link>https://community.nxp.com/t5/LPC-Microcontrollers/LPC546-MCANRxFifo-assert/m-p/2053570#M57785</link>
      <description>&lt;P&gt;Hi,&amp;nbsp;&lt;a href="https://community.nxp.com/t5/user/viewprofilepage/user-id/229957"&gt;@Harry_Zhang&lt;/a&gt;&amp;nbsp;.&lt;/P&gt;&lt;P&gt;We are testing the code I posted and it seems to work fine in these unstable conditions. Some frames are lost, but MCU doesn't get stalled.&lt;/P&gt;&lt;P&gt;Thanks for your help.&lt;/P&gt;&lt;P&gt;Regards!&lt;/P&gt;</description>
      <pubDate>Fri, 28 Feb 2025 07:27:08 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPC-Microcontrollers/LPC546-MCANRxFifo-assert/m-p/2053570#M57785</guid>
      <dc:creator>Hector_Jimenez</dc:creator>
      <dc:date>2025-02-28T07:27:08Z</dc:date>
    </item>
  </channel>
</rss>

