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.

PROCESSOR-SDK-J721S2: Question about CAN mailbox

Part Number: PROCESSOR-SDK-J721S2

Hi, 

core mcu1_0     sdk:8.6.1.3

There are 32 CAN sending mailboxes on j721s2. Now we want to determine whether the mailbox is busy or idle before filling the mailbox. However, after reading the relevant codes and registers, I am not sure which register or function interface is used to read the status of the mailbox. Is there any functional interface in the SDK that can read the status of the sending mailbox? Or please tell me which register is used to read the mailbox status. Thank you!

I tried to read the MCAN_TXBAR register before and after calling the can_write function, but found that the values read out were all 0.

In addition, I read out the MCAN_TXBAR register immediately after writing 1, and found that the value read out was also 0. I am not sure whether it is because the mailbox has been idle at this time, so I need to determine how to get the mailbox status

Best regards

Bingxian

  • Hello Bingxian,

    You are asking it for MCAL or PDK?

    Regards

    Tarun Mukesh

  • Hi,Tarun Mukesh

    We are using MCAL, but our code architecture is ported from SDK7.3, so some functions are used in PDK. For example, the MCAN_txBufAddReq function uses PDK

    Best regards

    Bingxian

  • Hello Bingxian,

    TXBRP (Transmit Buffer Request Pending) register: This register might indicate whether a transmit request is pending for a particular transmit buffer. If the bit corresponding to a specific mailbox is set, it could mean that the mailbox is busy, and a transmit request is pending.

    Regarding TXBAR ,Writing 1h will set the corresponding Add Request bit; writing a 0h has no impact. This enables the Host CPU to set transmission requests for multiple Tx Buffers with one write to the MCAN_TXBAR register. The MCAN_TXBAR bits are set only for those Tx Buffers configured via the MCAN_TXBC register. When no Tx scan is running, the bits are reset immediately, else the bits remain set until the Tx scan process has completed.

    Regards

    Tarun Mukesh