lpcware

CAN - Sporadic malfunction of sending CAN packets...

Discussion created by lpcware Employee on Jun 15, 2016
Latest reply on Jun 15, 2016 by lpcware
Content originally posted in LPCWare by capiman on Tue Jun 30 12:19:26 MST 2015
Hi,

I have code to send and receive CAN packets on CAN0 with Rev '-'.
I can send and receive multiple thousands of CAN packet (e.g. 50.000 packets),
but suddenly the sending of CAN packets is not working any more.
The bits in MSGV1 and MSGV2 don't tell me, that the buffer for the previous send packet gets free.
It remains endless filled (bit remains 0). I am using interrupts, no DMA (don't know if possible and useful at all).
For a test I enabled status interrupts, but get no error condition like CRC erros nor others.

I know the errata, the ADC0 is used in parallel to CAN0, but only in burst mode.
It is already set up before CAN and after init of CAN it executes only read requests.

I use msgNo = 1 for receiving, msgNo = 32 (=0x20) for sending.
Baudrate is 250 kbit/s, driven by XTAL of 12 MHz (without PLL). Core itself runs at (maximum possible) 204 MHz.
Core M0 is not used at the moment, perhaps later.

Does someone know such a problem? Any idea how it can be solved?

Because it occurs partly only seldom, but partly also very often, a first step could also be a workaround:
I periodically check this bit and can also detect via a timeout, when my problem situation happens.
But, as workaround, what can I do then? Is there some way to reset the transmission path only?
Clean up a transmitted packet?
Or am I forced to switch down complete CAN0 peripheral and re-initialize it?

Many thanks!

Best regards,

Martin


Outcomes