Skip to main content
PZamb.2
Associate III
June 13, 2023
Question

Can HAL_CAN_AddTxMessage Not Transmit.

  • June 13, 2023
  • 1 reply
  • 1365 views

Hi

I try to send a message to the CAN interface, use HAl function

HAL_CAN_AddTxMessage.

But the message not send.

I verify with debug that the interface is allwais in Listering HAL_CAN_STATE_LISTENING.

Do you have idea what is wrong?

uint8_t CAN_TX(int16_t Angle)

{

uint8_t stat = 0;

CAN_TxHeaderTypeDef  TxHeader ={};

TxHeader.IDE = CAN_ID_EXT;

TxHeader.StdId = 0x00;

TxHeader.ExtId = 0x100;

uint8_t TxData[8] ={0x01,0x02,0x03,0x04,0x05,0x06,0x07,0x08};

uint32_t TxMailbox;

TxHeader.RTR =   CAN_RTR_DATA;

TxHeader.DLC =  8;

TxHeader.TransmitGlobalTime = DISABLE;

stat = HAL_CAN_AddTxMessage(&hcan1, &TxHeader, TxData, &TxMailbox);

return stat;

}

    This topic has been closed for replies.

    1 reply

    Karl Yamashita
    Principal
    June 16, 2023

    You have not stated what you're transmitting to?   

    If a reply has proven helpful, click on Accept as Solution so that it'll show at top of the post.CAN Jammer an open source CAN bus hacking toolCANableV3 Open Source