This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

RM48L952: Interrupt problem by Message_BOX of CAN IF3

Part Number: RM48L952

Hello, thank you for always answering my questions.

Today, I ask a question because of the IF3 problem of CAN. My code is to send data using message box 1 and message box 2 of CAN1 IF1 and receive data to message box 1 and message box 2 of CAN2 IF3.

Obviously, I thought that if I sent message box 1 of CAN1 IF1, it would be received by message box 1 of CAN2 IF3.

However, in the first frame, CAN2 IF3 is received by message box 0.

As a result, data copy from CAN2 interrupt to RX buffer does not work normally, and even if data is transmitted from CAN1 again, data is not copied normally from CAN2.

From my tests, it looks like one frame is being sent with a delay.

Is it impossible to classify data by IF3 of CAN by distinguishing message box number? Or I'm wondering if I'm using it wrong.

Below is my code. Usage => (fWhile = 7) = send CAN1 IF1 message_box1, (fWhile = 8) = send CAN1 IF1 message_box2

210714_HMI_LCD_TEST03 (3).zip

  • However, in the first frame, CAN2 IF3 is received by message box 0.

    CAN message handler scans the message RAM to find a matching message object (message ID), and stores the message to the message object if the ID matches.

    For example, CAN1 transmits a message with ID=0x345 in message box0

                          The ID and Mask of CAN2 box0 is x123, and ID and mask of Box1 is 0x234, ID and mask of box2 is 0x345

                          When CAN2 receives the message, the message handler scans the message RAM and knows that the Box3 has matched ID, so the received message is stored in CAN2 message box2.

                           If you want to store the received message with ID=0x345 to message box0, you have to change the arbitration of box0 to 0x345

    Is it impossible to classify data by IF3 of CAN by distinguishing message box number? Or I'm wondering if I'm using it wrong.

    The IF3x copies the message in message boxes to IF3x data registers. The message boxes are selected using IF3 Update Enable Registers.

    // Read DATA A & B */
    canREG2->IF3OBS = 0x18;

    // Message box 0 is configured for auto update
    canREG1->IF3UEy[0]= 0x00000001;

    // Message box 1,3,5 configured for auto update
    //canREG1->IF3UEy[0]= 0x0000002A;

  • Your CAN2 IF3x configuration s fine. The data filed in CAN box0 and box1 are automatically copied to IF3x data registers.

    The CAN Box0 has the same ID as the CAN1 box0, so the received message with ID=0x2 should be copied to box0.

  • Message_box0 does not exist. The expression message_box0 is said because the value of the can interrupt register is not used.
    What I asked is whether the value of the can interrupt register does not change when IF3 is interrupted.
    If so, IF3 can't identify data by message box number, so I'm trying to ask if it's correct to use IF3.
    I know that IF3 is read-only, but in what cases is the IF3 interface used?

  • What I asked is whether the value of the can interrupt register does not change when IF3 is interrupted.

    When data is received for message objects that are configured for automatic update through IF3, an interrupt will be generated. This is the interrupt in VIM channel 44. 

    You don't need to enable the RxIE of IF3MCTL register is automatics update is used.

    If so, IF3 can't identify data by message box number, so I'm trying to ask if it's correct to use IF3.

    The IF3 update the data of the message objects with the same ID. After you get the data from I3xData registers, message objects or mailboxes should be a concern. 

    I know that IF3 is read-only, but in what cases is the IF3 interface used?

    The CPU does not need to initiate the transfer from Message RAM to IF3 register set, and DMA request is generated when transfer is completed which make the DMA read packets very efficient. You can use IF3x in any kind of application cases.

  • I decided to distinguish the incoming value of IF3 by the ID value of the DCAN IF3ARB register in the can interrupt. Thank you for your help.