CAN Bus on iMX6 - Please provide sample on accessing the CAN Bus driver from the code

Hello Support!
I know this has been discussed but so far I could not find any samples.
Environment:

  • iMX6 under WinCE8
  • VS2013 .NET C#

Latest WinCE drivers (Toradex CE Libraries V1.5.2970) were successfully added.
Along with GPIO, SPI and few others there is a CAN Bus (I believe native one for iMX6) support available.
In the C# wrapper I was able to find some functions related to the driver however any of attempts to simply initialize CAN bus or to do something else were unsuccessful.
There are limited quantity of samples provided with the driver (in C) and there is no sample for CAN available.

Can you please post a link where the one can download any sort of sample about How to use CAN bus from that latest CE library ? Maybe it is possible to share How to use driver directly example ?
I know a few people already asked and there was some link provided in the past but it is no longer available.

I know it is possible to use MCP2515 over SPI from the same board but for low speed CAN where not many messages are in stream I want to use native CAN interfaces from iMX6.

Thank you,
Vlad

Support for CAN is not yet implemented in our libraries, it’s on our roadmap:

but there is no release date yet.
The samples we can provide at the moment are releated to direct access to CAN driver and we need to know your platform/OS to provide the right one.

You can download a CAN bus usage sample here:
https://share.toradex.com/0cx3ozlh98n4els

Thank you very much!
Where I can find actual .dll library file to use with this sample ?
Can you please point me to the right one which should be used.
Thank you,
Vlad

Thank you for your answer. Please provide a sample with direct access to CAN bus driver. This is most important functionality for us which required in our project.
We use Colibri iMX6 board under Win CE8.

So far no luck. Got new version of libraries for CE8 with release date of March4th and still no support for CAN.
Libraries version: toradexcelibraries_v1_6_3123

Toradex Support can you please comment on this ? We use your wrapper for CE libraries and it looks like in the library there is no support (no entry point) for CAN_Init and for Can bus support.
Do we do something wrong in our code?

Can you please provide any sample of CAN Bus initialization and usage with your latest libraries (toradexcelibraries_v1_6_3123) for CE8 ?

Functions are exported from cansdk.dll, that is part of the OS Image, those functions use CreateFile, DeviceIoControl and other standard APIs to call the driver.

We did testing of the CAN bus functionality on iMX6 and stayed pretty impressed.
CAN works perfectly. In 500kbps mode under heavy load of CAN packets we have no missed packages.

Actual direct access to driver is easy. The only missing thing is INT interrupt for CANMsgRcvdIRQ to show when CAN message received. It is however can be implemented via separate thread running but still better to have hardware INT pin or ability to assign some pin to IRQ.

Is there such possibility in the current CAN driver ?

Thank you,
Vlad

No, the idea is that you have a pending read call in a separate thread, as you described. Connecting directly to the IRQ won’t work because you may have multiple drivers/applications reading from CAN, using different filters.

Thank you !

Hello,
Can you give us an example please to use the CAN bus in VS2013 for WEC2013 ? the library does not work… :frowning:

The library should work. What issues are you experiencing? Can you post some sample code?

you can see my issue on this post : Test CAN Bus on IMX6 - Technical Support - Toradex Community

This link is not valid:

Answer by valter.tx · Mar 08, 2016 at 08:06 AM
You can download a CAN bus usage sample here: https://share.toradex.com/0cx3ozlh98n4els

I need CAN support for Colibri and Apalis iMX6 for WEC2013.

Please provide support,

Thank you.

That was an old sample, now CAN support is part of our standard libs, see my reply in the other thread you opened.