We are facing an issue in the transmission of a custom mavlink message from Telem2 Port.
Following is a detailed description and settings for our issue:
We are witnessing a loss in the transmission of a mavlink commands from ArduCopter to Peripheral device. Peripheral device is connected to Telem2 Port. We are using Copter406 release based firmware. This issue is very persistent when all the UART ports are active for data communications. If we use only Telem 1 port for Herelink and Telem 2 port for peripheral device, mavlink command loss is not observed in flight tests.
Mavlink COMMAND_LONG message sent on Telem2 port is missed very frequently. We have verified this by logging the mavlink messages on peripheral device. Message loss is very consistent but very random, in flight tests it occurs at a frequency of 50-75 percent.
In some cases, COMMAND_LONG message is received to the peripheral device but after a significant delay of 8-10 seconds. Occasionally, this delay is even more than 10 seconds.
UARTDriver.cpp file, function
UARTDriver::write_pending_bytes_DMA, it contains a check of
if (dma_handle->has_contention()). If check is
true, it is reducing the number of bytes to be written on the Serial Port.
Could this cause of the issue we are facing? If yes, then is there any specific reason why it has been implemented in such a manner?
If we fix the code for our needs, is there anything that we should consider from the UART hardware point of view.
- We are transmitting HOME_POSITION and GLOBAL+POSITION_INT at a frequency of 1Hz on Serial4, i.e GPS2 Port.
- We are transmitting a custom 22 bytes message at a frequency of 95Hz at Serial3 Port, i.e GPS1 Port.
Any Help is appreciated