Application has 2 PD threads:
- sender-thread for sending PD messages
- receiver-thread for receiving PD messages
Application logic includes PD pull pattern (PD request&reply), sometimes both threads are handling same PD-send-structures and the end result is unpredictable.
Based on debugging in Linux (no TSN configured), following errors have been seen:
- vos_sockSendUDP() trying to send 0 bytes
- vos_sockSendUDP() trying to send 144 bytes (when message is actually 72 bytes)
- tlp_processReceive() returning -35 (TRDP_CRC_ERR)
- tlp_processSend() returning -7 (TRDP_IO_ERR)
The problem seems to be the sending of the reply from within the pdReceive function. The receive thread must aquire the Tx mutex, while holding the Rx mutex.
Currently, when debugging a test case (test3 in api_test_3.c), I see every now and then the TRDP_CRC_ERR, but after taking the Tx mutex on PD Pull requests, it disappears – seems OK.
Can you replicate/verify that problem?
Last edit: Bernd Löhr 2020-07-15
Just tested with current trunk, looks good, I couldn't reproduce the problem.
Ticket can be closed.