<?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 lpc54616 can bus error managment in LPC Microcontrollers</title>
    <link>https://community.nxp.com/t5/LPC-Microcontrollers/lpc54616-can-bus-error-managment/m-p/1072386#M41361</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;How can dedect bus off state an other can bus error im lpc 54616? im try in mcan interrupt transfer like this:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;case kStatus_MCAN_ErrorStatus:&lt;BR /&gt; {&lt;BR /&gt; uint32_t bo, lec;&lt;/P&gt;&lt;P&gt;if ((base-&amp;gt;PSR&amp;amp;CAN_PSR_BO_MASK)&amp;gt;&amp;gt;CAN_PSR_BO_SHIFT)&lt;BR /&gt; {&lt;/P&gt;&lt;P&gt;/* Reset INIT bit to enter normal mode. */&lt;BR /&gt; base-&amp;gt;CCCR &amp;amp;= ~CAN_CCCR_INIT_MASK;&lt;BR /&gt; while (0U != (base-&amp;gt;CCCR &amp;amp; CAN_CCCR_INIT_MASK))&lt;BR /&gt; {&lt;BR /&gt; }&lt;/P&gt;&lt;P&gt;while ( (((base-&amp;gt;PSR&amp;amp;CAN_PSR_LEC_MASK)==5) ) || (((base-&amp;gt;PSR&amp;amp;CAN_PSR_BO_MASK)&amp;gt;&amp;gt;CAN_PSR_BO_SHIFT==1)) )&lt;BR /&gt; {&lt;/P&gt;&lt;P&gt;}&lt;/P&gt;&lt;P&gt;&lt;BR /&gt; MCAN_Init(EXAMPLE_MCAN, &amp;amp;mcanConfig, MCAN_CLK_FREQ);&lt;BR /&gt; //MCAN_Deinit(base);&lt;BR /&gt; }&lt;/P&gt;&lt;P&gt;&lt;BR /&gt; //MCAN_Init(EXAMPLE_MCAN, &amp;amp;mcanConfig, MCAN_CLK_FREQ);&lt;BR /&gt; //MCAN_Deinit(base);//Init(EXAMPLE_MCAN, &amp;amp;mcanConfig, MCAN_CLK_FREQ);&lt;/P&gt;&lt;P&gt;&lt;BR /&gt; }&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;But PSR_BO always is 1&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 08 Jun 2020 21:37:05 GMT</pubDate>
    <dc:creator>ali3</dc:creator>
    <dc:date>2020-06-08T21:37:05Z</dc:date>
    <item>
      <title>lpc54616 can bus error managment</title>
      <link>https://community.nxp.com/t5/LPC-Microcontrollers/lpc54616-can-bus-error-managment/m-p/1072386#M41361</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;How can dedect bus off state an other can bus error im lpc 54616? im try in mcan interrupt transfer like this:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;case kStatus_MCAN_ErrorStatus:&lt;BR /&gt; {&lt;BR /&gt; uint32_t bo, lec;&lt;/P&gt;&lt;P&gt;if ((base-&amp;gt;PSR&amp;amp;CAN_PSR_BO_MASK)&amp;gt;&amp;gt;CAN_PSR_BO_SHIFT)&lt;BR /&gt; {&lt;/P&gt;&lt;P&gt;/* Reset INIT bit to enter normal mode. */&lt;BR /&gt; base-&amp;gt;CCCR &amp;amp;= ~CAN_CCCR_INIT_MASK;&lt;BR /&gt; while (0U != (base-&amp;gt;CCCR &amp;amp; CAN_CCCR_INIT_MASK))&lt;BR /&gt; {&lt;BR /&gt; }&lt;/P&gt;&lt;P&gt;while ( (((base-&amp;gt;PSR&amp;amp;CAN_PSR_LEC_MASK)==5) ) || (((base-&amp;gt;PSR&amp;amp;CAN_PSR_BO_MASK)&amp;gt;&amp;gt;CAN_PSR_BO_SHIFT==1)) )&lt;BR /&gt; {&lt;/P&gt;&lt;P&gt;}&lt;/P&gt;&lt;P&gt;&lt;BR /&gt; MCAN_Init(EXAMPLE_MCAN, &amp;amp;mcanConfig, MCAN_CLK_FREQ);&lt;BR /&gt; //MCAN_Deinit(base);&lt;BR /&gt; }&lt;/P&gt;&lt;P&gt;&lt;BR /&gt; //MCAN_Init(EXAMPLE_MCAN, &amp;amp;mcanConfig, MCAN_CLK_FREQ);&lt;BR /&gt; //MCAN_Deinit(base);//Init(EXAMPLE_MCAN, &amp;amp;mcanConfig, MCAN_CLK_FREQ);&lt;/P&gt;&lt;P&gt;&lt;BR /&gt; }&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;But PSR_BO always is 1&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 08 Jun 2020 21:37:05 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPC-Microcontrollers/lpc54616-can-bus-error-managment/m-p/1072386#M41361</guid>
      <dc:creator>ali3</dc:creator>
      <dc:date>2020-06-08T21:37:05Z</dc:date>
    </item>
    <item>
      <title>Re: lpc54616 can bus error managment</title>
      <link>https://community.nxp.com/t5/LPC-Microcontrollers/lpc54616-can-bus-error-managment/m-p/1072387#M41362</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Check the error counter values (TEC and REC).&lt;/P&gt;&lt;P&gt;These values are implemented according to the CAN bus standard.&lt;/P&gt;&lt;P&gt;"Bus off" means a counter (usually TEC) has hit 255.&lt;/P&gt;&lt;P&gt;It seems you have a physical problem, perhaps your termination is not correct, or you swapped CANH and CANL at one bus participant.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 09 Jun 2020 05:43:53 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPC-Microcontrollers/lpc54616-can-bus-error-managment/m-p/1072387#M41362</guid>
      <dc:creator>frank_m</dc:creator>
      <dc:date>2020-06-09T05:43:53Z</dc:date>
    </item>
    <item>
      <title>Re: lpc54616 can bus error managment</title>
      <link>https://community.nxp.com/t5/LPC-Microcontrollers/lpc54616-can-bus-error-managment/m-p/1072388#M41363</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi, Ali,&lt;/P&gt;&lt;P&gt;For the CAN bus off error, pls check the CAN bus network, the CANx_TD and CANx_RD must be connected to a CAN transceiver, as Frank said that the 120 ohm terminating resistor between CAN_H and CAN_L pins of CAN transceiver is required.&lt;/P&gt;&lt;P&gt;BR&lt;/P&gt;&lt;P&gt;XiangJun Rong&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 09 Jun 2020 06:26:44 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPC-Microcontrollers/lpc54616-can-bus-error-managment/m-p/1072388#M41363</guid>
      <dc:creator>xiangjun_rong</dc:creator>
      <dc:date>2020-06-09T06:26:44Z</dc:date>
    </item>
    <item>
      <title>Re: lpc54616 can bus error managment</title>
      <link>https://community.nxp.com/t5/LPC-Microcontrollers/lpc54616-can-bus-error-managment/m-p/1072389#M41364</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;My can cominication work.İ neede manupilating can buss error state. I can try in sdk example . Can work normal but if i can short circuit can bus can&amp;nbsp; goes bus off state .&amp;nbsp; How can i reset cominication and other error state.&amp;nbsp;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 09 Jun 2020 11:34:31 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPC-Microcontrollers/lpc54616-can-bus-error-managment/m-p/1072389#M41364</guid>
      <dc:creator>ali3</dc:creator>
      <dc:date>2020-06-09T11:34:31Z</dc:date>
    </item>
    <item>
      <title>Re: lpc54616 can bus error managment</title>
      <link>https://community.nxp.com/t5/LPC-Microcontrollers/lpc54616-can-bus-error-managment/m-p/1072390#M41365</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi, Ali,&lt;/P&gt;&lt;P&gt;I see that you just want to handle various error.&lt;/P&gt;&lt;P&gt;You can manipulate the NCAN0_RST in PRESETCTRL1 REG to reset the CAN module, then reinitialize the CAN module.&lt;/P&gt;&lt;P&gt;Hope it can help you&lt;/P&gt;&lt;P&gt;BR&lt;/P&gt;&lt;P&gt;XiangJun Rong&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="pastedImage_1.png"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/112414i2818F605257578C6/image-size/large?v=v2&amp;amp;px=999" role="button" title="pastedImage_1.png" alt="pastedImage_1.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 10 Jun 2020 02:41:39 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPC-Microcontrollers/lpc54616-can-bus-error-managment/m-p/1072390#M41365</guid>
      <dc:creator>xiangjun_rong</dc:creator>
      <dc:date>2020-06-10T02:41:39Z</dc:date>
    </item>
    <item>
      <title>Re: lpc54616 can bus error managment</title>
      <link>https://community.nxp.com/t5/LPC-Microcontrollers/lpc54616-can-bus-error-managment/m-p/1072391#M41366</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;i can solve this problem . I can grab error in calback function. after ican restart can modul with bus_off.&amp;nbsp; But important function sendnonblocking method. if user use like sdk is hangup in while statement&lt;/P&gt;&lt;P&gt;while (!txComplete)&lt;BR /&gt; {&lt;/P&gt;&lt;P&gt;}&lt;BR /&gt; txComplete = false;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;user must control sendnonblocikng methode return value. If valu is sucsec u can use while statement.&lt;/P&gt;&lt;P&gt;sts=MCAN_TransferSendNonBlocking(EXAMPLE_MCAN, &amp;amp;mcanHandle, &amp;amp;txXfer);&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;switch (sts)&lt;BR /&gt; {&lt;/P&gt;&lt;P&gt;case kStatus_Success:&lt;BR /&gt; {&lt;BR /&gt; while (!txComplete)&lt;BR /&gt; {&lt;/P&gt;&lt;P&gt;}&lt;BR /&gt; txComplete = false;&lt;/P&gt;&lt;P&gt;}&lt;BR /&gt; break;&lt;/P&gt;&lt;P&gt;case kStatus_Fail:&lt;BR /&gt; {&lt;BR /&gt; psr=EXAMPLE_MCAN-&amp;gt;PSR&amp;amp;CAN_PSR_LEC_MASK;&lt;BR /&gt; ecer=EXAMPLE_MCAN-&amp;gt;ECR&amp;amp;CAN_ECR_TEC_MASK;&lt;BR /&gt; busof=(EXAMPLE_MCAN-&amp;gt;PSR&amp;amp;CAN_PSR_BO_MASK)&amp;gt;&amp;gt;CAN_PSR_BO_SHIFT;&lt;BR /&gt; ccr=EXAMPLE_MCAN-&amp;gt;CCCR;&lt;BR /&gt; sts=0;&lt;/P&gt;&lt;P&gt;}&lt;/P&gt;&lt;P&gt;break;&lt;BR /&gt; case kStatus_MCAN_TxBusy:&lt;BR /&gt; {&lt;/P&gt;&lt;P&gt;&lt;BR /&gt; }&lt;/P&gt;&lt;P&gt;default:&lt;BR /&gt; break;&lt;/P&gt;&lt;P&gt;}&lt;/P&gt;&lt;P&gt;call back func:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;static void mcan_callback(CAN_Type *base, mcan_handle_t *handle, status_t status, uint32_t result, void *userData)&lt;BR /&gt;{&lt;BR /&gt; BaseType_t xHigherPriorityTaskWoken;&lt;/P&gt;&lt;P&gt;/* The xHigherPriorityTaskWoken parameter must be initialized to pdFALSE as&lt;BR /&gt; it will get set to pdTRUE inside the interrupt safe API function if a&lt;BR /&gt; context switch is required. */&lt;BR /&gt; xHigherPriorityTaskWoken = pdFALSE;&lt;/P&gt;&lt;P&gt;/* 'Give' the semaphore to unblock the task. */&lt;/P&gt;&lt;P&gt;&lt;BR /&gt; /* Pass the xHigherPriorityTaskWoken value into portYIELD_FROM_ISR(). If&lt;BR /&gt; xHigherPriorityTaskWoken was set to pdTRUE inside xSemaphoreGiveFromISR()&lt;BR /&gt; then calling portYIELD_FROM_ISR() will request a context switch. If&lt;BR /&gt; xHigherPriorityTaskWoken is still pdFALSE then calling&lt;BR /&gt; portYIELD_FROM_ISR() will have no effect. The implementation of&lt;BR /&gt; portYIELD_FROM_ISR() used by the Windows port includes a return statement,&lt;BR /&gt; which is why this function does not explicitly return a value. */&lt;/P&gt;&lt;P&gt;// printf("Callback status: 0x%x", status);&lt;BR /&gt; //printf(" IR: 0x%x \r\n", base-&amp;gt;IR);&lt;/P&gt;&lt;P&gt;&lt;BR /&gt; switch (status)&lt;BR /&gt; {&lt;/P&gt;&lt;P&gt;&lt;BR /&gt; case kStatus_MCAN_RxFifo0Idle:&lt;BR /&gt; {&lt;/P&gt;&lt;P&gt;xSemaphoreGiveFromISR( semaphoreRX, &amp;amp;xHigherPriorityTaskWoken );&lt;BR /&gt; rxComplete = true;&lt;BR /&gt; portYIELD_FROM_ISR( xHigherPriorityTaskWoken );&lt;BR /&gt; }&lt;BR /&gt; break;&lt;/P&gt;&lt;P&gt;case kStatus_MCAN_TxIdle:&lt;BR /&gt; {&lt;BR /&gt; xSemaphoreGiveFromISR( semaphorum, &amp;amp;xHigherPriorityTaskWoken );&lt;BR /&gt; txComplete = true;&lt;BR /&gt; portYIELD_FROM_ISR( xHigherPriorityTaskWoken );&lt;BR /&gt; }&lt;BR /&gt; break;&lt;/P&gt;&lt;P&gt;case kStatus_MCAN_ErrorStatus:&lt;BR /&gt; {&lt;BR /&gt; if (EXAMPLE_MCAN-&amp;gt;CCCR &amp;amp;= CAN_CCCR_INIT_MASK)&lt;BR /&gt; {&lt;BR /&gt; EXAMPLE_MCAN-&amp;gt;CCCR &amp;amp;= ~CAN_CCCR_INIT_MASK;&lt;BR /&gt; while (0U != (EXAMPLE_MCAN-&amp;gt;CCCR &amp;amp; CAN_CCCR_INIT_MASK))&lt;BR /&gt; {&lt;BR /&gt; }&lt;BR /&gt; }&lt;/P&gt;&lt;P&gt;&lt;BR /&gt; mcanreset();&lt;BR /&gt; //txError=true;&lt;BR /&gt; txComplete = true;&lt;BR /&gt; xSemaphoreGiveFromISR( semaphorum, &amp;amp;xHigherPriorityTaskWoken );&lt;BR /&gt; txComplete = true;&lt;BR /&gt; portYIELD_FROM_ISR( xHigherPriorityTaskWoken );&lt;/P&gt;&lt;P&gt;&lt;BR /&gt; }&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;default:&lt;BR /&gt; break;&lt;BR /&gt; }&lt;BR /&gt;}&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;in calback function i send xsemaphore to my rtos but this is only evaluate .&lt;/P&gt;&lt;P&gt;sory this code only evaluate. im writing all is next day.&amp;nbsp;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 10 Jun 2020 12:42:11 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPC-Microcontrollers/lpc54616-can-bus-error-managment/m-p/1072391#M41366</guid>
      <dc:creator>ali3</dc:creator>
      <dc:date>2020-06-10T12:42:11Z</dc:date>
    </item>
  </channel>
</rss>

