how i can get useful can error info in MPC5748G

キャンセル
次の結果を表示 
表示  限定  | 次の代わりに検索 
もしかして: 

how i can get useful can error info in MPC5748G

719件の閲覧回数
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 返答(返信)

710件の閲覧回数
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 件の賞賛
返信

702件の閲覧回数
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 件の賞賛
返信

692件の閲覧回数
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 件の賞賛
返信