CAN frame monitoring problem in loopback mode
@mƎALLEm hello again,
So , i am facing a problem to display the frame i am supposed to send from CAN_Tx pin in loopback mode. I am using picoscope to display.
Here is the function i wrote to configure the Header, and send the data:
void CAN_send(void)
{
char msg[50];
CAN_TxHeaderTypeDef TxHeader;
uint32_t TxMailbox;
uint8_t TxData[4] = {'T','E','S','T'};
TxHeader.DLC = 4; // 4 data byte
TxHeader.ExtId = 0; // Not used so far
TxHeader.IDE = CAN_ID_STD; // Standard ID
TxHeader.RTR = CAN_RTR_DATA; // Data and not remote frame
TxHeader.StdId = 0x103; // Data ID
TxHeader.TransmitGlobalTime = DISABLE;
if(HAL_CAN_AddTxMessage(&hcan1, &TxHeader, TxData, &TxMailbox)!=HAL_OK)
{
Error_Handler();
}
while( HAL_CAN_IsTxMessagePending(&hcan1, TxMailbox));
sprintf(msg, "Message transmitted\r\n");
HAL_UART_Transmit(&huart2, (uint8_t*)msg, strlen(msg), HAL_MAX_DELAY);
}
In the Main function, i am calling it after the HAL_CAN_Start function. The uart connexion tells me that the frame is sent but i can't see it though.
Thank you again for your precious help!
