cancel
Showing results for 
Search instead for 
Did you mean: 

Voice data transmission over CANBUS in STM32F373

alper ozel
Associate II
Posted on March 22, 2018 at 06:47

The original post was too long to process during our migration. Please click on the attachment to read the original post.
3 REPLIES 3
T J
Lead
Posted on March 22, 2018 at 08:28

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.

Ben K
Senior III
Posted on March 23, 2018 at 01:06

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).

Posted on March 23, 2018 at 02:20

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.