Tool/software: Code Composer Studio
Hello,
I am learning how to use the CAN of the TMS570 LS 12,I try to send a message from CAN1 to CAN 2 however, I can not get the message (the program is locked at: while(!canIsRxMessageArrived(canREG1,canMESSAGE_BOX2)); ) and I can not figure out why it does not work.
Here is my code:
void main(void) { /* USER CODE BEGIN (3) */ gioInit(); canInit(); unsigned char tx_data[8] = {'G','E','I','I','M','O','N','T'}; unsigned char rx_donnee[8] = {}; int n = 0; int i = 0; canEnableloopback(canREG1,Internal_Lbk); canTransmit(canREG1,canMESSAGE_BOX1,tx_data); while(!canIsRxMessageArrived(canREG1,canMESSAGE_BOX2)); canGetData(canREG1,canMESSAGE_BOX2,rx_donnee); for (i=0;i<=8;i++); { if(tx_data[i]!=rx_donnee[i]) { n = 1; } } if(n==0) { gioToggleBit(gioPORTB, 1); } while (1); //xTaskCreate(firstTask, "task1", 128, 0, 2, 0); //vTaskStartScheduler(); /* USER CODE END */ }
And here is my configuration of HALCOGEN:
This is the first time I use this type of microcontroller and I do not understand why it does not work.
Does Someone can help me ?
Regards.