Rebroadcasting existing CAN msg on network issue
I'm working with an existing CAN network on which I want to read a msg, modify it slightly and rebroadcast.
I'm running into an issue where the code seems to crash/freeze if I broadcast the new message too close to the original one thats on the network.
Inside HAL_CAN_RxFifo0MsgPendingCallback() I listen for the msg I want to modify and do a HAL_CAN_AddTxMessage() call as soon as it arrives with the updated msg data. This seems to be working fine.
I then want to repeat identical msg just before the next time the original msg is broadcast on the network which is on a 30ms interval. I use HAL_GetTick() to track when the last msg was received inside HAL_CAN_RxFifo0MsgPendingCallback() and then in the main while(1) loop again I use HAL_GetTick() to count down the ms to just before the next msg is expected to be and do a HAL_CAN_AddTxMessage() with the custom data. This seems to be working fine unless I get within 4ms of the original msg at which point everything hangs. I'd like to get as close as possible to the original msg.
Any suggestion how I can accomplish this or a better way of doing it? I cannot modify the original CAN network, I can only read and broadcast messages.
