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.

CCS/TMS320F280049M: issue about CAN

Part Number: TMS320F280049M
Other Parts Discussed in Thread: C2000WARE

Tool/software: Code Composer Studio

 I have a problem running the example program in C:\ti\c2000\C2000Ware_1_00_01_00\driverlib\f28004x\examples\can.

 "can_ex1_loopback" worked normally but the "can_ex2_loopback"_interrupts cannot. it always stopped in        

if(errorFlag)
        {
            asm("   ESTOP0");
        } 

The reason is the transmit number(2) is larger than receive number(1).

I cannot find the certain solution. Please give kind help. 

  • Hello,
    I am writing to let you know that a C2000 team member has been assigned to this post and should be answering shortly.

    Regards
    Baskaran
  • Hello

    Yes, this looks to be a byproduct of a bug in the CAN driver. (See here: e2e.ti.com/.../606598)
    It affects the CAN_sendMesssage and CAN_setupMessageObject. A fix will be out in the next C2000Ware release.

    If you wish to fix temporarly for yourself, you can edit the can.c file.

    For CAN_setupMessageObject, at the end of the function replace with:
    //
    // Write out the registers to program the message object.
    //
    //HWREG_BP(base + CAN_O_IF1CMD) = cmdMaskReg;
    HWREG_BP(base + CAN_O_IF1MSK) = maskReg;
    HWREG_BP(base + CAN_O_IF1ARB) = arbReg;
    HWREG_BP(base + CAN_O_IF1MCTL) = msgCtrl;

    //
    // Transfer data to message object RAM
    //
    HWREG_BP(base + CAN_O_IF1CMD) = cmdMaskReg | (objID & CAN_IF1CMD_MSG_NUM_M);

    For CAN_sendMessage, at the end of the function replace with:
    //
    // Set Direction to write
    //
    //HWREG_BP(base + CAN_O_IF1CMD) = CAN_IF1CMD_DIR | msgCtrl;

    //
    // Set Tx Request Bit
    //
    //HWREG_BP(base + CAN_O_IF1CMD) |= CAN_IF1CMD_TXRQST;

    //
    // Transfer the message object to the message object specified by
    // objID.
    //
    HWREG_BP(base + CAN_O_IF1CMD) = CAN_IF1CMD_DIR | msgCtrl | CAN_IF1CMD_TXRQST | (objID & CAN_IF1CMD_MSG_NUM_M);

    I apologize for the inconvenience.

    Best regards
    Chris