Hi all,
I’m trying getting the CAN demo frot he VF50 to run.
I have the latest WEC2013 v1.4Beta 1 running on a Viola Carrier board. I using the latest lib version 1.8
In the CAN demo I call Can_Init with “CAN1” instead of “SPI2”
The “Implementation” is also set to “FlexCAN”.
Calling Can_SetConfigString(hCan, L"Interface", L"CAN1", StoreVolatile);
makes the debugger hit an exception. I guess the param name Implementation has been removed from the latest lib version 1.8?
When I try to receive a frame the Can_Read(...)
the begugger breaks after the 5 second timeout. No exception type is shown. Only it has reached a breakpoint.
The execution than halts!!
Any suggestion what I have missed?
Below is here the code:
hCan = Can_Init(L"CAN1"); // Internal CAN
//hCan = Can_Init(L"SPI2");
if (hCan == NULL)
{
printf("Error in CAN initialization\r\n");
}
returnValue = Can_SetConfigString(hCan, L"Implementation", L"FlexCAN", StoreVolatile);
returnValue = Can_SetConfigString(hCan, L"FrameFormat", L"standard", StoreVolatile);
returnValue = Can_SetConfigString(hCan, L"FilterRemote", L"none", StoreVolatile);
returnValue = Can_SetConfigString(hCan, L"RtrFormat", L"data", StoreVolatile);
returnValue = Can_SetConfigInt(hCan, L"FilterID", 0x00, StoreVolatile);
returnValue = Can_SetConfigInt(hCan, L"FilterMask", 0x00, StoreVolatile);
returnValue = Can_SetConfigInt(hCan, L"SingleThread", 0, StoreVolatile);
returnValue = Can_SetConfigInt(hCan, L"BitRateHz", 125000, StoreVolatile);
// Configure timeout to 5 sec, by default it is set to 1 sec
Can_SetConfigInt(hCan, L"Timeout", 5000, StoreVolatile); // optional
// 3. Apply configuration to hardware
if (!Can_Open(hCan))
{
printf("CAN Rx Open failed\r\n");
return 0;
}
// 4. Use CAN
canBuf.dataLen = 8;
if (Can_Read(hCan, &canBuf)) << BANG! After 5 second timeout