Hi Chris, Chris Verges wrote: > Hi Wolfgang, > > Thanks for the reply. > >>> I'm using the at91_can driver on a custom board. The following > sequence >>> seems to cause the driver to hit a flood of error frames: >> $ ifconfig can0 down ? See below. > > "ifconfig can0 down" results in an "unknown host" error. The output of > "ifconfig can0" is: > > can0 Link encap:(hwtype unknown) > UP RUNNING NOARP MTU:16 > txqueuelen:10 > > I'm using ifconfig from inetutils 1.5.
Puh, that's wired. >>> *snip* >>> (1259913144.766140) can0 20000020#0000000000000000 >> Wired, I would expect error messages here. Looks like a separate > issue. > > Driver-level or user-level? At a closer look, 0x20000020 is the correct error message: (CAN_ERR_FLAG | CAN_ERR_ACK) I wonder why candump does not display it correctly. Don't know what "-L" is good for. Please try without it. >>> The syslog output is also revealing, indicating a flood of "AERR irq" >>> errors. > >> OK. > > Is this a problem or expected? CONFIG_CAN_DEBUG is on, in case it > matters. You get plenty of bus-error due to hardware problems on the bus. >> The bit-rate error is rather high due to ... >>> clock 99328000 >> this exotic clock frequency. Is it really correct? > > Yes, this is the correct clock. We're running our AT91SAM9263 around > 200 MHz -- keyword "around". It's actually more like 198 MHz, and the > 1/2 clock becomes around 99 MHz. > >> I suspect CAN bus errors due to improper bit-timing parameters. > > OK, I'll try tweaking all these to see where we get. Here is the output of my bit-timing calc program: Bit timing parameters for at91 using 99328000Hz Bitrate TQ[ns] PrS PhS1 PhS2 SJW BRP SampP Error CAN_BR 1000000 110 2 3 3 1 11 66.6% 0.3% 0x000a0122 800000 251 1 1 2 1 25 60.0% 0.7% 0x00180001 500000 332 1 2 2 1 33 66.6% 0.3% 0x00200011 250000 664 1 2 2 1 66 66.6% 0.3% 0x00410011 125000 533 8 4 2 1 53 86.6% 0.0% 0x00340731 100000 714 8 3 2 1 71 85.7% 0.1% 0x00460721 50000 1177 8 5 3 1 117 82.3% 0.1% 0x00740742 20000 ***bitrate not possible*** 10000 ***bitrate not possible*** The error for 1MB/s is 0,3%, not that bad, though. I would check the cabling/routing of the CAN signals again. Has it worked with that board already in the past? Check with an oscilloscope, if you have the chance? Wolfgang. _______________________________________________ Socketcan-core mailing list [email protected] https://lists.berlios.de/mailman/listinfo/socketcan-core
