cancel
Showing results for 
Search instead for 
Did you mean: 

Transmit more than 8 array elements via Standard CAN - STM32F4

QTLe
Associate

Hi guys,

I'm currently working with Standard CAN. The maximum data length of each frame is 64 bytes. In HAL library, I see DLC parameter is limited from 0 to 8. So that means, I can only transmit 8 elements of an array (8 bytes for each element). In order to use full of 64 bytes, I tried to transmit 16 elements (4 bytes each) or 32 elements (2 bytes each) but they didn't work. Is there any way that I can transmit more than 8 elements? Many thanks!

2 REPLIES 2
Uwe Bonnes
Principal III

Standard CAN is 8 byte payload. 64 Byte payload is FDCAN only. In the 8 bytes, transfer an index and upto 7 values at that index for up to 256 byte array.

The protocol is limited to 8 Bytes, you'll need to decompose the larger data across multiple packets,perhaps using the message STDID/EXTID to indicate a sequence number.

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..