Issue in the communication between two MCAN modules

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Issue in the communication between two MCAN modules

851 Views
fabio_malatesta
Contributor I

I am using the OM13094 (LPCXpresso54618 CAN-FD kit), which provides two can modules CAN1 and CAN0.
I also use the provided SDK.

I try to send a frame from CAN0 to CAN1. The frame is correctly received but CAN1 stores the frame in the wrong memory section (at MSG_RAM_BASE0+RX_FIFO1_OFS). In particular, it stores the frame as if the base address of the Message RAM used for CAN1 was the one used for CAN0.

I attach here an excerpt of the code:

#define MSG_RAM_BASE0 0x20010000U   //Base address of the Message Ram for CAN0
#define TX_BUFFER_OFS 0x00U
#define RX_FIFO1_OFS  0x20U
#define MSG_RAM_BASE1 0x20010050U //Base address of the Message Ram for CAN1

//Set Base Addresses

MCAN_SetMsgRAMBase(CAN0, MSG_RAM_BASE0);
MCAN_SetMsgRAMBase(CAN1, MSG_RAM_BASE1);

 /* RX fifo1 config for CAN1*/
 rxFifo1.address = RX_FIFO1_OFS;
 rxFifo1.elementSize = 1U;
 rxFifo1.watermark = 0;
 rxFifo1.opmode = kMCAN_FifoBlocking;
 rxFifo1.datafieldSize = kMCAN_8ByteDatafield;
 MCAN_SetRxFifo0Config(CAN1, &rxFifo1);

 /* TX buffer config for CAN0*/
 txBuffer.address = TX_BUFFER_OFS;
 txBuffer.dedicatedSize = 1U;
 txBuffer.fqSize = 0;
 txBuffer.datafieldSize = kMCAN_8ByteDatafield;
 MCAN_SetTxBufferConfig(CAN0, &txBuffer);


The frame received by CAN1 is stored at  address 0x20010020U  (MSG_RAM_BASE0 + RX_FIFO1_OFS) instead of  at  address 0x20010070U (MSG_RAM_BASE1 + RX_FIFO1_OFS).

Can someone provide any help about this?

Labels (1)
Tags (1)
0 Kudos
3 Replies

656 Views
soledad
NXP Employee
NXP Employee

Hi Fabio,

Please check the below thread: Message ram location in CAN controller(s) on LPC54608 


Have a great day,
Sol
-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------

0 Kudos

656 Views
kevin_huang
Contributor I

can i ask a question about this kit?

does this kit contain micro usb cable lines?

should i buy usb cable lines?

0 Kudos

656 Views
soledad
NXP Employee
NXP Employee

Hi Kevin,

This kit doesn't contain USB cables.


Have a great day,
Sol
-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------

0 Kudos