Other Parts Discussed in Thread: HALCOGEN
Hello,
I am working for a client to deliver a project based on TMS470 micro. My first task is to get a simple scheduler working using rti (working), send a byte on UART and loop it back on same UART (Working) and finally send a fixed message on DCAN2 that is used as high speed can with an external transceiver. The drivers for all the above were generated using halcogen.
The problem: Every time I hit the can_transmit (in my 5ms task), I am getting an error notification please see the code snippet below
void Task_5ms()
{
uint8 retval = 0;
retval = canTransmit(canREG2, canMESSAGE_BOX3, ft_tx_ptr);
if(retval)
while(hs_tx_done == 0){}; //Wait for CAN transmission to complete. This flag is set in the canMessageNotification function
sciSend(sciREG1, 8, data_UART);
}
I see that the node->IF2DAT contains the data that I intend to send when I put a break point inside canTransmit. I have configured MESSAGE_BOX3 as transmit in halcogen, I have enabled both error and message notifications in my initialization.
Further, I put a breakpoint in the ISR and I see that it hits the ISR after calling canTransmit but always with an error! So the control always goes to error notification.
void can1HighLevelInterrupt(void)
{
uint32 value = canREG1->INT;
if (value == 0x8000U)
{
canErrorNotification(canREG1, canREG1->ES & 0x1E0U);----------------------------------------> Always goes to error notification.
return;
}
I have an up and running CAN monitoring tool connected on the bus which will send acknowledge.
I checked the ErrStat register and it displays 0xE5 most of the time. some trials the breakpoint hits as soon as I start the program and I see that the value of register is 0x05.
From the data sheet I understand that it is bit error on CAN, am I right? I even tried puttig a 120 ohm termination at the CAN_H and CAN_L lines but nothing seems to work. All am stuck with is CAN error notification. Can someone help me with way forward? How should I proceed with debugging? Please help.
Regards,
Shankar