bxCAN - hold program while message will be sent corrertly
Hi,
I'm new to STM's. I'm writing program using bxCAN by HAL Layer. I had a problem with sending messages in time interval.
For example I would like to send two messages in every 100ms, but when I'm doing it messages are missing, so I would like to hold the program while message will be sent correctly.
I'm doing it in this way:
for(;;)if(HAL_CAN_AddTxMessage(&hcan, &TxHeader, msg, &MAILBOX) == HAL_OK)break;
It doesn't work, checking the transmit ok flag also doesn't work. Pooling while transmit mailboxes will be freed also doesn't work:
for(;;)if((HAL_CAN_GetTxMailboxesFreeLevel(&hcan)) == 3)break;
Maybe somebody can help, me with solving this problem.
BR, Daniel
