hello. the project use the S32K144 to send the CAN frame,also receive the CANdate from other node.meanwhile, it checks the BOFFINT in register ESR1 every 1ms,there is no busoff interrupt enabling. if the busoff happene when BOFFINT is set,the CAN bus is reinitialized.
but there is one error as below:
the ID 486,4CA,4CB is send polling by the S32K144,also the ID4F6 that is disturbed by CANOE is error frame. as the CAN Protocol standard,If the value of TXERRCNT increases to be greater than 255 as the number of CAN error frame is about 32 or 33,FlexCAN is in "Bus Off' state,then the S32 will not send CAN frame again.However,the CAN error is sending as the number is more than 40. then i disable the CAN sending from other node, the S32K144 can get into busoff state in 32 error frame exactly.
so There is some questions needs help:
1 if the correct frame is received, will the TXERRCNT decrease?
2 if the correct frame is send,will the TXERRCNT decrease? how to make sure it get into BUSOFF state in 32 or 33 error frame exactly.
3 is it must that the busoff bit BOFFINT is cleared in interrupt?
4 is there any example that how to config the BUSOFF@@
Could you help me ? BY the way, i dont use the SDK to write code
Hi,
1 if the correct frame is received, will the TXERRCNT decrease?
A: no
2 if the correct frame is send,will the TXERRCNT decrease? how to make sure it get into BUSOFF state in 32 or 33 error frame exactly.
A: yes. Try to enable error and busoff interrupts in the MCU and store ESR1 and ECR registers into some array and see how error counters change.
3 is it must that the busoff bit BOFFINT is cleared in interrupt?
A: to do not call interrupt again you must clear flag in it.
4 is there any example that how to config the BUSOFF@@
A: not sure what you meant. Bus of recovery type is selected by CTRL1[BOFFREC]. Then just enable bus off interrupt to know when bus off is enterred. There is also BOFFDONEINT flag (interrupt) indicating FlexCAN module has completed Bus Off process and is ready to leave Bus Off.
BR, Petr