Hello everybody,
I have some issues with my TMS570LC43-board.
I have implemented a pretty simple code to test the can communication. I enabled the loopback functionality and tried to update the ID with the generated halgogen function "canUpdateID()".
The problem is, after a successfully Update of the messageID, i can't receive any message.
On the other hand, i received normally the messages, if a don't use "canUpdateID()".and preconfigure the MessageID with halgogen.
I configured the messageboxes with halgogen like:
messagebox[1 - 8] are Tx-messageboxes with respectively messageID 1 - 8
messagebox[9 - 16] are Rx-messageboxes with respectively messageID 9 - 16
i tried with my code to modify the messageIDs of the first 4 Rx-messageboxes, in order to receive the messages.
Below my code
uint8 i;
uint32 ID;
uint8 data[4][8];
uint8 Data[8] = {1,2,3,93,5,6,7,8};
uint8 Data2[8] = {8,7,4,93,3,2,1,0};
uint8 DataArray[4][8];
uint32 ResultOfTransmission;
canInit();
canEnableloopback(canREG1, Internal_Lbk);
memcpy(&DataArray[0][0], Data, 8);
memcpy(&DataArray[1][0], Data2, 8);
memcpy(&DataArray[2][0], Data, 8);
memcpy(&DataArray[3][0], Data2, 8);
for (i = 1; i<= 4; i++){
ResultOfTransmission = canTransmit(canREG1, i, DataArray[i-1]);
canUpdateID(canREG1, i + 8, i);
}
while(1){
static UINT32 j = 1;
printf("**** Round nr %d*******\n", j);
if(j > 8){
if (canIsMessageBoxValid(canREG1, j )){
ID = canGetID(canREG1, j );
if (canIsRxMessageArrived(canREG1, j )){
static a = 0;
if (a < 4){
ResultOfTransmission = canGetData(canREG1, j + 8, &data[a][0]);
}
a++;
} /* kein else nötig */
} /* kein else nötig */
}
j++;
}