Xgate Hangs

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Xgate Hangs

533 Views
rahulkrishna
Contributor IV

I am facing yet another problem I implemented CAN driver handling on Xgate and other functionalities like switch reading etc on s12x. After some period of time probably some days i find that CAN communication is completely stopped. The functionalities handled by s12x are working fine. The CAN communication will start again if i completely remove the power and connect it back. What can be the reason of no CAN communication? I am assuming that Xgate is hanging. I found that in all the unhandled interrupt handlers of the xgate i used asm("BRK") command. Is that the reason? Or they could be plenty of other reasons. Please advice.

Labels (1)
0 Kudos
3 Replies

430 Views
RadekS
NXP Employee
NXP Employee

Hi Rahul,

Did, you try to connect BDM interface and attach/hotsync to MCU?

Hotsync.png

After that, you should be able to detect where XGATE hangs. Please check XGMCTL register. If XGDBG bit is set, XGATE is in debug mode and the only way how to leave debug mode is clearing this bit (write to XGMCTL register with XGDBG=0 and XGDBGM=1).

Could you please share here your code for XGATE setting - XGATE Control Register (XGMCTL). For example:

  /* enable XGATE mode and interrupts */

  XGMCTL= 0xFBC1; /* XGE | XGFRZ | XGIE */

Could you please share here your CAN routines?

Is there any potential endless loop inside these routines – for example waiting for empty TX buffer?

Just for sure, what MCU family you use (S12XE, S12XD) and what CW version you use?

CW51-version.png


I hope it helps you.

Have a great day,
RadekS

-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------

0 Kudos

430 Views
lama
NXP TechSupport
NXP TechSupport

Let me think about your issue.

Possible problems:

1) enabled interrupt at XGATE and not served. The solution by means of BRK command is not very suitable. It is OK for debug mode but or final application no. Better solution would be to catch the number of the interrupt which launched the event in one common function and store it somewhere within, for example, FLASH to be able to analyze the behavior after long term test.

2) The issue can be caused by BUS OFF status of the can or some device is not answering (ACKNOWLEDGE) and the TX errors exceed defined number which results the CAN is set into error passive mode.

3) Have you tried to use hot plugging and read content of registers to be able to analyze the error. (sometimes I use serial channel to send the required data to the PC to see what the MCU is doing (simple solution). The FreeMASTER can also be used for this purpose (http://www.nxp.com/products/power-management/wireless-charging-ics/freemaster-run-time-debugging-too...))

  

Best Regards, Ladislav

0 Kudos

430 Views
rahulkrishna
Contributor IV

Please give some advice.

0 Kudos