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 sci code doesn't allow simultaneous transmit & receive

Other Parts Discussed in Thread: HALCOGEN

I'm using Halcogen for a TMS570, and the code generated for the SCI has just one pointer (g_sciTransfer[0].data) for both send and receive buffers.  This means you can't send and receive simultaneously,  and if you attempt to do so, the receive data will actually corrupt the send data memory. 

This seems like an obvious flaw, but it doesn't bother me as long as I can edit the sci.c code and still do Halcogen updates.  Is there a clean way to modify sci.c and not lose my changes if I later use Halcogen to say add another peripheral?

  • Yes Bryan there is a safe way to edit driver files.

    In the driver file ( sci.c, spi.c etc..) there are sections like /* USER CODE BEGIN (1) */ /* USER CODE END */ .. Anything placed between these lines will not be disturbed even if the code is regenerated with same project file.

    Best Regards
    Prathap

    Note: If your think your question is answered please click Verify Answer. Thanks..  

     

  • I am familiar with the /* USER CODE BEGIN (1) */ /* USER CODE END */ sections in other files, but sci.c has no such sections.

    Checked on Halcogen v2.08 & v2.11.

     

     

  • Sorry Wade, I assumed with HALCoGen v2.11 you were using TMS570LS31x or RM4x family. Guess you are using TMS570LS2x Family. ( correct me if I am wrong)..  
    Yes this is captured as Enhancement request and sent to the respective team. Future release will have the "USER CODE " support added to SCI.

    Mean while if you need a temporary solution please replace c:\Program Files\Texas Instruments\Hercules\HALCoGen\v2.11\drivers\TMS570LS20216SZWT\SCI570v000\sci.c with attached file. 1263.sci.c.. Create a new pjt in HALCoGen and generate code. I advice you to take backup of the original sci.c just in case.

    Best Regards
    Prathap

  • Thank you.  I replaced the file, and Halcogen is now producing USER CODE sections in sci.c.

    However fixing the simultaneous send/receive problem in USER CODE sections is cumbersome at best.  I suggest a future version of Halcogen with a small change to the driver code could greatly improve its usefulness.  The sci transfer structure simply needs separate length  and data pointers for send and receive...

    struct g_sciTransfer
    {
        unsigned       mode;
        unsigned       lengthTx;
        unsigned char *dataTx;
        unsigned       lengthRx;
        unsigned char *dataRx;
    } g_sciTransfer[2];