Source code for CAN Implementations

Dear All

I Kindly request the Source code links for CAN Implementation as I am very curious about insights. I had been working in CAN testing for Past two years. Now I desperately want to shift my self in to Implementation part to learn and exp more.

I am thankful to every one, in encourage many members of this group in the learning process.

Thanking you all

Regards Rajesh Maddukuri

Reply to
raj
Loading thread data ...

Hi Raj,

This depends on how much detail you need! I've written my own small drivers for C164 and have also used drivers from Vector. The Vector ones are pretty daunting to get started with and it's unlikely you'll be able to get hold of them anyway unless you know someone ;-). However it might be worth checking out these company sites and you may be able to get sample code, the Infineon site is probably a good bet as is Microchip, but the Microchip CAN peripheral isn't as good.

Microchip Hitex Infineon -> Datasheets for the XC family are very good in the CAN section. Bosch Keil Tasking Vector Informatik

Are you working in a particular industry or is this for self study as a matter of interest.

Dave.

Reply to
dathome

Unfortunately I am not aware of any CAN implementation that are open source or in the public domain.

In my former job we have been using CAN on both an infineon C167/C164 and on a PPC5200. On the former we wrote our own CAN and CANopen library, on the latter we bought the Vector CAN/CANopen stack and had them adapt their CAN driver for our hardware.

I doubt you would get them without dishing out some serious money! However, despite being daunting, they are a fine piece of software, I was very much impressed with them (both their performance and their source code). Also, their people are competent and helpful.

Besides those, you might also want to check out

formatting link
they have some documentation both on CAN and CANopen, thought some of it is not available for free.

Cheers /urs

--
"Change is inevitable, except from a vending machine."
 -- Urs Beeli,
Reply to
Urs Beeli

I've got to disagree somewhat with the comments regarding how good the Vector drivers were with particular reference to the coding standards used. They were littered with continue and break statements as well as having bunches of code that was compiled dependant on #defines. Not at all MISRA-C compliant despite being for vehicle platforms! Additionally the footprint was way bigger than necessary occupying about 8-9k on a 16bit micro. They obviously have very good sales teams to have got all the major car manufacturers to use it.

When I asked them about MISRA compliance and SIL2 in particular they had no good answer and technically if you are using a non SIL2 compliant drivers in your application then you can't claim your system to be SIL2 even if all your code has been developed in this way. Bit of a problem when the customer stipulates both SIL2 and to use the Vector drivers!

To be fair though the support was good including on one occasion that I visited them at short notice in their offices and sat with a developer to fix a problem I had, well worth the ~£1000 round trip cost as it was critical to the project. The execution time of the various tasks also seemed pretty good as well which suggests that a large amount of the code was never actually used.

Reply to
dathome

Fair enough. As we were using CANopen in a non security critical environment MISRA-C and SIL2 were not something we cared about greatly :)

What I tried to say was that I found the code well enough written to easily follow it, understand it, even make some modifications to it at a later stage where we needed some proprietary extensions. Compared to some other third party libraries I have seen in my time, that was a positive surprise.

It might be a lack of competition. At the time we were looking for CAN/CANopen implementations under QNX and there was only one other company besides Vector that even had a product. It might be different for other OSes, though.

Exactly my experience. Also, they were very patient with our management being very difficult about signing the contract. Had I been in their position I would have told my company to go stuff ourselves :)

Yepp. My impression was, that their code base is fairly large in order to cover all options of the CANopen standard, very flexible and highly configurable but would only include the code that you actually activated using the proper defines.

Cheeers /urs

--
"Change is inevitable, except from a vending machine."
 -- Urs Beeli,
Reply to
Urs Beeli

Look for "can4linux", which supports both Intel and Philips CAN controllers on ISA/PCI boards.

Paul

Reply to
Paul Keinanen

Why not use MISRA-C anyway? Once you are using it there is no overhead.

--
\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\
\/\/\/\/\ Chris Hills  Staffs  England     /\/\/\/\/
/\/\/ chris@phaedsys.org      www.phaedsys.org \/\/\
\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/
Reply to
Chris Hills

Paul

I appreciate for you kind information Paul

I would be more thankful if you could direct as in right path, so that we can learn better and faster

Ex

Starting with understanding of hard ware registers Understanding can physical and data link layer implementations etc.

Could you please give us a Skelton structure to follow?

Thanking you

Regards Rajesh Maddukuri

Reply to
raj

ElectronDepot website is not affiliated with any of the manufacturers or service providers discussed here. All logos and trade names are the property of their respective owners.