Hi Bartosz,
The issue you are encountering could be due to several factors related to error handling, recovery and the configuration of the device. A few suggestions and troubleshooting steps to help resolve the problem.
Error Counters:
Check the error counters in the CAN controller (not just the TJA1145). High error counts can indicate issues that need to be addressed, such as error frames caused by incorrect bitrates or termination.
Reset Mechanism:
Software Reset: Implement a mechanism to reset the TJA1145 transceiver from the MCU when such a freeze is detected. Since the transceiver registers show everything as normal, this might involve detecting the lack of CAN frame transmission or reception for a certain period.
Watchdog Timer: Use a watchdog timer to periodically reset the transceiver if no CAN activity is detected for a predefined duration.
Configuration Settings:
Automatic Recovery: Ensure that automatic bus-off recovery is enabled in your CAN controller configuration. This will allow the controller to attempt to re-enter normal operation after a bus-off condition.
Bit Timing Configuration: Double-check the bit timing configuration of your CAN controller to ensure it matches the requirements of the TJA1145 and your network. Incorrect configurations can lead to synchronization issues.
Power Supply and Grounding:
Ensure that the power supply to the TJA1145 is stable and that there is proper grounding. Power supply issues can sometimes cause unexpected behavior in transceivers.
CAN Bus Quality:
Ensure the physical layer of the CAN bus is properly implemented. This includes proper termination, correct cabling and avoiding long stubs. Poor physical layer implementation can lead to communication issues.
Isolation of Problem:
Try isolating the problem by simplifying the CAN network. Use only two nodes (the MCU with TJA1145 and one other device) and test if the problem persists. Gradually add devices back to identify if any specific device is causing the issue.
Diagnostic Tools:
Use a CAN analyzer tool to monitor the CAN bus traffic and identify any anomalies when the issue occurs. This can provide insights into whether there are specific error frames or patterns that lead to the transceiver freeze.
Hope it helps.
BR, Tomas