CRC error with custom mavlink messages

Hi guys!

I am having trouble with the CRC in mavlink 1.0 for custom messages.
I have generated a custom mavlink message from a xml using mavlink-generator which I got from the mavlink git repository.
I am using mavros to send this message to px4. It works very well if I disable the CRC check on the message in the px4 firmware (in mavlink_helper.h) but the message is dropped due to an incorrect CRC if I dont disable it.
I have thoroughly checked that MAVLINK_CRC_EXTRA is set to 1 in the mavlink header files of mavlink-generator, mavros and px4.
What could be the issue? Why would only the CRC be wrong, while still being to correctly parse the message if I ignore the CRC check?
Thanks for your help!

Just to clarify, I’m using firmware 1.2.0 with mavlink v1

I found the problem, I was generating the mavlink headers independantly for each new custom message. Including all my small xml files into the big common.xml file, then reused with px4 firmware and mavros, the crc errors on custom messages disappeared!

Hey there,
I seem to have a similar error in MAVLink.
While receiving my custom mavlink messages it indicated,
BAD_DATA {invalid MAVLink CRC in msgID 1 0xd553 should be 0xd920, data: …
But the Data has no error.
Wanted to know if you have found a solution to this issue?
Thanks in advance

1 Like

Hi,
Have you managed to solve it? I believe I’m stuck on a very similar issue and could use some help from the community…
Thanks!