This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

TMS570LS1224: CAN example doubt

Part Number: TMS570LS1224
Other Parts Discussed in Thread: LAUNCHXL2-TMS57012

I have implemented the CAN example code in LAUNCHXL2-TMS57012 board. The messages transfer from CAN1 to CAN2. I had put a breakpoint at the line "while(1);", to view the output of CAN1 and CAN2 registers. But, I am not able to figure out the registers on the variables screen (CCS debug mode) . However, In SPI loopback mode i was able to view the messages there.

Please tell me how do i check whether am i sending the right message and is the message get received on CAN2.

code:


/* USER CODE BEGIN (0) */
/* USER CODE END */
/* Include Files */
#include "sys_common.h"
#include "system.h"
/* USER CODE BEGIN (1) */
#include "can.h"
/* Include ESM header file - types, definitions and function declarations for system driver */
#include "esm.h"
#define D_SIZE 9
uint8 tx_data[D_SIZE] = {'H','E','R','C','U','L','E','S','\0'};
uint8 rx_data[D_SIZE] = {0};
uint32 error = 0;
uint32 checkPackets(uint8 *src_packet,uint8 *dst_packet,uint32 psize);
/* USER CODE END */
/* USER CODE BEGIN (2) */
/* USER CODE END */
void main(void)
{
/* USER CODE BEGIN (3) */
/* initialize can 1 and 2 */
canInit(); /* can1 -> can2 */
/* transmit on can1 */
canTransmit(canREG1, canMESSAGE_BOX1, tx_data);
/*... wait until message receive on can2 */
while(!canIsRxMessageArrived(canREG2, canMESSAGE_BOX1));
canGetData(canREG2, canMESSAGE_BOX1, rx_data); /* receive on can2 */
/* check received data patterns */
error = checkPackets(&tx_data[0],&rx_data[0],D_SIZE);
/* ... run forever */
while(1);
/* USER CODE END */
}
/* USER CODE BEGIN (4) */
uint32 checkPackets(uint8 *src_packet,uint8 *dst_packet,uint32 psize)
{
uint32 err=0;
uint32 cnt=psize;
while(cnt--)
{
if((*src_packet++) != (*dst_packet++))
{
err++; /* data error */
}
}
return (err);
}
/* USER CODE END */