tonton81 / FlexCAN_T4

FlexCAN (CAN 2.0 / CANFD) Library for Teensy 3.x and 4.0
https://forum.pjrc.com/threads/56035-FlexCAN_T4-FlexCAN-for-Teensy-4
MIT License
196 stars 66 forks source link

CANFD data length not OK if longer then 8 Byte #29

Closed GitSchorschGit closed 3 years ago

GitSchorschGit commented 3 years ago

Hi All, I tested the CANFD and it works very well, but when the Data is longer then 8 Bytes maybe 24, then on the bus are only 8 Bytes. For example: msg.len = 24; -> CAN-Bus shows only 8 Bytes

Thanks for the good work!

chaosu-zd commented 3 years ago

image

GitSchorschGit commented 3 years ago

Thank you for your answer! I tried it and it works very well! How can I find this documentation and how can I calculate the example above? Is 896 Bytes the max value? Then I have to divide it by 8, 16, 32 or 64. Is that right? Thanks for all!

tonton81 commented 3 years ago

The mailbox has to support the size you are using, by default each mailbox is 8 bytes for 64 mailboxes. The more bytes you need, the more mailboxes it consumes. So at 64 byte mailboxes among 2 memory regions, that leaves you a total of 14 mailboxes. The amount of mailboxes available for a specific size is returned by the same function setRegions(). It should be in the readme on this repo