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.

TMS570LC4357: 使用canUpdateID函数更新ID后,发送的数据帧变成远程帧了

Part Number: TMS570LC4357

//使用canUpdateID函数更新ID后,发送的数据帧变成远程帧了,我不知道原因,

//msgBoxArbitVal传过来的是0XA1300000

void canUpdateID(canBASE_t *node, uint32 messageBox, uint32 msgBoxArbitVal)
{

/** - Wait until IF2 is ready for use */
while ((node->IF2STAT & 0x80U) ==0x80U)
{
} /* Wait */

/** - Configure IF2 for
* - Message direction - Read
* - Data Read
* - Clears NewDat bit in the message object.
*/
node->IF2CMD = 0xA0U;
/* Copy passed value into the arbitration register. */
node->IF2ARB &= 0x80000000U;
node->IF2ARB |= (msgBoxArbitVal & 0x7FFFFFFFU);

/** - Update message box number. */
/*SAFETYMCUSW 93 S MR: 6.1,6.2,10.1,10.2,10.3,10.4 <APPROVED> "LDRA Tool issue" */
node->IF2NO = (uint8) messageBox;

/** - Wait until data are copied into IF2 */
while ((node->IF2STAT & 0x80U) ==0x80U)
{
} /* Wait */

}

  • 您好我们已收到您的问题并升级到英文论坛寻求帮助,如有答复将尽快回复您。谢谢!

  • 您好,

    CAN 远程帧被显性标记为远程帧 (Arbitration Field中的 RTR bit是隐性的) ,并且没有data field。 远程帧的目的是请求相应数据帧的传输。 例如,如果node A (CAN 1) 发送Arbitration Field设置为 123 的远程帧,那么node B (CAN 2) 将以Arbitration Field也设置为 123 的数据帧进行响应。

    1. 发送远程帧的消息对象或邮箱必须配置为 RX

    2. 必须设置 RTR bit

    不知道您这边的CANUpdateaID() 函数如何更改邮箱的配置:请设置 RTR 并将 TX 更改为 RX。

    也请仔细检查代码的其他部分。