I get an error while using CANlib in my application.
The CAN example from Toradex homepage works fine.
Also the functions Imx7Can_Init(), Imx7Can_Write(), Imx7Can_Read(), and so on are working fine in my app.
I can send and receive frames.
At the end I call Imx7Can_Close() and Imx7Can_Deinit().
Close is also successful, but Deinit not.
I get the following error: “Unhandled exception at 0x0026F245 in app.exe 0xC0000005: Access violation reading location 0x332000AD”
I can’t give you more details, because debugging deeper in the code is not possible.
If I press the Break-Button I get into the file “dbgfree.c” from visual studio.
Not know what this means.
Can you help me solving this problem?
static ERROR CAN_Dispose(BYTE byNet)
s_Can[s_byDriver[byNet]].hRxTask = INVALID_HANDLE;
s_Can[s_byDriver[byNet]].hTxTask = INVALID_HANDLE;
Imx7Can_Close(s_Can[s_byDriver[byNet]].hCan); // Close CAN channel
Sleep(1000); // Only test purpose
Imx7Can_Deinit(s_Can[s_byDriver[byNet]].hCan);// Deinit CAN #TODO errors at the moment
The function should deinit CAN.
First, I destroy two task which are responsible for sending and receiving.
After that I close the CAN channel and wait for a second.
Calling Imx7Can_Deinit() throws the exception.
The handle I hand over, is not NULL.
It’s the same handle I use to send, receive and close.
We tested with our CAN_Demo(…\libDemos\Can_Demo) application from Toradex CE Libraries 2.0-20170524 release, not able to reproduce the issue. Could you please try it using Can_Demo application and let us know your feedback.
if it is able to reproduce the issue with modified mode on Can-Demo application then share the same application with us, it will help us to reproduce the issue.
I tried again with Can_Demo. Think the problem lies in Debug and Release configuration. In Release-config everything works fine. But in Debug-config the error occurs: “Unhandled exception at 0x401F8AEB (msvcr110d.dll) in CANTest.exe …”
So I think the dll is the problem. Because with msvcr110.dll it is ok.
Very good. When do you plan to release the next lib 2.1?
If it’s possible for you to give me a preliminary release then I would take it.
Because I always have to power off my device if I do changes in my CAN app.