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 bug report sci.c

Other Parts Discussed in Thread: HALCOGEN, TMS570LS0432

The newest HALCoGen 03.08.00 software generates SCI.C code with bugs for at least the TMS570LS0432 (the only one I have tested.  The attempts to bring the code up to misra C standard is appreciated but it has introduced at least one error.  There are several spots in the SCI.C file in the file that have

sci->TD = *(uint32 *)g_sciTransfer_t.tx_data;


which should instead be

sci->TD = (uint32)(*g_sciTransfer_t.tx_data);

This causes lost bytes when transmitting data (in my case the string was not 32 bit aligned likely ensuring issues would arise with the code).

 

Also one more similar line that needs to change over to

sci->TD = (uint32)(*data);

for the same reason.

You want to dereference the pointer to a 8-bit value and then convert it to 32-bit not convert the pointer to an 8-bit value to a pointer to a 32-bit value and then dereference.  Changing the pointer appears to be causing some boundary issues when reading resulting in lost characters during transmission.  My noted fix solves this issue and also makes sense code wise.

PS I am also using FreeRTOS but I do not believe that will change the result.

 

  • Pascal,

    Thanks for sharing your findings and workaround.  I have notified the appropriate owners of this code.

    Best Regards,

    Brian

  • Thank you for the really quick reply. 

    Also note that despite some set backs such as this, the conversion to better meet some of the stricter safety coding requirements is *greatly* appreciated as I am starting a new project in which we want the code to meet at least a subset of MISRA C for reliability purposes.

    Sincerely,

    Pascal Poirier

  • Hi Pascal,

    The above SCI bug is already filed and Fixed in upcoming Patch release.
    HALCoGen Patch release 3.08.01 is almost ready to be released, it is going through the test cycle which is improved to run on all device varients.
    There are 3 minor issues with 3.08.00, mostly it is Typo and TMS device varient Type cast issue on SCI module. The Patch release has all the known issues fixed.

  • Call me impressed for the quick turn around.  I have tested the new patched update and it works perfectly. 

    I have other issues left but I don't expect you to solve my source code. :)

    Pascal Poirier