how i can get useful can error info in MPC5748G

取消
显示结果 
显示  仅  | 搜索替代 
您的意思是: 

how i can get useful can error info in MPC5748G

718 次查看
helius0908
Contributor II

I have a problem in got can error type,

I had enable CAN error reg, and enable CAN modules.

such as, I creat NO-ACK error. then the error irq is got.however when i read ESR1, ERRINT is SET,but ACKERR is zero.

 

so.what should i do to get useful CAN error type.

thanks for you read.

标记 (2)
0 项奖励
回复
3 回复数

709 次查看
PetrS
NXP TechSupport
NXP TechSupport

Hi,

not sure what code you are using, but a reading of ESR1 will clear error status bits (BIT1ERR, BIT0ERR, ACKKERR, CRCERR, FRMERR and STFERR, and BIT1ERR_FAST, BIT0ERR_FAST, CRCERR_FAST, FRMERR_FAST and STFERR_FAST) so further reading will give you zero. It is recommended the CPU to use the following procedure when servicing interrupt requests generated by interrupt bits:
• Read this register to capture all error condition and status bits. This action clear the respective error status bits that were set since the last read access.
• Write 1 to clear the interrupt bit that has triggered the interrupt request.
• Write 1 to clear the ERR_OVR bit if it is set.

BR, Petr

0 项奖励
回复

701 次查看
helius0908
Contributor II

HI:

thanks for you answer. I solved it.

I think the reason why i can't got error info is I read it for too much times in once.so i only get ERRINT flag.

however, i find another question. i have not connect MPC5748G to CAN bus,then i send CAN Frame.the error flag is STFERR? why not is ACKERR?

BR, helius

0 项奖励
回复

691 次查看
PetrS
NXP TechSupport
NXP TechSupport

Hi,

can you share ECR/ESR1 values for this case? Normally txerror counter should be 0x80 and ACCERR set as you wrote. Try to check proper module clocking , CAN bit timing and transceiver connection.

BR, Petr 

0 项奖励
回复