<?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: LPC54608 CanBus Driver in LPC Microcontrollers</title>
    <link>https://community.nxp.com/t5/LPC-Microcontrollers/LPC54608-CanBus-Driver/m-p/762853#M30710</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi jeremyzhou,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I did sth but now have a new problem, I see some datas, receiving datas in fifo0 but I don't know how to see them in buffer.&amp;nbsp;&lt;BR /&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/13439i73B69EA26C7EB1DE/image-size/large?v=v2&amp;amp;px=999" role="button" title="pastedImage_1.png" alt="pastedImage_1.png" /&gt;&lt;/span&gt;&lt;BR /&gt;These are datas I want to see but don't know how to use them. For example I want to use switch case structure according to first data but I don't know how. Could you help me ?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;#include "fsl_debug_console.h"&lt;BR /&gt;#include "fsl_mcan.h"&lt;BR /&gt;#include "board.h"&lt;/P&gt;&lt;P&gt;#include "pin_mux.h"&lt;BR /&gt;#include &amp;lt;stdbool.h&amp;gt;&lt;BR /&gt;&lt;BR /&gt;#define EXAMPLE_MCAN_IRQHandler CAN0_IRQ0_IRQHandler&lt;BR /&gt;#define EXAMPLE_MCAN_IRQn CAN0_IRQ0_IRQn&lt;BR /&gt;#define EXAMPLE_MCAN CAN0&lt;BR /&gt;#define MCAN_CLK_FREQ CLOCK_GetFreq(kCLOCK_MCAN0)&lt;BR /&gt;#define STDID_OFFSET 18U&lt;BR /&gt;#define MSG_RAM_BASE 0x20010000U&lt;BR /&gt;#define STD_FILTER_OFS 0x0&lt;BR /&gt;#define RX_FIFO0_OFS 0x100U//0x10U&lt;BR /&gt;#define TX_BUFFER_OFS 0x20U&lt;BR /&gt;int8_t count;&lt;BR /&gt;uint8_t RB[8];&lt;BR /&gt;/*******************************************************************************&lt;BR /&gt; * Prototypes&lt;BR /&gt; ******************************************************************************/&lt;/P&gt;&lt;P&gt;/*******************************************************************************&lt;BR /&gt; * Variables&lt;BR /&gt; ******************************************************************************/&lt;BR /&gt;volatile bool rxComplete = false;&lt;BR /&gt;mcan_rx_buffer_frame_t rxFrame;&lt;/P&gt;&lt;P&gt;mcan_fifo_transfer_t rxXfer;&lt;BR /&gt;mcan_handle_t mcanHandle;&lt;BR /&gt;/*******************************************************************************&lt;BR /&gt; * Code&lt;BR /&gt; ******************************************************************************/&lt;/P&gt;&lt;P&gt;void CAN0_IRQ0_IRQHandler(void)&lt;BR /&gt;{&lt;BR /&gt; MCAN_ClearStatusFlag(EXAMPLE_MCAN, CAN_IR_RF0N_MASK);&lt;BR /&gt; MCAN_ReadRxFifo(EXAMPLE_MCAN, 0, &amp;amp;rxFrame);&lt;BR /&gt;// MCAN_ReadRxBuffer(CAN0, 18U, &amp;amp;rxFrame);&lt;BR /&gt; rxComplete = true;&lt;BR /&gt; /* Add for ARM errata 838869, affects Cortex-M4, Cortex-M4F Store immediate overlapping&lt;BR /&gt; exception return operation might vector to incorrect interrupt */&lt;BR /&gt;#if defined __CORTEX_M &amp;amp;&amp;amp; (__CORTEX_M == 4U)&lt;BR /&gt; __DSB();&lt;BR /&gt;#endif&lt;BR /&gt;}&lt;/P&gt;&lt;P&gt;/*!&lt;BR /&gt; * @brief Main function&lt;BR /&gt; */&lt;BR /&gt;int main(void)&lt;BR /&gt;{&lt;BR /&gt; mcan_config_t mcanConfig;&lt;BR /&gt; mcan_frame_filter_config_t rxFilter;&lt;BR /&gt; mcan_std_filter_element_config_t stdFilter;&lt;BR /&gt; mcan_rx_fifo_config_t rxFifo0;&lt;BR /&gt; mcan_rx_buffer_config_t rxBuffer;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt; /* Initialize board hardware. */&lt;BR /&gt; /* attach 12 MHz clock to FLEXCOMM0 (debug console) */&lt;BR /&gt; CLOCK_AttachClk(BOARD_DEBUG_UART_CLK_ATTACH);&lt;/P&gt;&lt;P&gt;/* Set MCAN clock 48/6=8MHz. */&lt;BR /&gt; CLOCK_SetClkDiv(kCLOCK_DivCan0Clk, 22U, true);&lt;/P&gt;&lt;P&gt;BOARD_InitPins();&lt;BR /&gt;// BOARD_BootClockFROHF48M();&lt;BR /&gt; BOARD_BootClockPLL180M();&lt;BR /&gt; BOARD_InitDebugConsole();&lt;/P&gt;&lt;P&gt;MCAN_GetDefaultConfig(&amp;amp;mcanConfig);&lt;BR /&gt;// mcanConfig.enableLoopBackExt = true;&lt;BR /&gt;// mcanConfig.enableCanfdNormal = true;&lt;BR /&gt; MCAN_Init(EXAMPLE_MCAN, &amp;amp;mcanConfig, MCAN_CLK_FREQ);&lt;/P&gt;&lt;P&gt;/* Set Message RAM base address and clear to avoid BEU/BEC error. */&lt;BR /&gt; MCAN_SetMsgRAMBase(EXAMPLE_MCAN, MSG_RAM_BASE);&lt;BR /&gt; uint32_t *p=(uint32_t *)(MSG_RAM_BASE);&lt;BR /&gt; memset(p, 0, TX_BUFFER_OFS + 0x10U);&lt;/P&gt;&lt;P&gt;/* STD filter config. */&lt;BR /&gt;// rxFilter.address = 0x100;&lt;BR /&gt;// rxFilter.idFormat = kMCAN_FrameIDStandard;&lt;BR /&gt;// rxFilter.listSize = 1U;&lt;BR /&gt;// rxFilter.nmFrame = kMCAN_reject0;&lt;BR /&gt;// rxFilter.remFrame = kMCAN_rejectFrame;&lt;BR /&gt;// MCAN_SetFilterConfig(EXAMPLE_MCAN, &amp;amp;rxFilter);&lt;BR /&gt; &lt;BR /&gt; stdFilter.sfec = kMCAN_storeinFifo0;&lt;BR /&gt;// stdFilter.sft = kMCAN_dual;&lt;BR /&gt;// stdFilter.sfid1 = 0x002U;&lt;BR /&gt;// stdFilter.sfid2 = 0x000U;&lt;BR /&gt; MCAN_SetSTDFilterElement(EXAMPLE_MCAN, &amp;amp;rxFilter, &amp;amp;stdFilter, 0);&lt;/P&gt;&lt;P&gt;/* RX fifo0 config. */&lt;BR /&gt; rxFifo0.address = RX_FIFO0_OFS;&lt;BR /&gt; rxFifo0.elementSize = 1U;&lt;BR /&gt; rxFifo0.watermark = 0;&lt;BR /&gt; rxFifo0.opmode = kMCAN_FifoBlocking;&lt;BR /&gt; rxFifo0.datafieldSize = kMCAN_8ByteDatafield;&lt;/P&gt;&lt;P&gt;MCAN_SetRxFifo0Config(EXAMPLE_MCAN, &amp;amp;rxFifo0);&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;// rxBuffer.address = RX_FIFO0_OFS;;&lt;BR /&gt;// rxBuffer.datafieldSize = kMCAN_8ByteDatafield;&lt;BR /&gt;// MCAN_SetRxBufferConfig(EXAMPLE_MCAN, &amp;amp;rxBuffer);&lt;/P&gt;&lt;P&gt;/* Enable RX fifo0 new message interrupt using interrupt line 0. */&lt;BR /&gt; MCAN_EnableInterrupts(EXAMPLE_MCAN, 0, CAN_IE_RF0NE_MASK);&lt;BR /&gt; EnableIRQ(CAN0_IRQ0_IRQn);&lt;/P&gt;&lt;P&gt;/* Enter normal mode. */&lt;BR /&gt; MCAN_EnterNormalMode(EXAMPLE_MCAN);&lt;/P&gt;&lt;P&gt;&lt;BR /&gt; while (1)&lt;BR /&gt; {&lt;BR /&gt; while(!rxComplete)&lt;BR /&gt; {&lt;BR /&gt; }&lt;BR /&gt; PRINTF("ID: %3x", rxFrame.id &amp;gt;&amp;gt; 18);&lt;BR /&gt; PRINTF(" DATA: ");&lt;BR /&gt; count = 9U;&lt;BR /&gt; while(--count)&lt;BR /&gt; {&lt;BR /&gt; PRINTF("0x%x ", *(rxFrame.data++));&lt;BR /&gt; }&lt;BR /&gt; while(++count &amp;lt; 9U)&lt;BR /&gt; {&lt;BR /&gt; rxFrame.data--;&lt;BR /&gt; }&lt;BR /&gt; PRINTF("\r\n");&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;}&lt;BR /&gt;}&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 07 May 2018 06:46:06 GMT</pubDate>
    <dc:creator>fatihozen</dc:creator>
    <dc:date>2018-05-07T06:46:06Z</dc:date>
    <item>
      <title>LPC54608 CanBus Driver</title>
      <link>https://community.nxp.com/t5/LPC-Microcontrollers/LPC54608-CanBus-Driver/m-p/762850#M30707</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;Is there any example of canbus driver for lpc546 family. I have no experience about can communication. There are two examples in SDK but I could not understand clearly how can works. I have another board which sending messages via canbus. I just know&amp;nbsp;communication&amp;nbsp;frequency is 500 kHz and sending 8 bytes each time and its IDs are 0x000 and 0x002. I want to listen what it is sending to me via canbus. Could someone help me to do that?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I see datas via logic analyzer but I don't know how to init can0 or can1 on my lpc54608 uc.&lt;BR /&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/53944i6F6A3F0C4D3656BB/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>Tue, 24 Apr 2018 14:15:45 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPC-Microcontrollers/LPC54608-CanBus-Driver/m-p/762850#M30707</guid>
      <dc:creator>fatihozen</dc:creator>
      <dc:date>2018-04-24T14:15:45Z</dc:date>
    </item>
    <item>
      <title>Re: LPC54608 CanBus Driver</title>
      <link>https://community.nxp.com/t5/LPC-Microcontrollers/LPC54608-CanBus-Driver/m-p/762851#M30708</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi &lt;A _jive_internal="true" class="" data-content-finding="Community" data-userid="314339" data-username="fatihozen" href="https://community.nxp.com/people/fatihozen"&gt;fatih ozen&lt;/A&gt;,&lt;/P&gt;&lt;DIV style="white-space: pre-wrap; text-align: left; line-height: 1.75; font-size: 14px;"&gt;&lt;SPAN style="font-family: 'Microsoft YaHei', STXihei; background-color: #ffffff;"&gt;Thank you for your interest in NXP Semiconductor products and&amp;nbsp;&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV style="white-space: pre-wrap; text-align: left; line-height: 1.75; font-size: 14px;"&gt;&lt;SPAN style="font-family: 'Microsoft YaHei', STXihei; background-color: #ffffff;"&gt;for the opportunity to serve you.&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV style="white-space: pre-wrap; text-align: left; line-height: 1.75; font-size: 14px;"&gt;&lt;SPAN style="font-family: 'Microsoft YaHei', STXihei; background-color: #ffffff;"&gt;In the SDK library, the CAN demo illustrates how to setup the CAN bus communication between two Can node, and it uses the CAN0.&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV style="white-space: pre-wrap; text-align: left; line-height: 1.75; font-size: 14px;"&gt;&lt;SPAN style="font-family: 'Microsoft YaHei', STXihei; background-color: #ffffff;"&gt;And you can learn the more information about the API of CAN module in the attachment.&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV style="white-space: pre-wrap; text-align: left; line-height: 1.75; font-size: 14px;"&gt;&lt;SPAN style="font-family: 'Microsoft YaHei', STXihei; background-color: #ffffff;"&gt;Hope it helps.&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV style="white-space: pre-wrap; text-align: left; line-height: 1.75; font-size: 14px;"&gt;Have a great day,&lt;/DIV&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;TIC&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;-----------------------------------------------------------------------------------------------------------------------&lt;BR /&gt;Note: If this post answers your question, please click the Correct Answer button. Thank you!&lt;BR /&gt;-----------------------------------------------------------------------------------------------------------------------&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 25 Apr 2018 02:44:11 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPC-Microcontrollers/LPC54608-CanBus-Driver/m-p/762851#M30708</guid>
      <dc:creator>jeremyzhou</dc:creator>
      <dc:date>2018-04-25T02:44:11Z</dc:date>
    </item>
    <item>
      <title>Re: LPC54608 CanBus Driver</title>
      <link>https://community.nxp.com/t5/LPC-Microcontrollers/LPC54608-CanBus-Driver/m-p/762852#M30709</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Okay then I move with can loopback example in SDK. But could not achieve the goal. I just want to see datas in my side.&lt;BR /&gt;My init code is below.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I know datas coming in 8 byte mode with 500kHz and has normal id. other nodes ids 0x000 and 0x002. I expect to see datas in picture 1 but I see datas like in picture 2. and datas in 2nd picture is meanless. There are 15 bytes ? and I see&lt;/P&gt;&lt;P&gt;that datas are coming even if I dont connect wires to bus. I know that's all are basic infos but I get stuck.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="picture1.jpg"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/5749i61495C607D6859D9/image-size/large?v=v2&amp;amp;px=999" role="button" title="picture1.jpg" alt="picture1.jpg" /&gt;&lt;/span&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="picture2.jpg"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/5903iC4963FBD01C0285C/image-size/large?v=v2&amp;amp;px=999" role="button" title="picture2.jpg" alt="picture2.jpg" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;#include "fsl_debug_console.h"&lt;BR /&gt;#include "fsl_mcan.h"&lt;BR /&gt;#include "board.h"&lt;BR /&gt;#include "pin_mux.h"&lt;BR /&gt;#include &amp;lt;stdbool.h&amp;gt;&lt;BR /&gt;/*******************************************************************************&lt;BR /&gt; * Definitions&lt;BR /&gt; ******************************************************************************/&lt;/P&gt;&lt;P&gt;#define MSG_RAM_BASE 0x20010000U&lt;BR /&gt;#define RX_FIFO0_OFS 0x10U&lt;BR /&gt;#define TX_BUFFER_OFS 0x20U&lt;BR /&gt;/*******************************************************************************&lt;BR /&gt; * Variables&lt;BR /&gt; ******************************************************************************/&lt;BR /&gt;volatile bool rxComplete = false;&lt;BR /&gt;mcan_rx_buffer_frame_t rxFrame;&lt;BR /&gt;/*******************************************************************************&lt;BR /&gt; * Code&lt;BR /&gt; ******************************************************************************/&lt;BR /&gt;void CAN0_IRQ0_IRQHandler(void)&lt;BR /&gt;{&lt;BR /&gt; MCAN_ClearStatusFlag(CAN0, CAN_IR_RF0N_MASK);&lt;BR /&gt; MCAN_ReadRxFifo(CAN0, 0, &amp;amp;rxFrame);&lt;BR /&gt; rxComplete = true;&lt;BR /&gt;}&lt;/P&gt;&lt;P&gt;int main(void)&lt;BR /&gt;{&lt;BR /&gt; mcan_config_t mcanConfig;&lt;BR /&gt; mcan_frame_filter_config_t rxFilter;&lt;BR /&gt; mcan_std_filter_element_config_t stdFilter;&lt;BR /&gt; mcan_rx_fifo_config_t rxFifo0;&lt;BR /&gt; mcan_tx_buffer_config_t txBuffer;&lt;BR /&gt; mcan_tx_buffer_frame_t txFrame;&lt;/P&gt;&lt;P&gt;/* Initialize board hardware. */&lt;BR /&gt; CLOCK_AttachClk(BOARD_DEBUG_UART_CLK_ATTACH);&lt;/P&gt;&lt;P&gt;/* Set MCAN clock 48/6=8MHz. */&lt;BR /&gt; CLOCK_SetClkDiv(kCLOCK_DivCan0Clk, 6U, true);&lt;/P&gt;&lt;P&gt;BOARD_InitPins();&lt;BR /&gt; BOARD_BootClockFROHF48M();&lt;BR /&gt; BOARD_InitDebugConsole();&lt;/P&gt;&lt;P&gt;MCAN_GetDefaultConfig(&amp;amp;mcanConfig);&lt;BR /&gt; &lt;STRONG&gt;mcanConfig.enableCanfdNormal = true;&lt;/STRONG&gt;&lt;BR /&gt; MCAN_Init(CAN0, &amp;amp;mcanConfig, CLOCK_GetFreq(kCLOCK_MCAN0));&lt;/P&gt;&lt;P&gt;/* Set Message RAM base address and clear to avoid BEU/BEC error. */&lt;BR /&gt; MCAN_SetMsgRAMBase(CAN0, MSG_RAM_BASE);&lt;BR /&gt; uint32_t *p=(uint32_t *)(MSG_RAM_BASE);&lt;BR /&gt; memset(p, 0, TX_BUFFER_OFS + 0x10U);&lt;/P&gt;&lt;P&gt;/* STD filter config. */&lt;BR /&gt; &lt;STRONG&gt;rxFilter.address = 0x000;&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt; rxFilter.idFormat = kMCAN_FrameIDStandard;&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt; rxFilter.listSize = 1U;&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt; rxFilter.nmFrame = kMCAN_reject0;&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt; rxFilter.remFrame = kMCAN_rejectFrame;&lt;/STRONG&gt;&lt;BR /&gt; MCAN_SetFilterConfig(CAN0, &amp;amp;rxFilter);&lt;/P&gt;&lt;P&gt;stdFilter.sfec = kMCAN_storeinFifo0;&lt;BR /&gt; /* Classic filter mode, only filter matching ID. */&lt;BR /&gt; &lt;STRONG&gt;stdFilter.sft = kMCAN_dual;&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt; stdFilter.sfid1 = 0x000U;&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt; stdFilter.sfid2 = 0x002U;&lt;/STRONG&gt;&lt;BR /&gt; MCAN_SetSTDFilterElement(CAN0, &amp;amp;rxFilter, &amp;amp;stdFilter, 0);&lt;/P&gt;&lt;P&gt;/* RX fifo0 config. */&lt;BR /&gt; &lt;STRONG&gt;rxFifo0.address = RX_FIFO0_OFS;&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt; rxFifo0.elementSize = 1U;&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt; rxFifo0.watermark = 0;&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt; rxFifo0.opmode = kMCAN_FifoBlocking;&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;rxFifo0.datafieldSize = kMCAN_8ByteDatafield;&lt;/STRONG&gt;&lt;BR /&gt; MCAN_SetRxFifo0Config(CAN0, &amp;amp;rxFifo0);&lt;/P&gt;&lt;P&gt;/* Enter normal mode. */&lt;BR /&gt; MCAN_EnterNormalMode(CAN0);&lt;/P&gt;&lt;P&gt;while (1)&lt;BR /&gt; {&lt;BR /&gt; PRINTF("\n Received Frame ID: 0x%x\r\n", rxFrame.id);&lt;BR /&gt; PRINTF("Received Frame DATA: ");&lt;BR /&gt; while(&lt;STRONG&gt;rxFrame.dlc&lt;/STRONG&gt;--)&lt;BR /&gt; {&lt;BR /&gt; PRINTF("0x%x ", *(rxFrame.data++));&lt;BR /&gt; }&lt;BR /&gt; }&lt;BR /&gt;}&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 26 Apr 2018 08:41:58 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPC-Microcontrollers/LPC54608-CanBus-Driver/m-p/762852#M30709</guid>
      <dc:creator>fatihozen</dc:creator>
      <dc:date>2018-04-26T08:41:58Z</dc:date>
    </item>
    <item>
      <title>Re: LPC54608 CanBus Driver</title>
      <link>https://community.nxp.com/t5/LPC-Microcontrollers/LPC54608-CanBus-Driver/m-p/762853#M30710</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi jeremyzhou,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I did sth but now have a new problem, I see some datas, receiving datas in fifo0 but I don't know how to see them in buffer.&amp;nbsp;&lt;BR /&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/13439i73B69EA26C7EB1DE/image-size/large?v=v2&amp;amp;px=999" role="button" title="pastedImage_1.png" alt="pastedImage_1.png" /&gt;&lt;/span&gt;&lt;BR /&gt;These are datas I want to see but don't know how to use them. For example I want to use switch case structure according to first data but I don't know how. Could you help me ?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;#include "fsl_debug_console.h"&lt;BR /&gt;#include "fsl_mcan.h"&lt;BR /&gt;#include "board.h"&lt;/P&gt;&lt;P&gt;#include "pin_mux.h"&lt;BR /&gt;#include &amp;lt;stdbool.h&amp;gt;&lt;BR /&gt;&lt;BR /&gt;#define EXAMPLE_MCAN_IRQHandler CAN0_IRQ0_IRQHandler&lt;BR /&gt;#define EXAMPLE_MCAN_IRQn CAN0_IRQ0_IRQn&lt;BR /&gt;#define EXAMPLE_MCAN CAN0&lt;BR /&gt;#define MCAN_CLK_FREQ CLOCK_GetFreq(kCLOCK_MCAN0)&lt;BR /&gt;#define STDID_OFFSET 18U&lt;BR /&gt;#define MSG_RAM_BASE 0x20010000U&lt;BR /&gt;#define STD_FILTER_OFS 0x0&lt;BR /&gt;#define RX_FIFO0_OFS 0x100U//0x10U&lt;BR /&gt;#define TX_BUFFER_OFS 0x20U&lt;BR /&gt;int8_t count;&lt;BR /&gt;uint8_t RB[8];&lt;BR /&gt;/*******************************************************************************&lt;BR /&gt; * Prototypes&lt;BR /&gt; ******************************************************************************/&lt;/P&gt;&lt;P&gt;/*******************************************************************************&lt;BR /&gt; * Variables&lt;BR /&gt; ******************************************************************************/&lt;BR /&gt;volatile bool rxComplete = false;&lt;BR /&gt;mcan_rx_buffer_frame_t rxFrame;&lt;/P&gt;&lt;P&gt;mcan_fifo_transfer_t rxXfer;&lt;BR /&gt;mcan_handle_t mcanHandle;&lt;BR /&gt;/*******************************************************************************&lt;BR /&gt; * Code&lt;BR /&gt; ******************************************************************************/&lt;/P&gt;&lt;P&gt;void CAN0_IRQ0_IRQHandler(void)&lt;BR /&gt;{&lt;BR /&gt; MCAN_ClearStatusFlag(EXAMPLE_MCAN, CAN_IR_RF0N_MASK);&lt;BR /&gt; MCAN_ReadRxFifo(EXAMPLE_MCAN, 0, &amp;amp;rxFrame);&lt;BR /&gt;// MCAN_ReadRxBuffer(CAN0, 18U, &amp;amp;rxFrame);&lt;BR /&gt; rxComplete = true;&lt;BR /&gt; /* Add for ARM errata 838869, affects Cortex-M4, Cortex-M4F Store immediate overlapping&lt;BR /&gt; exception return operation might vector to incorrect interrupt */&lt;BR /&gt;#if defined __CORTEX_M &amp;amp;&amp;amp; (__CORTEX_M == 4U)&lt;BR /&gt; __DSB();&lt;BR /&gt;#endif&lt;BR /&gt;}&lt;/P&gt;&lt;P&gt;/*!&lt;BR /&gt; * @brief Main function&lt;BR /&gt; */&lt;BR /&gt;int main(void)&lt;BR /&gt;{&lt;BR /&gt; mcan_config_t mcanConfig;&lt;BR /&gt; mcan_frame_filter_config_t rxFilter;&lt;BR /&gt; mcan_std_filter_element_config_t stdFilter;&lt;BR /&gt; mcan_rx_fifo_config_t rxFifo0;&lt;BR /&gt; mcan_rx_buffer_config_t rxBuffer;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt; /* Initialize board hardware. */&lt;BR /&gt; /* attach 12 MHz clock to FLEXCOMM0 (debug console) */&lt;BR /&gt; CLOCK_AttachClk(BOARD_DEBUG_UART_CLK_ATTACH);&lt;/P&gt;&lt;P&gt;/* Set MCAN clock 48/6=8MHz. */&lt;BR /&gt; CLOCK_SetClkDiv(kCLOCK_DivCan0Clk, 22U, true);&lt;/P&gt;&lt;P&gt;BOARD_InitPins();&lt;BR /&gt;// BOARD_BootClockFROHF48M();&lt;BR /&gt; BOARD_BootClockPLL180M();&lt;BR /&gt; BOARD_InitDebugConsole();&lt;/P&gt;&lt;P&gt;MCAN_GetDefaultConfig(&amp;amp;mcanConfig);&lt;BR /&gt;// mcanConfig.enableLoopBackExt = true;&lt;BR /&gt;// mcanConfig.enableCanfdNormal = true;&lt;BR /&gt; MCAN_Init(EXAMPLE_MCAN, &amp;amp;mcanConfig, MCAN_CLK_FREQ);&lt;/P&gt;&lt;P&gt;/* Set Message RAM base address and clear to avoid BEU/BEC error. */&lt;BR /&gt; MCAN_SetMsgRAMBase(EXAMPLE_MCAN, MSG_RAM_BASE);&lt;BR /&gt; uint32_t *p=(uint32_t *)(MSG_RAM_BASE);&lt;BR /&gt; memset(p, 0, TX_BUFFER_OFS + 0x10U);&lt;/P&gt;&lt;P&gt;/* STD filter config. */&lt;BR /&gt;// rxFilter.address = 0x100;&lt;BR /&gt;// rxFilter.idFormat = kMCAN_FrameIDStandard;&lt;BR /&gt;// rxFilter.listSize = 1U;&lt;BR /&gt;// rxFilter.nmFrame = kMCAN_reject0;&lt;BR /&gt;// rxFilter.remFrame = kMCAN_rejectFrame;&lt;BR /&gt;// MCAN_SetFilterConfig(EXAMPLE_MCAN, &amp;amp;rxFilter);&lt;BR /&gt; &lt;BR /&gt; stdFilter.sfec = kMCAN_storeinFifo0;&lt;BR /&gt;// stdFilter.sft = kMCAN_dual;&lt;BR /&gt;// stdFilter.sfid1 = 0x002U;&lt;BR /&gt;// stdFilter.sfid2 = 0x000U;&lt;BR /&gt; MCAN_SetSTDFilterElement(EXAMPLE_MCAN, &amp;amp;rxFilter, &amp;amp;stdFilter, 0);&lt;/P&gt;&lt;P&gt;/* RX fifo0 config. */&lt;BR /&gt; rxFifo0.address = RX_FIFO0_OFS;&lt;BR /&gt; rxFifo0.elementSize = 1U;&lt;BR /&gt; rxFifo0.watermark = 0;&lt;BR /&gt; rxFifo0.opmode = kMCAN_FifoBlocking;&lt;BR /&gt; rxFifo0.datafieldSize = kMCAN_8ByteDatafield;&lt;/P&gt;&lt;P&gt;MCAN_SetRxFifo0Config(EXAMPLE_MCAN, &amp;amp;rxFifo0);&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;// rxBuffer.address = RX_FIFO0_OFS;;&lt;BR /&gt;// rxBuffer.datafieldSize = kMCAN_8ByteDatafield;&lt;BR /&gt;// MCAN_SetRxBufferConfig(EXAMPLE_MCAN, &amp;amp;rxBuffer);&lt;/P&gt;&lt;P&gt;/* Enable RX fifo0 new message interrupt using interrupt line 0. */&lt;BR /&gt; MCAN_EnableInterrupts(EXAMPLE_MCAN, 0, CAN_IE_RF0NE_MASK);&lt;BR /&gt; EnableIRQ(CAN0_IRQ0_IRQn);&lt;/P&gt;&lt;P&gt;/* Enter normal mode. */&lt;BR /&gt; MCAN_EnterNormalMode(EXAMPLE_MCAN);&lt;/P&gt;&lt;P&gt;&lt;BR /&gt; while (1)&lt;BR /&gt; {&lt;BR /&gt; while(!rxComplete)&lt;BR /&gt; {&lt;BR /&gt; }&lt;BR /&gt; PRINTF("ID: %3x", rxFrame.id &amp;gt;&amp;gt; 18);&lt;BR /&gt; PRINTF(" DATA: ");&lt;BR /&gt; count = 9U;&lt;BR /&gt; while(--count)&lt;BR /&gt; {&lt;BR /&gt; PRINTF("0x%x ", *(rxFrame.data++));&lt;BR /&gt; }&lt;BR /&gt; while(++count &amp;lt; 9U)&lt;BR /&gt; {&lt;BR /&gt; rxFrame.data--;&lt;BR /&gt; }&lt;BR /&gt; PRINTF("\r\n");&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;}&lt;BR /&gt;}&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 07 May 2018 06:46:06 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPC-Microcontrollers/LPC54608-CanBus-Driver/m-p/762853#M30710</guid>
      <dc:creator>fatihozen</dc:creator>
      <dc:date>2018-05-07T06:46:06Z</dc:date>
    </item>
    <item>
      <title>Re: LPC54608 CanBus Driver</title>
      <link>https://community.nxp.com/t5/LPC-Microcontrollers/LPC54608-CanBus-Driver/m-p/762854#M30711</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;DIV style="white-space: pre-wrap; text-align: left; line-height: 1.75; font-size: 14px;"&gt;Hi &lt;A _jive_internal="true" href="https://community.nxp.com/people/fatihozen"&gt;&lt;SPAN style="color: #003884; text-decoration: underline;"&gt;fatih ozen&lt;/SPAN&gt;&lt;/A&gt;,&lt;/DIV&gt;&lt;DIV style="white-space: pre-wrap; text-align: left; line-height: 1.75; font-size: 14px;"&gt;I'm not very clear with your qustion, whether you want to recognize the particularr frame via checking the first byte in its format.&lt;/DIV&gt;&lt;DIV style="white-space: pre-wrap; text-align: left; line-height: 1.75; font-size: 14px;"&gt;If yes, it's eaisy to do it, as the recevied frame will be stored via the MCAN_ReadRxFifo function in the CAN0_IRQ0_IRQHandler function.&lt;/DIV&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Have a great day,&lt;BR /&gt;TIC&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;-----------------------------------------------------------------------------------------------------------------------&lt;BR /&gt;Note: If this post answers your question, please click the Correct Answer button. Thank you!&lt;BR /&gt;-----------------------------------------------------------------------------------------------------------------------&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 07 May 2018 08:23:01 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPC-Microcontrollers/LPC54608-CanBus-Driver/m-p/762854#M30711</guid>
      <dc:creator>jeremyzhou</dc:creator>
      <dc:date>2018-05-07T08:23:01Z</dc:date>
    </item>
    <item>
      <title>Re: LPC54608 CanBus Driver</title>
      <link>https://community.nxp.com/t5/LPC-Microcontrollers/LPC54608-CanBus-Driver/m-p/762855#M30712</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;SPAN class="" style="color: #646464; background-color: #ffffff; border: 0px; font-weight: 200; font-size: 1.286rem; padding: 0px 0px 0px 30px;"&gt;&lt;SPAN class="" style="border: 0px; font-weight: inherit; font-size: 18.004px;"&gt;Hi &lt;A class="jx-jive-macro-user" href="https://community.nxp.com/people/jeremyzhou"&gt;jeremyzhou&lt;/A&gt;‌&lt;SPAN style="color: #646464; font-size: 18.004px;"&gt;,&lt;BR /&gt;&lt;BR /&gt;I know my questions are simple but I'm trying to achieve the goal. According to code below I wait to see some output if any byte in frame is 0xa. But I am missing something I don't know.&amp;nbsp;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;while(!rxComplete)&lt;BR /&gt; {&lt;BR /&gt; }&lt;BR /&gt; PRINTF("ID: %3x", rxFrame.id &amp;gt;&amp;gt; 18);&lt;BR /&gt; PRINTF(" DATA: ");&lt;BR /&gt; count = 9U;&lt;BR /&gt; while(--count)&lt;BR /&gt; {&lt;BR /&gt; PRINTF("0x%x ", *(rxFrame.data++));&lt;/P&gt;&lt;P&gt;}&lt;/P&gt;&lt;P&gt;&lt;BR /&gt; while(++count &amp;lt; 9U)&lt;BR /&gt; {&lt;BR /&gt; rxFrame.data--;&lt;BR /&gt; }&lt;/P&gt;&lt;P&gt;if(rxFrame.data[0] == 0xa)&lt;BR /&gt; {PRINTF("1112");}&lt;BR /&gt; if(rxFrame.data[1] == 0xa)&lt;BR /&gt; {PRINTF("1113");}&lt;BR /&gt; if(rxFrame.data[2] == 0xa)&lt;BR /&gt; {PRINTF("1114");}&lt;BR /&gt; if(rxFrame.data[3] == 0xa)&lt;BR /&gt; {PRINTF("1115");}&lt;BR /&gt; if(rxFrame.data[4] == 0xa)&lt;BR /&gt; {PRINTF("1116");}&lt;BR /&gt; if(rxFrame.data[5] == 0xa)&lt;BR /&gt; {PRINTF("1117");}&lt;BR /&gt; if(rxFrame.data[6] == 0xa)&lt;BR /&gt; {PRINTF("1118");}&lt;BR /&gt; if(rxFrame.data[7] == 0xa)&lt;BR /&gt; {PRINTF("1119");}&lt;/P&gt;&lt;P&gt;PRINTF("\r\n");&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;}&lt;/P&gt;&lt;P&gt;&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/20889i79B43CC180BEDABB/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;SPAN class="" style="color: #646464; background-color: #ffffff; border: 0px; font-weight: 200; font-size: 1.286rem; padding: 0px 0px 0px 30px;"&gt;&lt;SPAN style="border: 0px; color: #646464; font-weight: inherit; font-size: 18.004px;"&gt;According to this output I did or understand something wrong. Could you tell me what is the missing point ?&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 07 May 2018 10:29:43 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPC-Microcontrollers/LPC54608-CanBus-Driver/m-p/762855#M30712</guid>
      <dc:creator>fatihozen</dc:creator>
      <dc:date>2018-05-07T10:29:43Z</dc:date>
    </item>
    <item>
      <title>Re: LPC54608 CanBus Driver</title>
      <link>https://community.nxp.com/t5/LPC-Microcontrollers/LPC54608-CanBus-Driver/m-p/762856#M30713</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi&amp;nbsp;&lt;A _jive_internal="true" data-content-finding="Community" data-userid="314339" data-username="fatihozen" href="https://community.nxp.com/people/fatihozen" rel="nofollow noopener noreferrer" style="color: #5e89c1; background-color: #ffffff; border: 0px; font-weight: 200; text-decoration: none; font-size: 1.286rem;" target="_blank"&gt;fatih ozen&lt;/A&gt;,&lt;/P&gt;&lt;P&gt;Thanks for your reply.&lt;/P&gt;&lt;P&gt;Giving a try the following code.&lt;/P&gt;&lt;PRE class="language-c line-numbers"&gt;&lt;CODE&gt;&lt;SPAN class="keyword token"&gt;while&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="operator token"&gt;!&lt;/SPAN&gt;rxComplete&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;
&lt;SPAN class="punctuation token"&gt;{&lt;/SPAN&gt;
&lt;SPAN class="punctuation token"&gt;}&lt;/SPAN&gt;

&lt;SPAN class="keyword token"&gt;if&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;rxFrame&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;data&lt;SPAN class="punctuation token"&gt;[&lt;/SPAN&gt;&lt;SPAN class="number token"&gt;0&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;]&lt;/SPAN&gt; &lt;SPAN class="operator token"&gt;==&lt;/SPAN&gt; &lt;SPAN class="number token"&gt;0xa&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;
&lt;SPAN class="punctuation token"&gt;{&lt;/SPAN&gt;&lt;SPAN class="token function"&gt;PRINTF&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="string token"&gt;"1112"&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;;&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;}&lt;/SPAN&gt;
&lt;SPAN class="keyword token"&gt;if&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;rxFrame&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;data&lt;SPAN class="punctuation token"&gt;[&lt;/SPAN&gt;&lt;SPAN class="number token"&gt;1&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;]&lt;/SPAN&gt; &lt;SPAN class="operator token"&gt;==&lt;/SPAN&gt; &lt;SPAN class="number token"&gt;0xa&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;
&lt;SPAN class="punctuation token"&gt;{&lt;/SPAN&gt;&lt;SPAN class="token function"&gt;PRINTF&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="string token"&gt;"1113"&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;;&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;}&lt;/SPAN&gt;
&lt;SPAN class="keyword token"&gt;if&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;rxFrame&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;data&lt;SPAN class="punctuation token"&gt;[&lt;/SPAN&gt;&lt;SPAN class="number token"&gt;2&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;]&lt;/SPAN&gt; &lt;SPAN class="operator token"&gt;==&lt;/SPAN&gt; &lt;SPAN class="number token"&gt;0xa&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;
&lt;SPAN class="punctuation token"&gt;{&lt;/SPAN&gt;&lt;SPAN class="token function"&gt;PRINTF&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="string token"&gt;"1114"&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;;&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;}&lt;/SPAN&gt;
&lt;SPAN class="keyword token"&gt;if&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;rxFrame&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;data&lt;SPAN class="punctuation token"&gt;[&lt;/SPAN&gt;&lt;SPAN class="number token"&gt;3&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;]&lt;/SPAN&gt; &lt;SPAN class="operator token"&gt;==&lt;/SPAN&gt; &lt;SPAN class="number token"&gt;0xa&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;
&lt;SPAN class="punctuation token"&gt;{&lt;/SPAN&gt;&lt;SPAN class="token function"&gt;PRINTF&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="string token"&gt;"1115"&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;;&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;}&lt;/SPAN&gt;
&lt;SPAN class="keyword token"&gt;if&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;rxFrame&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;data&lt;SPAN class="punctuation token"&gt;[&lt;/SPAN&gt;&lt;SPAN class="number token"&gt;4&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;]&lt;/SPAN&gt; &lt;SPAN class="operator token"&gt;==&lt;/SPAN&gt; &lt;SPAN class="number token"&gt;0xa&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;
&lt;SPAN class="punctuation token"&gt;{&lt;/SPAN&gt;&lt;SPAN class="token function"&gt;PRINTF&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="string token"&gt;"1116"&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;;&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;}&lt;/SPAN&gt;
&lt;SPAN class="keyword token"&gt;if&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;rxFrame&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;data&lt;SPAN class="punctuation token"&gt;[&lt;/SPAN&gt;&lt;SPAN class="number token"&gt;5&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;]&lt;/SPAN&gt; &lt;SPAN class="operator token"&gt;==&lt;/SPAN&gt; &lt;SPAN class="number token"&gt;0xa&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;
&lt;SPAN class="punctuation token"&gt;{&lt;/SPAN&gt;&lt;SPAN class="token function"&gt;PRINTF&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="string token"&gt;"1117"&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;;&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;}&lt;/SPAN&gt;
&lt;SPAN class="keyword token"&gt;if&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;rxFrame&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;data&lt;SPAN class="punctuation token"&gt;[&lt;/SPAN&gt;&lt;SPAN class="number token"&gt;6&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;]&lt;/SPAN&gt; &lt;SPAN class="operator token"&gt;==&lt;/SPAN&gt; &lt;SPAN class="number token"&gt;0xa&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;
&lt;SPAN class="punctuation token"&gt;{&lt;/SPAN&gt;&lt;SPAN class="token function"&gt;PRINTF&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="string token"&gt;"1118"&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;;&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;}&lt;/SPAN&gt;
&lt;SPAN class="keyword token"&gt;if&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;rxFrame&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;data&lt;SPAN class="punctuation token"&gt;[&lt;/SPAN&gt;&lt;SPAN class="number token"&gt;7&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;]&lt;/SPAN&gt; &lt;SPAN class="operator token"&gt;==&lt;/SPAN&gt; &lt;SPAN class="number token"&gt;0xa&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;
&lt;SPAN class="punctuation token"&gt;{&lt;/SPAN&gt;&lt;SPAN class="token function"&gt;PRINTF&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="string token"&gt;"1119"&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;;&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;}&lt;/SPAN&gt;

&lt;SPAN class="token function"&gt;PRINTF&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="string token"&gt;"\r\n"&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;;&lt;/SPAN&gt;

&lt;SPAN class="punctuation token"&gt;}&lt;/SPAN&gt;

&lt;SPAN class="token function"&gt;PRINTF&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="string token"&gt;"ID: %3x"&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; rxFrame&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;id &lt;SPAN class="operator token"&gt;&amp;gt;&amp;gt;&lt;/SPAN&gt; &lt;SPAN class="number token"&gt;18&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;;&lt;/SPAN&gt;
&lt;SPAN class="token function"&gt;PRINTF&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="string token"&gt;" DATA: "&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;;&lt;/SPAN&gt;
count &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; &lt;SPAN class="number token"&gt;9U&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;;&lt;/SPAN&gt;
&lt;SPAN class="keyword token"&gt;while&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="operator token"&gt;--&lt;/SPAN&gt;count&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;
&lt;SPAN class="punctuation token"&gt;{&lt;/SPAN&gt;
&lt;SPAN class="token function"&gt;PRINTF&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="string token"&gt;"0x%x "&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; &lt;SPAN class="operator token"&gt;*&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;rxFrame&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;data&lt;SPAN class="operator token"&gt;++&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;;&lt;/SPAN&gt;

&lt;SPAN class="punctuation token"&gt;}&lt;/SPAN&gt;




&lt;SPAN class="line-numbers-rows"&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P style="color: #51626f; background-color: #ffffff; border: 0px;"&gt;Have a great day,&lt;BR /&gt;TIC&lt;/P&gt;&lt;P style="color: #51626f; background-color: #ffffff; border: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P style="color: #51626f; background-color: #ffffff; border: 0px;"&gt;-----------------------------------------------------------------------------------------------------------------------&lt;BR /&gt;Note: If this post answers your question, please click the Correct Answer button. Thank you!&lt;BR /&gt;-----------------------------------------------------------------------------------------------------------------------&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 08 May 2018 06:47:31 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPC-Microcontrollers/LPC54608-CanBus-Driver/m-p/762856#M30713</guid>
      <dc:creator>jeremyzhou</dc:creator>
      <dc:date>2018-05-08T06:47:31Z</dc:date>
    </item>
    <item>
      <title>Re: LPC54608 CanBus Driver</title>
      <link>https://community.nxp.com/t5/LPC-Microcontrollers/LPC54608-CanBus-Driver/m-p/762857#M30714</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello &lt;A class="jx-jive-macro-user" href="https://community.nxp.com/people/jeremyzhou"&gt;jeremyzhou&lt;/A&gt;‌,&lt;BR /&gt;Thanks for reply.&lt;BR /&gt;The following code is not doing what I want to. I am not sure I can reach datas via&amp;nbsp; " rxFrame.data[0-8] ".&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 08 May 2018 09:15:28 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPC-Microcontrollers/LPC54608-CanBus-Driver/m-p/762857#M30714</guid>
      <dc:creator>fatihozen</dc:creator>
      <dc:date>2018-05-08T09:15:28Z</dc:date>
    </item>
    <item>
      <title>Re: LPC54608 CanBus Driver</title>
      <link>https://community.nxp.com/t5/LPC-Microcontrollers/LPC54608-CanBus-Driver/m-p/762858#M30715</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;It is okay now. I defined new array and matched it with rxFrame.data. It is working now.&lt;BR /&gt;&lt;SPAN&gt;for(int a=0;a&amp;lt;8;a++) {mydata[a] = rxFrame.data[a];}&lt;/SPAN&gt;&lt;BR /&gt;Code is below for someone stucks here. Thanks &lt;A class="jx-jive-macro-user" href="https://community.nxp.com/people/jeremyzhou"&gt;jeremyzhou&lt;/A&gt;‌&lt;BR /&gt;&lt;BR /&gt;#include "fsl_debug_console.h"&lt;BR /&gt;#include "fsl_mcan.h"&lt;BR /&gt;#include "board.h"&lt;BR /&gt;#include "pin_mux.h"&lt;BR /&gt;#include &amp;lt;stdbool.h&amp;gt;&lt;BR /&gt;/*******************************************************************************&lt;BR /&gt; * Definitions&lt;BR /&gt; ******************************************************************************/&lt;BR /&gt;#define EXAMPLE_MCAN_IRQHandler CAN0_IRQ0_IRQHandler&lt;BR /&gt;#define EXAMPLE_MCAN_IRQn CAN0_IRQ0_IRQn&lt;BR /&gt;#define EXAMPLE_MCAN CAN0&lt;BR /&gt;#define MCAN_CLK_FREQ CLOCK_GetFreq(kCLOCK_MCAN0)&lt;BR /&gt;#define STDID_OFFSET 18U&lt;BR /&gt;#define MSG_RAM_BASE 0x20010000U&lt;BR /&gt;#define STD_FILTER_OFS 0x0&lt;BR /&gt;#define RX_FIFO0_OFS 0x10U&lt;BR /&gt;#define TX_BUFFER_OFS 0x20U&lt;BR /&gt;/*******************************************************************************&lt;BR /&gt; * Prototypes&lt;BR /&gt; ******************************************************************************/&lt;/P&gt;&lt;P&gt;/*******************************************************************************&lt;BR /&gt; * Variables&lt;BR /&gt; ******************************************************************************/&lt;BR /&gt;volatile bool rxComplete = false;&lt;BR /&gt;mcan_rx_buffer_frame_t rxFrame;&lt;BR /&gt;mcan_fifo_transfer_t rxXfer;&lt;BR /&gt;mcan_handle_t mcanHandle;&lt;BR /&gt;/*******************************************************************************&lt;BR /&gt; * Code&lt;BR /&gt; ******************************************************************************/&lt;/P&gt;&lt;P&gt;void CAN0_IRQ0_IRQHandler(void)&lt;BR /&gt;{&lt;BR /&gt; MCAN_ClearStatusFlag(EXAMPLE_MCAN, CAN_IR_RF0N_MASK);&lt;BR /&gt; MCAN_ReadRxFifo(EXAMPLE_MCAN, 0, &amp;amp;rxFrame);&lt;BR /&gt; rxComplete = true;&lt;BR /&gt; /* Add for ARM errata 838869, affects Cortex-M4, Cortex-M4F Store immediate overlapping&lt;BR /&gt; exception return operation might vector to incorrect interrupt */&lt;BR /&gt;#if defined __CORTEX_M &amp;amp;&amp;amp; (__CORTEX_M == 4U)&lt;BR /&gt; __DSB();&lt;BR /&gt;#endif&lt;BR /&gt;}&lt;/P&gt;&lt;P&gt;int main(void)&lt;BR /&gt;{&lt;BR /&gt; mcan_config_t mcanConfig;&lt;BR /&gt; mcan_frame_filter_config_t rxFilter;&lt;BR /&gt; mcan_std_filter_element_config_t stdFilter;&lt;BR /&gt; mcan_rx_fifo_config_t rxFifo0;&lt;/P&gt;&lt;P&gt;/* Initialize board hardware. */&lt;BR /&gt; /* attach 12 MHz clock to FLEXCOMM0 (debug console) */&lt;BR /&gt; CLOCK_AttachClk(BOARD_DEBUG_UART_CLK_ATTACH);&lt;/P&gt;&lt;P&gt;/* Set MCAN clock 48/6=8MHz. */&lt;BR /&gt; CLOCK_SetClkDiv(kCLOCK_DivCan0Clk, 6U, true);&lt;/P&gt;&lt;P&gt;BOARD_InitPins();&lt;BR /&gt; BOARD_BootClockFROHF48M();&lt;BR /&gt; BOARD_InitDebugConsole();&lt;/P&gt;&lt;P&gt;MCAN_GetDefaultConfig(&amp;amp;mcanConfig);&lt;BR /&gt; MCAN_Init(EXAMPLE_MCAN, &amp;amp;mcanConfig, MCAN_CLK_FREQ);&lt;/P&gt;&lt;P&gt;/* Set Message RAM base address and clear to avoid BEU/BEC error. */&lt;BR /&gt; MCAN_SetMsgRAMBase(EXAMPLE_MCAN, MSG_RAM_BASE);&lt;BR /&gt; uint32_t *p=(uint32_t *)(MSG_RAM_BASE);&lt;BR /&gt; memset(p, 0, TX_BUFFER_OFS + 0x10U);&lt;/P&gt;&lt;P&gt;/* STD filter config. */&lt;BR /&gt; rxFilter.address = 0x0;&lt;BR /&gt; rxFilter.idFormat = kMCAN_FrameIDStandard;&lt;BR /&gt; rxFilter.listSize = 1U;&lt;BR /&gt; rxFilter.nmFrame = kMCAN_reject0;&lt;BR /&gt; rxFilter.remFrame = kMCAN_rejectFrame;&lt;BR /&gt; MCAN_SetFilterConfig(EXAMPLE_MCAN, &amp;amp;rxFilter);&lt;BR /&gt; &lt;BR /&gt; stdFilter.sfec = kMCAN_storeinFifo0;&lt;BR /&gt; MCAN_SetSTDFilterElement(EXAMPLE_MCAN, &amp;amp;rxFilter, &amp;amp;stdFilter, 0);&lt;/P&gt;&lt;P&gt;/* RX fifo0 config. */&lt;BR /&gt; rxFifo0.address = RX_FIFO0_OFS;&lt;BR /&gt; rxFifo0.elementSize = 1U;&lt;BR /&gt; rxFifo0.watermark = 0;&lt;BR /&gt; rxFifo0.opmode = kMCAN_FifoBlocking;&lt;BR /&gt; rxFifo0.datafieldSize = kMCAN_8ByteDatafield;&lt;BR /&gt; MCAN_SetRxFifo0Config(EXAMPLE_MCAN, &amp;amp;rxFifo0);&lt;/P&gt;&lt;P&gt;/* Enable RX fifo0 new message interrupt using interrupt line 0. */&lt;BR /&gt; MCAN_EnableInterrupts(EXAMPLE_MCAN, 0, CAN_IE_RF0NE_MASK);&lt;BR /&gt; EnableIRQ(CAN0_IRQ0_IRQn);&lt;/P&gt;&lt;P&gt;/* Enter normal mode. */&lt;BR /&gt; MCAN_EnterNormalMode(EXAMPLE_MCAN);&lt;/P&gt;&lt;P&gt;void test(void){&lt;BR /&gt; if(mydata[0] == 10) {PRINTF(" 0");} else {PRINTF(" -");}&lt;BR /&gt; }&lt;/P&gt;&lt;P&gt;while (1)&lt;BR /&gt; {&lt;BR /&gt; for(int a=0;a&amp;lt;8;a++) {mydata[a] = rxFrame.data[a];}&lt;BR /&gt; PRINTF("ID: %x", rxFrame.id &amp;gt;&amp;gt; 18);&lt;BR /&gt; PRINTF(" DATA: ");&lt;BR /&gt; for(int a=0;a&amp;lt;8;a++) {PRINTF(" %d",mydata[a]);}&lt;BR /&gt; test();&lt;BR /&gt; PRINTF("\r\n");&lt;BR /&gt; }&lt;BR /&gt;}&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 10 May 2018 10:58:35 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPC-Microcontrollers/LPC54608-CanBus-Driver/m-p/762858#M30715</guid>
      <dc:creator>fatihozen</dc:creator>
      <dc:date>2018-05-10T10:58:35Z</dc:date>
    </item>
    <item>
      <title>Re: LPC54608 CanBus Driver</title>
      <link>https://community.nxp.com/t5/LPC-Microcontrollers/LPC54608-CanBus-Driver/m-p/762859#M30716</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi &lt;A class="jx-jive-macro-user" href="https://community.nxp.com/people/jeremyzhou"&gt;jeremyzhou&lt;/A&gt;‌,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I know what datas I should see on my side on canbus. There is a problem again. When I use semihost console datas have expected values. In second byte(column) I must see all zeros.But if I use UART console I see there some non-zero values. What does cause this ?&lt;BR /&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="pastedImage_1.jpg"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/7613iA80FB6D8361A9235/image-size/large?v=v2&amp;amp;px=999" role="button" title="pastedImage_1.jpg" alt="pastedImage_1.jpg" /&gt;&lt;/span&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="pastedImage_2.jpg"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/7756iF22A5CA622E7F30B/image-size/large?v=v2&amp;amp;px=999" role="button" title="pastedImage_2.jpg" alt="pastedImage_2.jpg" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 21 May 2018 11:04:05 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPC-Microcontrollers/LPC54608-CanBus-Driver/m-p/762859#M30716</guid>
      <dc:creator>fatihozen</dc:creator>
      <dc:date>2018-05-21T11:04:05Z</dc:date>
    </item>
    <item>
      <title>Re: LPC54608 CanBus Driver</title>
      <link>https://community.nxp.com/t5/LPC-Microcontrollers/LPC54608-CanBus-Driver/m-p/1653886#M52593</link>
      <description>&lt;P&gt;This really isn't much help to anyone stuck on this. There are lots of errors when trying to build and undefined variables.&lt;/P&gt;</description>
      <pubDate>Fri, 19 May 2023 13:55:48 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPC-Microcontrollers/LPC54608-CanBus-Driver/m-p/1653886#M52593</guid>
      <dc:creator>williamcarlisle</dc:creator>
      <dc:date>2023-05-19T13:55:48Z</dc:date>
    </item>
    <item>
      <title>Re: LPC54608 CanBus Driver</title>
      <link>https://community.nxp.com/t5/LPC-Microcontrollers/LPC54608-CanBus-Driver/m-p/1653894#M52594</link>
      <description>With this code CAN0_IRQ0_IRQHandler never gets a call. I have a breakpoint in there and it never gets hit.</description>
      <pubDate>Fri, 19 May 2023 14:20:12 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPC-Microcontrollers/LPC54608-CanBus-Driver/m-p/1653894#M52594</guid>
      <dc:creator>williamcarlisle</dc:creator>
      <dc:date>2023-05-19T14:20:12Z</dc:date>
    </item>
  </channel>
</rss>

