[SOLVED] CRTP Payload Size

Post here to get support
Post Reply
BlackOakTree
Beginner
Posts: 3
Joined: Thu Oct 10, 2019 1:04 pm

[SOLVED] CRTP Payload Size

Post by BlackOakTree »

Hello,
I am a little cofused what the CRTP payload size is and I do not fully understand the documentation.

The new Firmware Documentation states a Payload size of 29 Bytes:
https://www.bitcraze.io/docs/crazyflie- ... trp_index/

But the old one states 31 Bytes:
https://wiki.bitcraze.io/projects:crazy ... munication

Then there is the CRTP_MAX_DATA_SIZE in the firmware code that is 30:
https://github.com/bitcraze/crazyflie-f ... crtp.h#L33

Did the payload size change recently or slipped an error in somewhere?
It would be great if you could help me to resolve my confusion about how big the payload size is and whether the CRTP_MAX_DATA_SIZE includes or excludes the header size.
Last edited by BlackOakTree on Mon Oct 14, 2019 11:48 am, edited 2 times in total.
arnaud
Bitcraze
Posts: 2538
Joined: Tue Feb 06, 2007 12:36 pm

Re: CRTP Payload Size

Post by arnaud »

Hi,

Sorry for the confusion, this has been an historical problem.

The payload capability of CRTP packets should be 31 bytes: Crazyradio can handle 32Bytes packets and CRTP is adding 1 byte header.

There has been confusion early-on in the firmware development that has set 30 bytes payload limit (31 bytes for the full packet). The reason this is still in the firmware is that last time I bump it up (a long time ago) I got random crash as if some other part of the firmware where limited to 30bytes payload. This is something that should be fixed. There is a ticket tracking this bug: https://github.com/bitcraze/crazyflie-f ... /issues/48. I am going to have a look at it again.

The old doc was then correct and I updated the doc on the website to match it. I was not directly involved with the doc transfer and I have no idea what happened in the transfer and why 31 became 29 bytes.
BlackOakTree
Beginner
Posts: 3
Joined: Thu Oct 10, 2019 1:04 pm

Re: CRTP Payload Size

Post by BlackOakTree »

Thank you very much for your reply. Now it is clear to me.
I will come back to the ticket if I stumble over some number that could cause the crashes.
Post Reply