Skip to main content
QTLe
Visitor II
November 20, 2021
Question

Transmit more than 8 array elements via Standard CAN - STM32F4

  • November 20, 2021
  • 2 replies
  • 791 views

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!

This topic has been closed for replies.

2 replies

Uwe Bonnes
Chief
November 20, 2021

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.

Tesla DeLorean
Guru
November 20, 2021

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 VenmoUp vote any posts that you find helpful, it shows what's working..