Unknown Trace Data Packet Error
When doing instruction trace with the J-Trace Pro signals generated by the target device are sampled and analyzed. Under certain circumstances wrong data can be sampled leading to the "Unknown Trace Data Packet Error". If that happens the analysis is stopped and trace data is discarded. This article describes what causes the error and how it can be resolved.
Main Cause
The main cause for such errors are signal integrity issues from the target device or board. Such signal issues lead to bitflips in the sampled data which lead to analysis errors and other issues. So it is recommended to make sure to clear your setup from such signal problems.
Fixes
- Check if your board design follows the board design recommendations.
- Some target devices do not follow the signal specification correctly and thus the default sampling timing of the J-Trace Pro may not be correct. For troubleshooting steps in such cases see here.
- The sampling timing can also be wrong even if the specification is correct e.g. due to a very high trace GPIO speed which changes the signal quality. In such cases the same troubleshooting steps can be used as in 2.
- It is also possible that the GPIO drive strength of your target device is not configured for the correct frequency area. For more information consult the reference manual of your target device. Typically the pin init is done via a .JLinkScript or .pex file. For more information see here.
Overriding default behaviour
Please be aware that by allowing wrongly sampled data to be analyzed in the worst case the analyzer software can crash. So enable this behaviour only on your own risk! Support will be declined!
Also there is no guarantee that the displayed code coverage or code profiling data is correct anymore as the unknown trace packets have been discarded.(The override is available with J-Link software version V8.12 and later. Before that the analysis would not stop on wrongly sampled data.)
Under certain circumstances it can be convenient to continue tracing even if sampling errors appear. For such cases you can override the default behaviour by using the following command string: TRACE_SetAllowContinueOnInvalidPacket
By setting it to 1 the analysis will continue in error cases. How to use commands strings is explained here.