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.

CCS/TCAN4550-Q1: Transmission issue using TxBuf of TCAN4550.

Part Number: TCAN4550-Q1
Other Parts Discussed in Thread: TCAN4550

Tool/software: Code Composer Studio

Hello there.

I'm Alex.Kim. I want to ask you question of transmission missing.

In our system, we send periodically a message through TxBuf of TCAN4550.

However, sometimes we're not able to receive messages from TCAN4550. 

(If there are so many other messages what have high priority in same network, The abnormal behavior are happened very much.)

Please check my transmit routine and result. 

And another thing I'd like to ask is that is there any method to check the completion of TCAN4550 transmission?

(I can't get any result from TC of MCAN Interrupts. Even though not only I set up TCE as 1 but also DAR is 0.)

thank you.

best regards.

Std_ReturnType TCAN4550_Transmit(uint32_t id, uint8_t* data, uint8_t module)
{
  Std_ReturnType retValue = E_NOT_OK;
  uint8_t i = 0;
  uint8_t msgObjectId = 0;
  uint8_t msgObjectLength = 0;
  TCAN4550_IdTypeType TCAN4550_IdType;
  TCAN4550_DataTypeType TCAN4550_DataType;
  TCAN4x5x_MCAN_TX_Header header = {0};
  Can_IdType msgId;

/* Seek tcan4550 object */
  for(i = 0; !TCAN4550_RuntimeGlobal.config->TCAN4550_Hoh[i].TCAN4550_EOL; i++)
  {
    if((TCAN4550_RuntimeGlobal.config->TCAN4550_Hoh[i].TCAN4550_ObjectHwModule == module) &&
    (TCAN4550_RuntimeGlobal.config->TCAN4550_Hoh[i].TCAN4550_MsgId.msgId == id))
    {
      msgObjectId = TCAN4550_RuntimeGlobal.config->TCAN4550_Hoh[i].TCAN4550_ObjectId;
      msgObjectLength = TCAN4550_RuntimeGlobal.config->TCAN4550_Hoh[i].TCAN4550_ObjectMsgLength;
      TCAN4550_IdType = TCAN4550_RuntimeGlobal.config->TCAN4550_Hoh[i].TCAN4550_IdType;
      TCAN4550_DataType = TCAN4550_RuntimeGlobal.config->TCAN4550_Hoh[i].TCAN4550_DataType;
      msgId = TCAN4550_RuntimeGlobal.config->TCAN4550_Hoh[i].TCAN4550_MsgId.msgId;

      retValue = E_OK;
      break;
    }
  }

if (retValue == E_OK)
{
if (msgObjectLength <= 8) {
header.DLC = msgObjectLength; // Set the DLC to be equal to or less than the data payload (it is ok to pass a 64 byte data array into the WriteTXFIFO function if your DLC is 8 bytes, only the first 8 bytes will be read)
}
else if (msgObjectLength == 12) {
header.DLC = MCAN_DLC_12B;
}
else if (msgObjectLength == 16) {
header.DLC = MCAN_DLC_16B;
}
else if (msgObjectLength == 20) {
header.DLC = MCAN_DLC_20B;
}
else if (msgObjectLength == 24) {
header.DLC = MCAN_DLC_24B;
}
else if (msgObjectLength == 32) {
header.DLC = MCAN_DLC_32B;
}
else if (msgObjectLength == 48) {
header.DLC = MCAN_DLC_48B;
}
else if (msgObjectLength == 64) {
header.DLC = MCAN_DLC_64B;
}
else {header.DLC = 0;}

header.ID = msgId;

if (TCAN4550_DataType == TCAN4550_DATA_TYPE_FD)
{
header.FDF = 1;
header.BRS = 1;
}
else
{
header.FDF = 0;
header.BRS = 0;
}

if (TCAN4550_IdType == TCAN4550_ID_TYPE_EXTENDED)
{
header.XTD = 1;
}
else
{
header.XTD = 0;
}

header.EFC = 0; // Don't use Event FIFO Control
header.MM = 0; // Don't use Message Marker
header.RTR = 0; // Don't use Remote Transmission Request
header.ESI = 0; // Don't use Error state indicator

for (i = 0; i < msgObjectLength; i++)
{
TCAN4550_TxData[i] = (uint8_t)data[i];
}

TCAN4x5x_MCAN_WriteTXBuffer(msgObjectId, &header, TCAN4550_TxData);
TCAN4x5x_MCAN_TransmitBufferContents(msgObjectId);
}


return E_OK;
}

  • Hello Alex,

    I don’t have enough information to address the received message question. Are you saying that there are too many other nodes on the network sending higher priority messages to allow enough idle time for the message to the TCAN4550 node to be transmitted? Or are you saying that the message is being transmitted successfully on the network but the TCAN4550 is not receiving it properly due to some configuration issue?

    If there are too many other higher priority messages being sent, then this is not a problem with the TCAN4550 device and the overall network may have too many nodes or messages to ensure proper communication.

    If the message is being sent on the bus and the TCAN4550 is not receiving it, I will need to know how you are configuring the device for received messages so that I can review the configuration and provide comment. Are you using a RX FIFO, RX Buffer, both? Are you using Filter elements and if so how are those configured? Etc.

    For the transmission question you can check a few registers for information that you have not referenced in your post and may not be aware of.

    The TXFQS register 0x10C4 will give you the TX FIFO/Queue status related to the pending TX requests listed in the register TXBRP.

    The TXBRP register 0x10CC shows each TX Buffer’s Transmission Request Pending bit. This gets set when a TX buffer add request is made through the TXBAR register and cleared when the buffer message has been sent.

    The TXBTO register 0x10D8 shows the successful transmission status of each TX Buffer. Each buffer has a bit that will reflect whether the transmission has occurred or not occurred.

    The TXBTIE register 0x10E0 is the Transmission Interrupt Enable bit. You will need to set these bits for the buffers you want to get reflected on the interrupt pins. If you are not setting these bits, then this is most likely the reason you are not seeing any interrupts.

    You can also setup the TX Event FIFO to log transmission events. You will need to allocate MRAM space for the TX EVENT elements and configure the register TXEFC 0x10F0. The TXEFS register 0x10F4 will give you the status of the TX Event FIFO, and you can acknowledge the TX Event by writing to TXEFA 0x10F8.

    The TCAN4550 uses the M_CAN CAN FD Controller developed by Bosch and more detailed information about the M_CAN registers can be found in the M_CAN User Manual developed by Bosch. It can be found at the following link. https://www.bosch-semiconductors.com/media/ip_modules/pdf_2/m_can/mcan_users_manual_v330.pdf

    Regards,

    Jonathan

  • Hello Jonathan.

    I'm so sorry to make you confused.

    My question is not about receiving data. It's just about transmission of data.

    To be honest, there are two problems.

    1. If there are so many other messages what have high priority in same network, My transmission message is canceled.

       -> According to other question resolved, I tried to apply that DAR is 0. It worked well. (Resolved)

    2. If I transmit one message, How can I get information or flag that transmission is done or completed?

       -> I tried to use of TC(Transmission Completed), However It doesn't work, even though I set up TCE as 1.

       -> In reference to your advice, I'm going to use TXBRP, TXBTO etc.. into my system. I will feedback you as soon as possible.,

    Thank you

    Best regards.

  • Regarding to My issue left,

    According to your advice, I've tried about setting TXBTIE  up and checking TXBTO and TC(Transmission Completed).

    It works very well. Thank you, Jonathan.

    Your help make me feel very happy. 

    Thanks again.

    Best regards.

  • Hello Alex,

    I am glad I was able to help you.  Feel free to ask any questions you may have in the future.

    Best Regards,

    Jonathan