<?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: Regarding assert error in LPC Microcontrollers</title>
    <link>https://community.nxp.com/t5/LPC-Microcontrollers/Regarding-assert-error/m-p/1719214#M54037</link>
    <description>&lt;P&gt;../fatfs/drivers/fsl_mcan.c:1735:47: error: 'mcan_handle_t' {aka 'struct _mcan_handle'} has no member named 'txbufferIdx'&lt;BR /&gt;1735 | MCAN_TransferAbortSend(base, handle, handle-&amp;gt;txbufferIdx);&lt;BR /&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;When we use the code you've given us we're getting the above error&lt;/P&gt;</description>
    <pubDate>Fri, 08 Sep 2023 04:30:31 GMT</pubDate>
    <dc:creator>gowthami_budideti</dc:creator>
    <dc:date>2023-09-08T04:30:31Z</dc:date>
    <item>
      <title>Regarding assert error</title>
      <link>https://community.nxp.com/t5/LPC-Microcontrollers/Regarding-assert-error/m-p/1718506#M54022</link>
      <description>&lt;P&gt;Hi,&amp;nbsp;&lt;/P&gt;&lt;P&gt;I'm using LPC55S06 board. I'm working with CAN. Before I was using interrupt based CAN, now I'm trying to use callback function. When I try to run the code I'm getting assert error.&amp;nbsp;&lt;/P&gt;&lt;P&gt;Can you give some solution to this problem.&lt;/P&gt;</description>
      <pubDate>Thu, 07 Sep 2023 07:19:41 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPC-Microcontrollers/Regarding-assert-error/m-p/1718506#M54022</guid>
      <dc:creator>gowthami_budideti</dc:creator>
      <dc:date>2023-09-07T07:19:41Z</dc:date>
    </item>
    <item>
      <title>Re: Regarding assert error</title>
      <link>https://community.nxp.com/t5/LPC-Microcontrollers/Regarding-assert-error/m-p/1718512#M54025</link>
      <description>&lt;DIV&gt;void mcan_callback(CAN_Type *base, mcan_handle_t *handle, status_t status, uint32_t result, void *userData)&lt;/DIV&gt;&lt;DIV&gt;{&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;switch (status)&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;{&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;case kStatus_MCAN_RxFifo0Idle:&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;{&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;rxComplete = true;&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;}&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;break;&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;case kStatus_MCAN_TxIdle:&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;{&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;txComplete = true;&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;}&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;break;&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;default:&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;break;&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;}&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;}&lt;/DIV&gt;&lt;DIV&gt;This is my code for callback&lt;/DIV&gt;</description>
      <pubDate>Thu, 07 Sep 2023 07:22:46 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPC-Microcontrollers/Regarding-assert-error/m-p/1718512#M54025</guid>
      <dc:creator>gowthami_budideti</dc:creator>
      <dc:date>2023-09-07T07:22:46Z</dc:date>
    </item>
    <item>
      <title>Re: Regarding assert error</title>
      <link>https://community.nxp.com/t5/LPC-Microcontrollers/Regarding-assert-error/m-p/1718662#M54028</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;
&lt;P&gt;I suppose that the SDK package includes the CAN example, the callback code is the example code without any modification, pls test the example.&lt;/P&gt;
&lt;P&gt;Regarding the callback function, you have to install the callback function with the line in main() function.&lt;/P&gt;
&lt;P&gt;MCAN_Init(EXAMPLE_MCAN, &amp;amp;mcanConfig, MCAN_CLK_FREQ);&lt;/P&gt;
&lt;P&gt;/* Create MCAN handle structure and set call back function. */&lt;BR /&gt;MCAN_TransferCreateHandle(EXAMPLE_MCAN, &amp;amp;mcanHandle, mcan_callback, NULL);&lt;/P&gt;
&lt;P&gt;Pls check if you have called the above two lines, they are required.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The callback function is only called in ISR:&lt;/P&gt;
&lt;P&gt;void MCAN_TransferHandleIRQ(CAN_Type *base, mcan_handle_t *handle)&lt;BR /&gt;{&lt;BR /&gt;/* Assertion. */&lt;BR /&gt;assert(NULL != handle);&lt;/P&gt;
&lt;P&gt;status_t status = kStatus_MCAN_UnHandled;&lt;BR /&gt;uint32_t valueIR;&lt;BR /&gt;uint32_t result;&lt;/P&gt;
&lt;P&gt;/* Store Current MCAN Module Error and Status. */&lt;BR /&gt;valueIR = base-&amp;gt;IR;&lt;/P&gt;
&lt;P&gt;do&lt;BR /&gt;{&lt;BR /&gt;if (0U != (valueIR &amp;amp; ((uint32_t)kMCAN_ErrorWarningIntFlag | (uint32_t)kMCAN_ErrorPassiveIntFlag |&lt;BR /&gt;(uint32_t)kMCAN_BusOffIntFlag)))&lt;BR /&gt;{&lt;BR /&gt;/* Solve error. */&lt;BR /&gt;result = (uint32_t)kMCAN_ErrorWarningIntFlag | (uint32_t)kMCAN_ErrorPassiveIntFlag |&lt;BR /&gt;(uint32_t)kMCAN_BusOffIntFlag;&lt;BR /&gt;status = kStatus_MCAN_ErrorStatus;&lt;BR /&gt;}&lt;BR /&gt;else if (0U != (valueIR &amp;amp; (uint32_t)kMCAN_TxTransmitCompleteFlag))&lt;BR /&gt;{&lt;BR /&gt;/* Solve Tx interrupt. */&lt;BR /&gt;result = (uint32_t)kMCAN_TxTransmitCompleteFlag;&lt;BR /&gt;status = kStatus_MCAN_TxIdle;&lt;BR /&gt;MCAN_TransferAbortSend(base, handle, handle-&amp;gt;txbufferIdx);&lt;BR /&gt;}&lt;BR /&gt;else if (0U != (valueIR &amp;amp; (uint32_t)kMCAN_RxFifo0NewFlag))&lt;BR /&gt;{&lt;BR /&gt;(void)MCAN_ReadRxFifo(base, 0U, handle-&amp;gt;rxFifoFrameBuf);&lt;BR /&gt;result = (uint32_t)kMCAN_RxFifo0NewFlag;&lt;BR /&gt;status = kStatus_MCAN_RxFifo0Idle;&lt;BR /&gt;MCAN_TransferAbortReceiveFifo(base, 0U, handle);&lt;BR /&gt;}&lt;BR /&gt;else if (0U != (valueIR &amp;amp; (uint32_t)kMCAN_RxFifo0LostFlag))&lt;BR /&gt;{&lt;BR /&gt;result = (uint32_t)kMCAN_RxFifo0LostFlag;&lt;BR /&gt;status = kStatus_MCAN_RxFifo0Lost;&lt;BR /&gt;}&lt;BR /&gt;else if (0U != (valueIR &amp;amp; (uint32_t)kMCAN_RxFifo1NewFlag))&lt;BR /&gt;{&lt;BR /&gt;(void)MCAN_ReadRxFifo(base, 1U, handle-&amp;gt;rxFifoFrameBuf);&lt;BR /&gt;result = (uint32_t)kMCAN_RxFifo1NewFlag;&lt;BR /&gt;status = kStatus_MCAN_RxFifo1Idle;&lt;BR /&gt;MCAN_TransferAbortReceiveFifo(base, 1U, handle);&lt;BR /&gt;}&lt;BR /&gt;else if (0U != (valueIR &amp;amp; (uint32_t)kMCAN_RxFifo1LostFlag))&lt;BR /&gt;{&lt;BR /&gt;result = (uint32_t)kMCAN_RxFifo1LostFlag;&lt;BR /&gt;status = kStatus_MCAN_RxFifo0Lost;&lt;BR /&gt;}&lt;BR /&gt;else&lt;BR /&gt;{&lt;BR /&gt;/* Handle the interrupt flag unsupported in current version of MCAN driver.&lt;BR /&gt;* User can get these unsupported interrupt flags by callback function,&lt;BR /&gt;* we can clear directly in the handler to prevent endless loop.&lt;BR /&gt;*/&lt;BR /&gt;result = valueIR;&lt;BR /&gt;result &amp;amp;= ~((uint32_t)kMCAN_ErrorWarningIntFlag | (uint32_t)kMCAN_ErrorPassiveIntFlag |&lt;BR /&gt;(uint32_t)kMCAN_BusOffIntFlag | (uint32_t)kMCAN_TxTransmitCompleteFlag |&lt;BR /&gt;(uint32_t)kMCAN_RxFifo0NewFlag | (uint32_t)kMCAN_RxFifo0LostFlag |&lt;BR /&gt;(uint32_t)kMCAN_RxFifo1NewFlag | (uint32_t)kMCAN_RxFifo1LostFlag);&lt;BR /&gt;}&lt;/P&gt;
&lt;P&gt;/* Clear Error interrupt, resolved Rx FIFO, Tx Buffer IRQ and other unsupported interrupt flags. */&lt;BR /&gt;MCAN_ClearStatusFlag(base, result);&lt;/P&gt;
&lt;P&gt;/* Calling Callback Function if has one. */&lt;BR /&gt;if (handle-&amp;gt;callback != NULL)&lt;BR /&gt;{&lt;BR /&gt;handle-&amp;gt;callback(base, handle, status, result, handle-&amp;gt;userData);&lt;BR /&gt;}&lt;/P&gt;
&lt;P&gt;/* Reset return status */&lt;BR /&gt;status = kStatus_MCAN_UnHandled;&lt;/P&gt;
&lt;P&gt;/* Store Current MCAN Module Error and Status. */&lt;BR /&gt;valueIR = base-&amp;gt;IR;&lt;BR /&gt;} while (0U != valueIR);&lt;BR /&gt;}&lt;/P&gt;
&lt;P&gt;Hope it is helpful&lt;/P&gt;
&lt;P&gt;BR&lt;/P&gt;
&lt;P&gt;XiangJun Rong&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 07 Sep 2023 09:24:21 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPC-Microcontrollers/Regarding-assert-error/m-p/1718662#M54028</guid>
      <dc:creator>xiangjun_rong</dc:creator>
      <dc:date>2023-09-07T09:24:21Z</dc:date>
    </item>
    <item>
      <title>Re: Regarding assert error</title>
      <link>https://community.nxp.com/t5/LPC-Microcontrollers/Regarding-assert-error/m-p/1719214#M54037</link>
      <description>&lt;P&gt;../fatfs/drivers/fsl_mcan.c:1735:47: error: 'mcan_handle_t' {aka 'struct _mcan_handle'} has no member named 'txbufferIdx'&lt;BR /&gt;1735 | MCAN_TransferAbortSend(base, handle, handle-&amp;gt;txbufferIdx);&lt;BR /&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;When we use the code you've given us we're getting the above error&lt;/P&gt;</description>
      <pubDate>Fri, 08 Sep 2023 04:30:31 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPC-Microcontrollers/Regarding-assert-error/m-p/1719214#M54037</guid>
      <dc:creator>gowthami_budideti</dc:creator>
      <dc:date>2023-09-08T04:30:31Z</dc:date>
    </item>
    <item>
      <title>Re: Regarding assert error</title>
      <link>https://community.nxp.com/t5/LPC-Microcontrollers/Regarding-assert-error/m-p/1719252#M54039</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;
&lt;P&gt;i suppose that this is an issue for different&amp;nbsp; SDK package version. On my SDK ver2.8.2, the&lt;/P&gt;
&lt;P&gt;_mcan_handle has the txbufferIdx member.&lt;/P&gt;
&lt;P&gt;But my SDK version is a bit old.&lt;/P&gt;
&lt;P&gt;BR&lt;/P&gt;
&lt;P&gt;XiangJun Rong&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="xiangjun_rong_0-1694152809751.png" style="width: 400px;"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/240146i1FD9185EE9EBD184/image-size/medium?v=v2&amp;amp;px=400" role="button" title="xiangjun_rong_0-1694152809751.png" alt="xiangjun_rong_0-1694152809751.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 08 Sep 2023 06:03:10 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPC-Microcontrollers/Regarding-assert-error/m-p/1719252#M54039</guid>
      <dc:creator>xiangjun_rong</dc:creator>
      <dc:date>2023-09-08T06:03:10Z</dc:date>
    </item>
  </channel>
</rss>

