Hello,
I get the following error while calling Can_Write() in my application:
Exception 'Undefined Instruction' (0x1): Thread-Id=13f4005a(pth=b158a780), Proc-Id=13940046(pprc=b11012a0) 'app.exe', VM-active=13940046(pprc=b11012a0) 'app.exe'
PC=0021a735(app.exe+0x0020a735) RA=800f2be1(kernel.dll+0x0001ebe1) SP=01efe728, BVA=00000000
I initialize my app with these instructions:
#include "can.h"
if ((hCan = Can_Init(L"CAN1")) == NULL)
{
return SETUP_ERROR;
}
Can_SetConfigInt(hCan, L"ioTx", ca_ioTx.GenericDefinition, StoreVolatile); // 55
Can_SetConfigInt(hCan, L"ioRx", ca_ioRx.GenericDefinition, StoreVolatile); // 63
Can_SetConfigInt(hCan, L"BitRateHz", wBaudrate * 1000, StoreVolatile);
Can_SetConfigInt(hCan, L"IstPriority", 12, StoreVolatile);
Can_SetConfigString(hCan, L"FilterFrameFormat", L"none", StoreVolatile);
Can_SetConfigString(hCan, L"FilterRemote", L"none", StoreVolatile);
Can_SetConfigInt(hCan, L"FilterID", 0x00, StoreVolatile);
Can_SetConfigInt(hCan, L"FilterMask", 0x00, StoreVolatile);
Can_SetConfigInt(hCan, L"Timeout", 1000, StoreVolatile);
if (!Can_Open(hCan))
{
hCan = hINVALID;
Can_Deinit(hCan);
return SETUP_ERROR;
}
I send a message with this code:
memcpy(s_TxCanMsgBuff.data, pBlock->byData, pBlock->byLen.X.DLC);
s_TxCanMsgBuff.dataLen = pBlock->byLen.X.DLC;
s_TxCanMsgBuff.id = pBlock->cobId.D;
s_TxCanMsgBuff.canMsgFlags = 0;
Can_Write(hCan, &s_TxCanMsgBuff);
Calling Can_Read() works fine. But if I call Can_Write() I get the error above.
The strange thing is, that I don’t get this error, if I use the example CAN project from toradex.
From there, I copied the initialisation part.
Also strange: the message is transmitted, then the error occurs.
Maybe you can help me solving this problem.
Thanks!
Kind regards
kuzco