<?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: MCAN communication in LPC Microcontrollers</title>
    <link>https://community.nxp.com/t5/LPC-Microcontrollers/MCAN-communication/m-p/1305227#M45815</link>
    <description>&lt;P&gt;&lt;a href="https://community.nxp.com/t5/user/viewprofilepage/user-id/137574"&gt;@frank_m&lt;/a&gt;&amp;nbsp;Thanks for your help.&lt;BR /&gt;Yes, I'm taking that into account, but it still doesn't work, I'm attaching the code part. The transmission seems to go through, but when I read the response, it doesn't match the id.&lt;/P&gt;&lt;P&gt;/******************************************************//**&lt;BR /&gt;** Definición de macros&lt;BR /&gt;*********************************************************/&lt;BR /&gt;#define TAM_BUFF 26&lt;BR /&gt;#define QUEUE_LENGTH 50&lt;BR /&gt;#define CAN_DATASIZE 26U&lt;BR /&gt;#define DATA_MCAN CAN0&lt;BR /&gt;//#define MCAN_CLK_FREQ CLOCK_GetMCanClkFreq(0)&lt;BR /&gt;#define USE_CANFD (0U)&lt;BR /&gt;//#define MCAN_CLK_FREQ 8000000U&lt;BR /&gt;#define MCAN_CLK_FREQ CLOCK_GetMCanClkFreq()&lt;/P&gt;&lt;P&gt;#define TX_BUFFER_OFS 0x20U&lt;BR /&gt;#define MSG_RAM_BASE 0x04000000U&lt;BR /&gt;#define msgRam MSG_RAM_BASE&lt;BR /&gt;#define MSG_RAM_SIZE (TX_BUFFER_OFS + 8 + CAN_DATASIZE)&lt;BR /&gt;#define BOARD_DEBUG_UART_CLK_ATTACH kFRO12M_to_FLEXCOMM0&lt;BR /&gt;#define STD_FILTER_OFS 0x0&lt;BR /&gt;#define RX_FIFO0_OFS 0x20U&lt;BR /&gt;/**********************************************************&lt;BR /&gt;** Variables privados&lt;BR /&gt;**********************************************************/&lt;BR /&gt;static TaskHandle_t _tskHandleSendCAN;&lt;BR /&gt;static QueueHandle_t _queueHandleBuff;&lt;BR /&gt;/// Variables para CAN&lt;BR /&gt;static TaskHandle_t _tskHandleCAN;&lt;BR /&gt;volatile bool rxComplete = false;&lt;BR /&gt;mcan_rx_buffer_frame_t rxFrame;&lt;BR /&gt;mcan_tx_buffer_frame_t txFrame;&lt;BR /&gt;uint8_t tx_data[CAN_DATASIZE];&lt;BR /&gt;uint8_t rx_data[CAN_DATASIZE];&lt;BR /&gt;//#ifndef MSG_RAM_BASE&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;mcan_handle_t mcanHandle;&lt;BR /&gt;//mcan_tx_buffer_frame_t mcanHandle;&lt;BR /&gt;mcan_buffer_transfer_t txXfer;&lt;BR /&gt;volatile bool txComplete = false;&lt;/P&gt;&lt;P&gt;void CAN0_IRQ0_IRQHandler(void)&lt;BR /&gt;{&lt;BR /&gt;MCAN_ClearStatusFlag(DATA_MCAN, CAN_IR_RF0N_MASK);&lt;BR /&gt;MCAN_ReadRxFifo(DATA_MCAN, 0, &amp;amp;rxFrame);&lt;BR /&gt;rxComplete = true;&lt;BR /&gt;SDK_ISR_EXIT_BARRIER;&lt;BR /&gt;}&lt;/P&gt;&lt;P&gt;static void _CANInit(void)&lt;BR /&gt;{&lt;BR /&gt;/* set BOD VBAT level to 1.65V */&lt;BR /&gt;POWER_SetBodVbatLevel(kPOWER_BodVbatLevel1650mv, kPOWER_BodHystLevel50mv, false);&lt;BR /&gt;// POWER_SetBodVbatLevel(kPOWER_BodVbatLevel3300mv, kPOWER_BodHystLevel25mv, false);&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 100Mhz/5=20MHz. */&lt;BR /&gt;CLOCK_SetClkDiv(kCLOCK_DivCanClk, 5U, true);&lt;BR /&gt;CLOCK_AttachClk(kMCAN_DIV_to_MCAN);&lt;BR /&gt;} //static void _CANInit(void)&lt;/P&gt;&lt;P&gt;///*! \fn static void _TskSendCAN (void)&lt;BR /&gt;// * \brief Envío de datos por el bus can.&lt;BR /&gt;// * \return Nada.&lt;BR /&gt;// */&lt;BR /&gt;static void _TskSendCAN(void)&lt;BR /&gt;{&lt;BR /&gt;// uint32_t *CANBuff;&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;uint8_t *CANBuff[26];&lt;BR /&gt;mcan_config_t mcanConfig;&lt;BR /&gt;mcan_tx_buffer_config_t txBuffer;&lt;BR /&gt;uint8_t numMessage = 0;&lt;BR /&gt;// LecDRACallBack(_RecDatCAN);&lt;BR /&gt;while (true)&lt;BR /&gt;{&lt;BR /&gt;// ulTaskNotifyTake(pdFALSE, portMAX_DELAY);!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!&lt;BR /&gt;// if (xQueueReceive(_queueHandleBuff, &amp;amp;CANBuff, portMAX_DELAY) != 0)&lt;BR /&gt;// {&lt;BR /&gt;// if (CANBuff != NULL)&lt;BR /&gt;// {&lt;BR /&gt;_CANInit();&lt;BR /&gt;MCAN_GetDefaultConfig(&amp;amp;mcanConfig);&lt;BR /&gt;mcanConfig.enableLoopBackExt = true;&lt;BR /&gt;// mcanConfig.enableLoopBackInt = false;&lt;BR /&gt;MCAN_Init(DATA_MCAN, &amp;amp;mcanConfig, MCAN_CLK_FREQ);&lt;BR /&gt;// MCAN_TransferCreateHandle(DATA_MCAN, &amp;amp;mcanHandle, mcan_callback, NULL);&lt;BR /&gt;MCAN_SetMsgRAMBase(DATA_MCAN, (uint32_t)msgRam);&lt;BR /&gt;memset((void *)msgRam, 0, MSG_RAM_SIZE * sizeof(uint8_t));&lt;/P&gt;&lt;P&gt;/* STD filter config. */&lt;BR /&gt;rxFilter.address = STD_FILTER_OFS;&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(DATA_MCAN, &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;stdFilter.sft = kMCAN_classic;&lt;BR /&gt;stdFilter.sfid1 = 0x123U;&lt;BR /&gt;stdFilter.sfid2 = 0x7FFU;&lt;BR /&gt;MCAN_SetSTDFilterElement(DATA_MCAN, &amp;amp;rxFilter, &amp;amp;stdFilter, 0);&lt;/P&gt;&lt;P&gt;&lt;BR /&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;#if (defined(USE_CANFD) &amp;amp;&amp;amp; USE_CANFD)&lt;BR /&gt;rxFifo0.datafieldSize = BYTES_IN_MB;&lt;BR /&gt;#endif&lt;BR /&gt;MCAN_SetRxFifo0Config(DATA_MCAN, &amp;amp;rxFifo0);&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;/* TX buffer config. */&lt;BR /&gt;memset(&amp;amp;txBuffer, 0, sizeof(txBuffer));&lt;BR /&gt;txBuffer.address = TX_BUFFER_OFS; //Dirección trama CAN 0X20&lt;BR /&gt;txBuffer.dedicatedSize = 1U;&lt;BR /&gt;txBuffer.fqSize = 0;&lt;BR /&gt;txBuffer.datafieldSize = kMCAN_8ByteDatafield;&lt;/P&gt;&lt;P&gt;MCAN_SetTxBufferConfig(DATA_MCAN, &amp;amp;txBuffer);&lt;/P&gt;&lt;P&gt;/* Enter normal mode. */&lt;BR /&gt;MCAN_EnterNormalMode(DATA_MCAN);&lt;/P&gt;&lt;P&gt;/* Config TX frame data. */&lt;BR /&gt;uint8_t cnt = 0;&lt;BR /&gt;memset(tx_data, 0, sizeof(uint8_t) * CAN_DATASIZE);&lt;BR /&gt;tx_data[0] = 58;&lt;BR /&gt;for (cnt = 1; cnt &amp;lt; CAN_DATASIZE; cnt++)&lt;BR /&gt;{&lt;BR /&gt;// tx_data[cnt] = *CANBuff[cnt]; //Aquí se almacenan los datos del Buffer&lt;BR /&gt;// tx_data[cnt] = _anlBuffer[cnt];&lt;BR /&gt;tx_data[cnt] = cnt;&lt;BR /&gt;}&lt;BR /&gt;//** Valores de configuración del CAN**//&lt;BR /&gt;txFrame.xtd = kMCAN_FrameIDStandard;&lt;BR /&gt;txFrame.rtr = kMCAN_FrameTypeData;&lt;BR /&gt;txFrame.fdf = 0;&lt;BR /&gt;txFrame.brs = 0;&lt;BR /&gt;txFrame.dlc = 8U;&lt;BR /&gt;txFrame.id = 31;&lt;BR /&gt;txFrame.data = tx_data;&lt;BR /&gt;txFrame.size = CAN_DATASIZE;&lt;BR /&gt;#if (defined(USE_CANFD) &amp;amp;&amp;amp; USE_CANFD)&lt;BR /&gt;txFrame.fdf = 1;&lt;BR /&gt;txFrame.brs = 1;&lt;BR /&gt;txFrame.dlc = DLC;&lt;BR /&gt;#endif&lt;BR /&gt;// txXfer.frame = &amp;amp;txFrame;&lt;BR /&gt;// txXfer.bufferIdx = 0;&lt;BR /&gt;// MCAN_TransferSendNonBlocking(DATA_MCAN, &amp;amp;mcanHandle, &amp;amp;txXfer);&lt;BR /&gt;MCAN_TransferSendBlocking(DATA_MCAN, 0, &amp;amp;txFrame);&lt;BR /&gt;// vTaskDelay(1000);&lt;BR /&gt;// while (!txComplete)&lt;BR /&gt;// {&lt;BR /&gt;// }&lt;BR /&gt;// txComplete = false;&lt;BR /&gt;// }&lt;BR /&gt;// vPortFree(CANBuff);&lt;BR /&gt;// }&lt;BR /&gt;//////////////////////////////////////////////////////////&lt;BR /&gt;MCAN_ReadRxBuffer(DATA_MCAN,0,&amp;amp;rxFrame);&lt;/P&gt;&lt;P&gt;//////////////////////////////////////////////////////////&lt;BR /&gt;} // while (true)&lt;/P&gt;&lt;P&gt;} // void _TskSendCAN(void)&lt;/P&gt;&lt;P&gt;/**********************************************************&lt;BR /&gt;** Métodos públicos&lt;BR /&gt;**********************************************************/&lt;BR /&gt;/*! \fn void ModCANInit(void)&lt;BR /&gt;* \brief Inicializa el módulo CAN.&lt;BR /&gt;* \return Nada.&lt;BR /&gt;*/&lt;BR /&gt;void ModCANInit(void)&lt;BR /&gt;{&lt;BR /&gt;BaseType_t xReturned;&lt;BR /&gt;if(!ModoConfig())&lt;BR /&gt;{&lt;BR /&gt;xReturned = xTaskCreate((TaskFunction_t)_TskSendCAN,"TskSendCAN",4*configMINIMAL_STACK_SIZE,NULL,APP_TSK_LOW_PRIORITY,&amp;amp;_tskHandleSendCAN);&lt;BR /&gt;configASSERT(xReturned);&lt;BR /&gt;// _queueHandleBuff = xQueueCreate(QUEUE_LENGTH, TAM_BUFF);&lt;BR /&gt;// configASSERT(_queueHandleBuff);&lt;BR /&gt;}&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;} // void ModCANInit(void)&lt;/P&gt;</description>
    <pubDate>Fri, 09 Jul 2021 06:43:01 GMT</pubDate>
    <dc:creator>Nadia</dc:creator>
    <dc:date>2021-07-09T06:43:01Z</dc:date>
    <item>
      <title>MCAN communication</title>
      <link>https://community.nxp.com/t5/LPC-Microcontrollers/MCAN-communication/m-p/1304861#M45806</link>
      <description>&lt;P&gt;Hello to all,&lt;BR /&gt;I'm using a LPC55S14 to communicate with the CAN bus of the car, but I can't get it. I am also using the MCP2551 to get the CAN L and CAN H lines.&lt;/P&gt;&lt;P&gt;Can anyone tell me if I need to know any specific data from the car bus to establish the communication?&lt;/P&gt;&lt;P&gt;Best regards.&lt;/P&gt;</description>
      <pubDate>Thu, 08 Jul 2021 15:13:39 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPC-Microcontrollers/MCAN-communication/m-p/1304861#M45806</guid>
      <dc:creator>Nadia</dc:creator>
      <dc:date>2021-07-08T15:13:39Z</dc:date>
    </item>
    <item>
      <title>Re: MCAN communication</title>
      <link>https://community.nxp.com/t5/LPC-Microcontrollers/MCAN-communication/m-p/1305179#M45813</link>
      <description>&lt;P&gt;At least the baud rate of the system you want to attach it to. The CAN bus ist static, i.e. there is no configuration/reconfiguration at runtime. It must be properly planned and configured beforehand.&lt;/P&gt;&lt;P&gt;I would assume the MCAN peripheral is the same IP block as on other NXP MCUs, and thus very similar.&lt;/P&gt;&lt;P&gt;Not really a tutorial, but a good starting point:&amp;nbsp;&lt;A href="https://en.wikipedia.org/wiki/CAN_bus" target="_blank"&gt;https://en.wikipedia.org/wiki/CAN_bus&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 09 Jul 2021 05:46:02 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPC-Microcontrollers/MCAN-communication/m-p/1305179#M45813</guid>
      <dc:creator>frank_m</dc:creator>
      <dc:date>2021-07-09T05:46:02Z</dc:date>
    </item>
    <item>
      <title>Re: MCAN communication</title>
      <link>https://community.nxp.com/t5/LPC-Microcontrollers/MCAN-communication/m-p/1305227#M45815</link>
      <description>&lt;P&gt;&lt;a href="https://community.nxp.com/t5/user/viewprofilepage/user-id/137574"&gt;@frank_m&lt;/a&gt;&amp;nbsp;Thanks for your help.&lt;BR /&gt;Yes, I'm taking that into account, but it still doesn't work, I'm attaching the code part. The transmission seems to go through, but when I read the response, it doesn't match the id.&lt;/P&gt;&lt;P&gt;/******************************************************//**&lt;BR /&gt;** Definición de macros&lt;BR /&gt;*********************************************************/&lt;BR /&gt;#define TAM_BUFF 26&lt;BR /&gt;#define QUEUE_LENGTH 50&lt;BR /&gt;#define CAN_DATASIZE 26U&lt;BR /&gt;#define DATA_MCAN CAN0&lt;BR /&gt;//#define MCAN_CLK_FREQ CLOCK_GetMCanClkFreq(0)&lt;BR /&gt;#define USE_CANFD (0U)&lt;BR /&gt;//#define MCAN_CLK_FREQ 8000000U&lt;BR /&gt;#define MCAN_CLK_FREQ CLOCK_GetMCanClkFreq()&lt;/P&gt;&lt;P&gt;#define TX_BUFFER_OFS 0x20U&lt;BR /&gt;#define MSG_RAM_BASE 0x04000000U&lt;BR /&gt;#define msgRam MSG_RAM_BASE&lt;BR /&gt;#define MSG_RAM_SIZE (TX_BUFFER_OFS + 8 + CAN_DATASIZE)&lt;BR /&gt;#define BOARD_DEBUG_UART_CLK_ATTACH kFRO12M_to_FLEXCOMM0&lt;BR /&gt;#define STD_FILTER_OFS 0x0&lt;BR /&gt;#define RX_FIFO0_OFS 0x20U&lt;BR /&gt;/**********************************************************&lt;BR /&gt;** Variables privados&lt;BR /&gt;**********************************************************/&lt;BR /&gt;static TaskHandle_t _tskHandleSendCAN;&lt;BR /&gt;static QueueHandle_t _queueHandleBuff;&lt;BR /&gt;/// Variables para CAN&lt;BR /&gt;static TaskHandle_t _tskHandleCAN;&lt;BR /&gt;volatile bool rxComplete = false;&lt;BR /&gt;mcan_rx_buffer_frame_t rxFrame;&lt;BR /&gt;mcan_tx_buffer_frame_t txFrame;&lt;BR /&gt;uint8_t tx_data[CAN_DATASIZE];&lt;BR /&gt;uint8_t rx_data[CAN_DATASIZE];&lt;BR /&gt;//#ifndef MSG_RAM_BASE&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;mcan_handle_t mcanHandle;&lt;BR /&gt;//mcan_tx_buffer_frame_t mcanHandle;&lt;BR /&gt;mcan_buffer_transfer_t txXfer;&lt;BR /&gt;volatile bool txComplete = false;&lt;/P&gt;&lt;P&gt;void CAN0_IRQ0_IRQHandler(void)&lt;BR /&gt;{&lt;BR /&gt;MCAN_ClearStatusFlag(DATA_MCAN, CAN_IR_RF0N_MASK);&lt;BR /&gt;MCAN_ReadRxFifo(DATA_MCAN, 0, &amp;amp;rxFrame);&lt;BR /&gt;rxComplete = true;&lt;BR /&gt;SDK_ISR_EXIT_BARRIER;&lt;BR /&gt;}&lt;/P&gt;&lt;P&gt;static void _CANInit(void)&lt;BR /&gt;{&lt;BR /&gt;/* set BOD VBAT level to 1.65V */&lt;BR /&gt;POWER_SetBodVbatLevel(kPOWER_BodVbatLevel1650mv, kPOWER_BodHystLevel50mv, false);&lt;BR /&gt;// POWER_SetBodVbatLevel(kPOWER_BodVbatLevel3300mv, kPOWER_BodHystLevel25mv, false);&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 100Mhz/5=20MHz. */&lt;BR /&gt;CLOCK_SetClkDiv(kCLOCK_DivCanClk, 5U, true);&lt;BR /&gt;CLOCK_AttachClk(kMCAN_DIV_to_MCAN);&lt;BR /&gt;} //static void _CANInit(void)&lt;/P&gt;&lt;P&gt;///*! \fn static void _TskSendCAN (void)&lt;BR /&gt;// * \brief Envío de datos por el bus can.&lt;BR /&gt;// * \return Nada.&lt;BR /&gt;// */&lt;BR /&gt;static void _TskSendCAN(void)&lt;BR /&gt;{&lt;BR /&gt;// uint32_t *CANBuff;&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;uint8_t *CANBuff[26];&lt;BR /&gt;mcan_config_t mcanConfig;&lt;BR /&gt;mcan_tx_buffer_config_t txBuffer;&lt;BR /&gt;uint8_t numMessage = 0;&lt;BR /&gt;// LecDRACallBack(_RecDatCAN);&lt;BR /&gt;while (true)&lt;BR /&gt;{&lt;BR /&gt;// ulTaskNotifyTake(pdFALSE, portMAX_DELAY);!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!&lt;BR /&gt;// if (xQueueReceive(_queueHandleBuff, &amp;amp;CANBuff, portMAX_DELAY) != 0)&lt;BR /&gt;// {&lt;BR /&gt;// if (CANBuff != NULL)&lt;BR /&gt;// {&lt;BR /&gt;_CANInit();&lt;BR /&gt;MCAN_GetDefaultConfig(&amp;amp;mcanConfig);&lt;BR /&gt;mcanConfig.enableLoopBackExt = true;&lt;BR /&gt;// mcanConfig.enableLoopBackInt = false;&lt;BR /&gt;MCAN_Init(DATA_MCAN, &amp;amp;mcanConfig, MCAN_CLK_FREQ);&lt;BR /&gt;// MCAN_TransferCreateHandle(DATA_MCAN, &amp;amp;mcanHandle, mcan_callback, NULL);&lt;BR /&gt;MCAN_SetMsgRAMBase(DATA_MCAN, (uint32_t)msgRam);&lt;BR /&gt;memset((void *)msgRam, 0, MSG_RAM_SIZE * sizeof(uint8_t));&lt;/P&gt;&lt;P&gt;/* STD filter config. */&lt;BR /&gt;rxFilter.address = STD_FILTER_OFS;&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(DATA_MCAN, &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;stdFilter.sft = kMCAN_classic;&lt;BR /&gt;stdFilter.sfid1 = 0x123U;&lt;BR /&gt;stdFilter.sfid2 = 0x7FFU;&lt;BR /&gt;MCAN_SetSTDFilterElement(DATA_MCAN, &amp;amp;rxFilter, &amp;amp;stdFilter, 0);&lt;/P&gt;&lt;P&gt;&lt;BR /&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;#if (defined(USE_CANFD) &amp;amp;&amp;amp; USE_CANFD)&lt;BR /&gt;rxFifo0.datafieldSize = BYTES_IN_MB;&lt;BR /&gt;#endif&lt;BR /&gt;MCAN_SetRxFifo0Config(DATA_MCAN, &amp;amp;rxFifo0);&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;/* TX buffer config. */&lt;BR /&gt;memset(&amp;amp;txBuffer, 0, sizeof(txBuffer));&lt;BR /&gt;txBuffer.address = TX_BUFFER_OFS; //Dirección trama CAN 0X20&lt;BR /&gt;txBuffer.dedicatedSize = 1U;&lt;BR /&gt;txBuffer.fqSize = 0;&lt;BR /&gt;txBuffer.datafieldSize = kMCAN_8ByteDatafield;&lt;/P&gt;&lt;P&gt;MCAN_SetTxBufferConfig(DATA_MCAN, &amp;amp;txBuffer);&lt;/P&gt;&lt;P&gt;/* Enter normal mode. */&lt;BR /&gt;MCAN_EnterNormalMode(DATA_MCAN);&lt;/P&gt;&lt;P&gt;/* Config TX frame data. */&lt;BR /&gt;uint8_t cnt = 0;&lt;BR /&gt;memset(tx_data, 0, sizeof(uint8_t) * CAN_DATASIZE);&lt;BR /&gt;tx_data[0] = 58;&lt;BR /&gt;for (cnt = 1; cnt &amp;lt; CAN_DATASIZE; cnt++)&lt;BR /&gt;{&lt;BR /&gt;// tx_data[cnt] = *CANBuff[cnt]; //Aquí se almacenan los datos del Buffer&lt;BR /&gt;// tx_data[cnt] = _anlBuffer[cnt];&lt;BR /&gt;tx_data[cnt] = cnt;&lt;BR /&gt;}&lt;BR /&gt;//** Valores de configuración del CAN**//&lt;BR /&gt;txFrame.xtd = kMCAN_FrameIDStandard;&lt;BR /&gt;txFrame.rtr = kMCAN_FrameTypeData;&lt;BR /&gt;txFrame.fdf = 0;&lt;BR /&gt;txFrame.brs = 0;&lt;BR /&gt;txFrame.dlc = 8U;&lt;BR /&gt;txFrame.id = 31;&lt;BR /&gt;txFrame.data = tx_data;&lt;BR /&gt;txFrame.size = CAN_DATASIZE;&lt;BR /&gt;#if (defined(USE_CANFD) &amp;amp;&amp;amp; USE_CANFD)&lt;BR /&gt;txFrame.fdf = 1;&lt;BR /&gt;txFrame.brs = 1;&lt;BR /&gt;txFrame.dlc = DLC;&lt;BR /&gt;#endif&lt;BR /&gt;// txXfer.frame = &amp;amp;txFrame;&lt;BR /&gt;// txXfer.bufferIdx = 0;&lt;BR /&gt;// MCAN_TransferSendNonBlocking(DATA_MCAN, &amp;amp;mcanHandle, &amp;amp;txXfer);&lt;BR /&gt;MCAN_TransferSendBlocking(DATA_MCAN, 0, &amp;amp;txFrame);&lt;BR /&gt;// vTaskDelay(1000);&lt;BR /&gt;// while (!txComplete)&lt;BR /&gt;// {&lt;BR /&gt;// }&lt;BR /&gt;// txComplete = false;&lt;BR /&gt;// }&lt;BR /&gt;// vPortFree(CANBuff);&lt;BR /&gt;// }&lt;BR /&gt;//////////////////////////////////////////////////////////&lt;BR /&gt;MCAN_ReadRxBuffer(DATA_MCAN,0,&amp;amp;rxFrame);&lt;/P&gt;&lt;P&gt;//////////////////////////////////////////////////////////&lt;BR /&gt;} // while (true)&lt;/P&gt;&lt;P&gt;} // void _TskSendCAN(void)&lt;/P&gt;&lt;P&gt;/**********************************************************&lt;BR /&gt;** Métodos públicos&lt;BR /&gt;**********************************************************/&lt;BR /&gt;/*! \fn void ModCANInit(void)&lt;BR /&gt;* \brief Inicializa el módulo CAN.&lt;BR /&gt;* \return Nada.&lt;BR /&gt;*/&lt;BR /&gt;void ModCANInit(void)&lt;BR /&gt;{&lt;BR /&gt;BaseType_t xReturned;&lt;BR /&gt;if(!ModoConfig())&lt;BR /&gt;{&lt;BR /&gt;xReturned = xTaskCreate((TaskFunction_t)_TskSendCAN,"TskSendCAN",4*configMINIMAL_STACK_SIZE,NULL,APP_TSK_LOW_PRIORITY,&amp;amp;_tskHandleSendCAN);&lt;BR /&gt;configASSERT(xReturned);&lt;BR /&gt;// _queueHandleBuff = xQueueCreate(QUEUE_LENGTH, TAM_BUFF);&lt;BR /&gt;// configASSERT(_queueHandleBuff);&lt;BR /&gt;}&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;} // void ModCANInit(void)&lt;/P&gt;</description>
      <pubDate>Fri, 09 Jul 2021 06:43:01 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPC-Microcontrollers/MCAN-communication/m-p/1305227#M45815</guid>
      <dc:creator>Nadia</dc:creator>
      <dc:date>2021-07-09T06:43:01Z</dc:date>
    </item>
    <item>
      <title>Re: MCAN communication</title>
      <link>https://community.nxp.com/t5/LPC-Microcontrollers/MCAN-communication/m-p/1305234#M45818</link>
      <description>&lt;P&gt;&lt;EM&gt;&amp;gt; The transmission seems to go through, but when I read the response, it doesn't match the id.&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Not sure what that means, and what you expect.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;As mentioned in earlier threads, CAN is not based on a request-response mechanism.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;There are only nodes that send messages, and bus arbitration is based on IDs (CAN identifier). On CAN level, everything is broadcast, i.e. every node receives every message.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;What happens internally (i.e. interpreting one message as a response to another) is solely a firmware functionality of the node(s).&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 09 Jul 2021 06:52:22 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPC-Microcontrollers/MCAN-communication/m-p/1305234#M45818</guid>
      <dc:creator>frank_m</dc:creator>
      <dc:date>2021-07-09T06:52:22Z</dc:date>
    </item>
    <item>
      <title>Re: MCAN communication</title>
      <link>https://community.nxp.com/t5/LPC-Microcontrollers/MCAN-communication/m-p/1305245#M45820</link>
      <description>&lt;P&gt;&lt;a href="https://community.nxp.com/t5/user/viewprofilepage/user-id/137574"&gt;@frank_m&lt;/a&gt;&amp;nbsp;The function MCAN_ReadRxBuffer(), returns a 1 in the parameter esi. This indicates an error.&lt;/P&gt;</description>
      <pubDate>Fri, 09 Jul 2021 07:13:28 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPC-Microcontrollers/MCAN-communication/m-p/1305245#M45820</guid>
      <dc:creator>Nadia</dc:creator>
      <dc:date>2021-07-09T07:13:28Z</dc:date>
    </item>
    <item>
      <title>Re: MCAN communication</title>
      <link>https://community.nxp.com/t5/LPC-Microcontrollers/MCAN-communication/m-p/1305294#M45821</link>
      <description>&lt;P&gt;Do you see both transmissions on the bus ?&lt;/P&gt;&lt;P&gt;Try a scope and/or CAN monitoring software. If you (your company) develops CAN related devices, you will definitely need those. I could recommend Vector (&lt;A href="https://www.vector.com/int/en/" target="_blank"&gt;https://www.vector.com/int/en/&lt;/A&gt;) or PEAK products (&lt;A href="https://www.peak-system.com/?&amp;amp;L=1)" target="_blank"&gt;https://www.peak-system.com/?&amp;amp;L=1)&lt;/A&gt;.&lt;/P&gt;&lt;P&gt;&lt;EM&gt;&amp;gt; The function MCAN_ReadRxBuffer(), returns a 1 in the parameter esi. This indicates an error.&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Can you step into the call, or check the sources to see why it fails, and what the raturn value exactly means ?&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Perhaps the bus is physically not set up correctly (no termination, CANH/CANL swapped, shifting GND potentials).&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 09 Jul 2021 08:14:31 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPC-Microcontrollers/MCAN-communication/m-p/1305294#M45821</guid>
      <dc:creator>frank_m</dc:creator>
      <dc:date>2021-07-09T08:14:31Z</dc:date>
    </item>
    <item>
      <title>Re: MCAN communication</title>
      <link>https://community.nxp.com/t5/LPC-Microcontrollers/MCAN-communication/m-p/1305313#M45822</link>
      <description>&lt;P&gt;&lt;a href="https://community.nxp.com/t5/user/viewprofilepage/user-id/137574"&gt;@frank_m&lt;/a&gt;&amp;nbsp;The transmission seems to have been carried out. With an oscilloscope I can see that data is being sent on both channels.&lt;/P&gt;</description>
      <pubDate>Fri, 09 Jul 2021 08:34:59 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPC-Microcontrollers/MCAN-communication/m-p/1305313#M45822</guid>
      <dc:creator>Nadia</dc:creator>
      <dc:date>2021-07-09T08:34:59Z</dc:date>
    </item>
    <item>
      <title>Re: MCAN communication</title>
      <link>https://community.nxp.com/t5/LPC-Microcontrollers/MCAN-communication/m-p/1305325#M45823</link>
      <description>&lt;P&gt;You will need to look into your setup and source code.&lt;/P&gt;&lt;P&gt;Checking a CAN example for the LPC546xx, the function&amp;nbsp;&lt;FONT face="courier new,courier"&gt;MCAN_ReadRxBuffer&lt;/FONT&gt;&lt;EM&gt;() &lt;/EM&gt;of said SDK&amp;nbsp;returns the fixed value &lt;FONT face="courier new,courier"&gt;kStatus_Success&lt;/FONT&gt; (0).&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 09 Jul 2021 08:44:36 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPC-Microcontrollers/MCAN-communication/m-p/1305325#M45823</guid>
      <dc:creator>frank_m</dc:creator>
      <dc:date>2021-07-09T08:44:36Z</dc:date>
    </item>
    <item>
      <title>Re: MCAN communication</title>
      <link>https://community.nxp.com/t5/LPC-Microcontrollers/MCAN-communication/m-p/1305334#M45824</link>
      <description>&lt;P&gt;Yes, the function returns a kStatus_Success&lt;/P&gt;</description>
      <pubDate>Fri, 09 Jul 2021 08:56:48 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPC-Microcontrollers/MCAN-communication/m-p/1305334#M45824</guid>
      <dc:creator>Nadia</dc:creator>
      <dc:date>2021-07-09T08:56:48Z</dc:date>
    </item>
    <item>
      <title>Re: MCAN communication</title>
      <link>https://community.nxp.com/t5/LPC-Microcontrollers/MCAN-communication/m-p/1305335#M45825</link>
      <description>&lt;P&gt;&lt;a href="https://community.nxp.com/t5/user/viewprofilepage/user-id/137574"&gt;@frank_m&lt;/a&gt;&amp;nbsp;Yes, the function returns a kStatus_Success&lt;/P&gt;</description>
      <pubDate>Fri, 09 Jul 2021 08:57:01 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPC-Microcontrollers/MCAN-communication/m-p/1305335#M45825</guid>
      <dc:creator>Nadia</dc:creator>
      <dc:date>2021-07-09T08:57:01Z</dc:date>
    </item>
    <item>
      <title>Re: MCAN communication</title>
      <link>https://community.nxp.com/t5/LPC-Microcontrollers/MCAN-communication/m-p/1306746#M45851</link>
      <description>&lt;P&gt;Hello Nadia,&lt;/P&gt;
&lt;P&gt;Recommend first recommend the CAN demo under SDK for lpcpxresso55s16 board.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 13 Jul 2021 08:50:01 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPC-Microcontrollers/MCAN-communication/m-p/1306746#M45851</guid>
      <dc:creator>Alice_Yang</dc:creator>
      <dc:date>2021-07-13T08:50:01Z</dc:date>
    </item>
  </channel>
</rss>

