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 Driver Issue

Other Parts Discussed in Thread: HALCOGEN

Hi,

Am working on RM46 controller. The code generated from Halcogen is for IAR. The following are some issues which am facing:-

  1. For CAN driver, there is not API found to set/get DLC. Tx function "canTransmit" is blindly transmitting 8 bytes without checking the DLC.
  2. CAN Rx function "canGetData" does not gives the DLC bytes count.
  3. In "linHighLevelInterrupt" in Tx interrupt handling, there is a bug in the code. Always it will transmit a byte less.
  4. When generating code for HET driver using Halcogen, the code gives compiler error as "#elif defined(_TMS470_LITTLE) || defined(__little_endian__)" is not taken into consideration by IAR compiler.

Can anyone please take a look on these Halcogen related issues?

  • Hello Shincy,

    I will forward your concerns to the Halcogen team so that they may address your questions/issues.
  • Hi Shincy Shaji,

    What version of HALCoGen are you using. 4.04.00? 

  • Hi Prathap,
    Am using 4.04.00 version of Halcogen.
  • Hi Shaji,

    Ans :1 ) That's correct there is no dedicated API for setting DLC, but it is not needed since configurations can be made for every Mailbox through GUI and canInit will take care of it. 

    Ans 2:) "canGetData" using IF2 knows the corresponding mailbox's DLC configuration and copies the necessary number of bytes 

    Ans 3:) From HALCoGen perspective default "linHighLevelInterrupt" does just branch to notification passing the interrupt Flag. Data handling must be done by the user, I am not sure how you handled the data. Can you share source code for me to comment. 

    Ans 4:) I have some problem with my IAR install, I will reinstall IAR and see if there is any issue. Give me a day. 

    "linHighLevelInterrupt"

  • Hi Prathap,

    Thanks for the reply. Please find inline comments.

    Ans :1 ) That's correct there is no dedicated API for setting DLC, but it is not needed since configurations can be made for every Mailbox through GUI and canInit will take care of it.

    Ans 2:) "canGetData" using IF2 knows the corresponding mailbox's DLC configuration and copies the necessary number of bytes

    In my application, I need to change DLC during run time for each mailbox as am having varying data to be send through it. Also while receiving, my application layer needs to know the no: of data bytes received.

    Ans 3:) From HALCoGen perspective default "linHighLevelInterrupt" does just branch to notification passing the interrupt Flag. Data handling must be done by the user, I am not sure how you handled the data. Can you share source code for me to comment.

    Below I have copied the HALCoGen generated code for Tx interrupt in "linHighLevelInterrupt".

    Consider the case of sending 1 byte of data : sciSend(sciREG, 1, &DataByte);

    At the entry point itself the data length is decremented so it won't sent the data.

    case 12U:
    /* transmit */
    /*SAFETYMCUSW 30 S MR:12.2,12.3 <APPROVED> "Used for data count in Transmit/Receive polling and Interrupt mode" */
    --g_sciTransfer_t[1U].tx_length;
    if (g_sciTransfer_t[1U].tx_length > 0U)
    {
    uint8 txdata = *g_sciTransfer_t[1U].tx_data;
    scilinREG->TD = (uint32)(txdata);
    /*SAFETYMCUSW 567 S MR:17.1,17.4 <APPROVED> "Pointer increment needed" */
    g_sciTransfer_t[1U].tx_data++;
    }
    else
    {
    scilinREG->CLEARINT = (uint32)SCI_TX_INT;
    sciNotification(scilinREG, (uint32)SCI_TX_INT);
    }
    break;

    Ans 4:) I have some problem with my IAR install, I will reinstall IAR and see if there is any issue. Give me a day.

  • Ans 3:) Oh.. You are using SCI mode of LIN. Sorry I was referring to lin.c in my earlier comment. When TX interrupt is enabled, and you call "sciSend" API, one data will be already placed in the register in this API, rest all are in the ISR.

  • Hi Prathap,
    Thanks Prathap.. You are correct.. I didn't noticed that..
    Can you help me on CAN DLC bytes issue?
  • Hi Shaji,

    You can reconfigure a Transmit Objects DLC on the fly with the sequence described in the TRM section "Changing a Transmit Object" and "Reconfiguration of Message Objects for the Transmission of Frames".

    For Receive Objects the DLC will automatically be updated, as per DLC in the received frame, please refer to TRM section "Configuration of a Single Receive Object for Data Frames".

    Best Regards,
    Christian