2023-06-13 03:07 AM
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;
}
2023-06-16 03:45 PM
You have not stated what you're transmitting to?