How to know the current CAN Transmit errors and receive errors?

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

How to know the current CAN Transmit errors and receive errors?

1,373 Views
Saga
Contributor II
Hi to all, i would like to know the current number of errors and there is 2 registers called:

CANTXERR (MSCAN Transmit Error Counter)
CANRXERR (MSCAN Receive Error Counter)

Both registers have the number of transmision and reception errors, but the datasheet says:

Read: Only when in sleep mode (SLPRQ = 1 and SLPAK = 1) or initialization mode (INITRQ = 1 and
INITAK = 1)

NOTE
Reading this register when in any other mode other than sleep or
initialization mode, may return an incorrect value. For MCUs with dual
CPUs, this may result in a CPU fault condition.


And I can't go back to initialization mode or go to sleep mode (it's not up to me).

Is there another way to know the current errors?

Thank you very much...
Labels (1)
0 Kudos
Reply
1 Reply

483 Views
Bruce_andrew
Contributor I
you can't read the number of errors.

you can check these bits:

CANRFLG_OVRIF         
CANRFLG_TSTAT0              
CANRFLG_TSTAT1             
CANRFLG_RSTAT0               
CANRFLG_RSTAT1          

they are readable anytime

0 Kudos
Reply