Data overrun error in CAN module

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

Data overrun error in CAN module

4,628 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by Sharadanand on Wed Jun 20 02:49:05 MST 2012
I am using LPC1769's CAN module.
However I am receiving data overrun error and I do not know how to handle this situation!!!
0 Kudos
5 Replies

3,323 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by amrbekhit on Fri Jun 22 04:52:19 MST 2012
According to the user manual, you get a data overrun when you receive a new message and the CAN receive buffer is full. The CAN controller sets the DOS bit in the CANxGSR register and, if enabled, raises the data overrun interrupt. To clear the overrun, just set the CDO bit in the CANxCMR register.

Here are my thoughts on how to avoid overruns:

- If your CAN handling code is polled, then make sure that you are polling the CAN receiver fast enough so that it doesn't get full. Or even better, make your CAN handler interrupt driven.
- If your CAN handling code is interrupt driven, then maybe you need to look into how fast your ISR is and work on making it faster (for example, by just reading the messages into your own buffer in the interrupt and processing them in the main loop).
- Only configure your acceptance filters to accept as narrow a range of messages as possible. If you're only looking for messages with a small range of IDs, then set up your acceptance filters to accept only those IDs. That way, if your device is on a bus where lots of messages are being sent, it ignores all the messages except the ones your device is interested in, and doesn't get swamped trying to process unnecessary messages.
0 Kudos

3,323 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by Ex-Zero on Thu Jun 21 01:49:32 MST 2012
Data Overruns are just Data Overruns. That's not an error necessarily :)

Data overruns even while suspending a program with debugger  :eek:
0 Kudos

3,323 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by Rob65 on Wed Jun 20 23:25:18 MST 2012
I'm clairvoyant but have no knowledge about CAN.
So I [I]can[/I] tell you that there's just a bug in your code but not where :eek:

We'll definitely have someone who knows about CAN - but as long as that person is not clairvoyant ...
As Zero suggested: [COLOR=Red][B]show your stuff[/B][/COLOR] to someone who knows something about CAN

Rob
0 Kudos

3,323 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by OXO on Wed Jun 20 04:18:26 MST 2012

Quote: Zero
Show your stuff someone who knows something about CAN?



If [I]only[/I] we had someone like that around here ;)
0 Kudos

3,323 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by Ex-Zero on Wed Jun 20 03:47:52 MST 2012
Show your stuff someone who knows something about CAN?
0 Kudos