Colibri T20 MCP2515 CAN Bus with C# wrapper - cannot receive messages

Hello.
We need to use CAN Bus on Colibri T20 with MCP2515 chip on carrier board.
We wrote a C# wrapper for Windows CE Library - CANLibMCP2515_Dll.dll :

  1. with “wincelib_bin_V2_0bis_2868” we succed in trasmitting message on the bus but we receive an error (COREDLL.DLL 0xC0000005 Access Violation) when trying to call “CANLibMCP2515ReceiveMessages”.

  2. with “wincelib_v1_9_2429” we succed in trasmitting message on the bus but we aren’t able to receive any message (we receive no errors but “CANLibMCP2515ReceiveMessages” returns always 0 after the timeout fires).

Is there someone who succeded in using CAN Bus communication in the same environment ?
Best regards

@GMSW2:
Thanks for reporting this issue. Did you ever try to use the native Code? Does it work like that or do you seen the same issues. Could you please give it a try with the native code and if you still see the issue forward us the sample application you wrote so we can reproduce it here?

Hello Samuel.

Yes, we tried also with native code.
In particular we tried your sample application “CanLibDemo-MCP2515” based on “wincelib_bin_V2_0bis_2868” library.

We receive the first error on the “CANLibMCP2515Init” call :
The first time “CANLibMCP2515Init” is called, we obtain “-6” as result.
If called two times (one after the other) the second call succedes.

When we press “T”,“D”,“I” and “Q”, all is OK.

When we press “R” to test receiving, we obtain an error in a small dialog box : “Application CanLibDemo-MCP2515.exe encountered a serious error and must shut down” then the application closes.

Thank you for your support.

Best regard.

Hello.

We have some news about our question.

We activated Debug Messages over Serial :
http://developer.toradex.com/knowledge-base/enable-the-debug-messages”.

This operation made our c# application and also the Toradex native code demo application start to receive messages without any error.

This is not a solution but maybe it can help to find one (the knowledge base says that using the serial port for debug messages slows down the system).

Best regards.

Thanks for the update.

Just two things to clarify: