2018-03-21 10:47 PM
2018-03-22 12:28 AM
firstly, you must enable ABOM, hcan.Init.ABOM = ENABLE;
secondly, I am not sure if you are getting data through FiFo2 ..
I use this method personally.
__HAL_CAN_ENABLE_IT(&hcan, CAN_IT_FMP1);
__HAL_CAN_ENABLE_IT(&hcan, CAN_IT_FMP0);//both Rx Fifos are enabled for interrupts
then I believe there is a Tx sequencing issue.
I think Tx_FiFo1 will always transmit first, regardless which FiFo was filled first.
Personally, I use a frame counter inside my frames for ordered assembly at the other end. with a reduced 7 byte payload.
2018-03-22 05:06 PM
Why can't you just use a serial protocol which is at least remotely suitable for this purpose? There's I2S, or SPI, UART, whatever, just pick a point-to-point one. If there are no other devices on your CAN bus, there is no point in using CAN, and if there are other devices then you won't be able to ensure continuous streaming of voice over it (it's far too slow for it anyway).
2018-03-22 07:20 PM
CanBus offers distance, I2S SPI Uart are very limited in cable length.
even in a small classroom, you cant use SPI, I2S or Uart over 2meters.
@'Ben K' is right to point out
250KHz max, is slow for audio,
its likely that only one stream can be catered for at any time.