Other Parts Discussed in Thread: C2000WARE
Hello,
One of my customer is facing an issue with the CAN conversion of the TMS320F28377S.
He agreed to share his issue on the forum so I hope you will be able to help us on this topic.
Here is his description of the issue :
I need some help because I'm facing a problem with CAN interface on 377s, using driverlib (C2000Ware_1_00_03_00)
I've looked for some idea in C2000 wiki but I haven't found an answer....
I'm trying to setup both CAN interfaces (CANA and CANB) with a general purpose driver, compliant with out specific requirements.
At this moment I don't know which CobID the application need to transfer nor which could be the message length
I have started to write my code from the examples from C2000Ware and I'am able to transmit and receive data
(the device has loopback enabled)
In the attached code if I change at run time (with CCS) the variable vIntTxCobId_guh, the CAN_readMessage return the received data
But if I change the variable vIntTxDlc_guc I can see frame with different length on CAN TX pin but the CAN_readMessage returns
always false
I've also tryed adding "CAN_disableController" before the 2 "CAN_setupMessageObject" and a CAN_enableController" after
but any frame has been received.
Is it possible to dynamically change the msgLen?
Otherwise which could be a solution?
Do I have to setup a different mailbox for each msgLen (from 1 to 8)?
------------------------
I haven't understood the behaviour of CAN_getStatus
I've added the call vStatus_guh = CAN_getStatus(CANA_BASE);
Also when I receive data correctly (no changing in msgLen) I've never seen the RxOk flag at 1 (Bit 4 of CAN_ES Register)
vStatus_guh = 8
Is this correct?
------------------------
I have taken a look at the file can.c in C2000Ware_1_00_03_00\driverlib\f2837xs\driverlib
Are the CANA_BASE constant correct?
------------------------
row 556.....
//
// See if there is new data available.
//
if((msgCtrl & CAN_IF2MCTL_NEWDAT) == CAN_IF2MCTL_NEWDAT)
{
//
// Read out the data from the CAN registers.
//
CAN_readDataReg(msgData, (int16_t *)(base + CAN_O_IF2DATA),
(msgCtrl & CAN_IF2MCTL_DLC_M));
status = true;
//
// Now clear out the new data flag
//
// Transfer the message object to the message object specified by
// objID.
//
HWREG_BP(CANA_BASE + CAN_O_IF2CMD) = CAN_IF2CMD_TXRQST |
(objID & CAN_IF2CMD_MSG_NUM_M);
//
// Wait for busy bit to clear
//
while((HWREGH(CANA_BASE + CAN_O_IF2CMD) & CAN_IF2CMD_BUSY) == CAN_IF2CMD_BUSY)
{
}
}
row 584