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.

HALCOGEN 3.0 issue related to CAN driver

Other Parts Discussed in Thread: HALCOGEN

I don't know if this is already reported. I did not see one.

There is a strange defect in CAN driver code:

/** @file can.c
*   @brief CAN Driver Source File
*   @date 15.dec.2011
*   @version 3.00.000 ..... */


The following busy wait loop is sprinkled throughout the code,

/** - Wait until IFx is ready for use */
while ( (node->IFxSTAT & 0x80) == 1 )
{
}


What is this supposed to do? Wait for Bit7 to clear? If it is- this code would not do it, since the expression (IFxSTAT & 0x80) cannot ever ==1

 It should be != 0

 

  • It looks like this defect is specific to the CAN driver code generated for TMS570LS31xx CAN (ti\Hercules\HALCoGen\v03.00.00\drivers\TMS570LS3137ZWT\CAN570v000\can.c) (and same for V2.11 - dcan.c)

    Code generated for TMS570LS20xx can is correct ( ti\Hercules\HALCoGen\v03.00.00\drivers\TMS570LS20216SZWT\CAN570v000\can.c)

     Comparing the two uncovered another problem that the Data Length Code used in the canInit() routine  is wrong in TMS570LS31xx can driver. It uses MBOX3 DLC for all MBOXs. Normally you will be overwriting this field when you do tx, but the driver code canTransmit() does not  change/check DLC.  8 bytes all the time.

     

  • Happy to see that these issues are fixed in version 03.00.01

    Thanks

  • Hi Joson

    Happy to see that you are using the latest HALCoGen.

    Best Regards
    Prathap