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.

SafeTI Diagnostics Library HAL layer differs from HalCoGen generated code

Part Number: TMS570LS3137
Other Parts Discussed in Thread: HALCOGEN

Hello,

I noticed that after running the SCI loopback test using the SafeTi Diagnostics Library (SDL, version 2.4.0_LDRA_Less) the SCI interface would stop working. I figured out that bit 16 of the SCIGCR1 register (for enabling loopback) was remaining set to 1.

Checking the implementation of SL_SelfTest_SCI, it calls the SL_sciEnableLoopback function, which indeed sets bit 16 of the SCIGCR1 register to 1, but then forgets to reset it to 0 after the self test is finished.

Comparing with the SCI module generated by HalCoGen (v4.07.01), the sciEnableLoopback function does not make use of bit 16 of the SCIGCR1 register.

My question now is, which implementation is correct, i.e. is setting bit 16 of the SCIGCR1 register required to run the loopback tests on the SCI interface? And if yes, why does the SDL implementation not reset the bit once the self test is run?

Thank you for the clarifications.

Regards,

Aaron

  • Hi Aaron,

    I started working on your issue and will provide an update ASAP.

    --

    Thanks & regards,
    Jagadish.

  • Hi Aaron,

    First of all, apologies for the delay in my response. And appreciated your patience.

    Both are different loopbacks.

    I mean loopback using 16th bit (LOOP BACK) of SCIGCR1 is different from the loopback using IODFTCTRL register (IODFTENA & LPB ENA). That means both are independent loopbacks, Either you can do loopback using 16th bit (LOOP BACK) of SCIGCR1 (Or) you can do loopback using IODFTCTRL register.

    The key difference is the loopback using 16th bit of SCIGCR1 is like a safe loopback. That means this loopback can be done even if SCI connected with other SCI device, without affecting the actual communication.

    Loopback using 16th bit of SCIGCR1:

    In this loopback SCITX internally connected with SCIRX, but externally SCITX pin will be in logic-High and SCIRX will be in open impedance until again this loopback is disabled.

    So, until this loopback test completes the other end SCI device receiving pin will reads logic-High only. And other end device cannot send any data to this device as its SCIRX pin is in high impedance mode.

    Loop Back using IODFTCTRL:

    This loopback is further divided into two sub loopbacks:

    Digital Loopback and Analog Loopback.

    The main difference between these two loopbacks is In analog loopback mode the complete communication path through the I/Os can be tested, whereas in digital loopback mode the I/O buffers are excluded from this path. That means in digital loopback I/O buffers will get disabled, so no data will be transmitted to output or Tx line. Whereas in analog loopback the complete path will be tested, so the data can be seen at Tx line as well and this data get looped to Rx line automatically.

    This loopback will be encouraged to do only before connecting to other SCI device. I mean this loopback will not be encouraged to do in the middle of communication. Because especially the analog loopback mode in this testing will be affected by another device or it can also affect the other device. I mean the loopback testing data will pass to the other SCI device or the loopback data will get affected by other end SCI device.

    --
    Thanks & regards,
    Jagadish.

  • Hi Aaron,

    For your better understanding i did some testing with different combinations and here are results:

    1. Only IODFTCTRL analog loopback enabled:

    As you can see in above code i just disabled the SCIGCR1 loopback and enabled only IODFTCTRL analog loopback.

    In this testing i can see the data in the RD register that means data was loop backed and i also received my data on the serial terminal that means I/O buffers not disabled in this mode.

    2. Only IODFTCTRL digital loopback enabled:

    As you can see in above code i just disabled the SCIGCR1 loopback and enabled only IODFTCTRL digital loopback.

    In this testing i can see the data in the RD register that means data was loop backed but i didn't received any data on the serial terminal that means I/O buffers are disabled and loopback happened internally only.

    3. Loopback using only 16th bit of SCIGCR1:

    As you can see in above code i just enabled the SCIGCR1 loopback and disabled the IODFTCTRL loopback.

    In this testing also i can see the data in the RD register that means data was loop backed but i didn't received any data on the serial terminal that means this loopback also happened internally. The main difference between this loopback and digital loopback is, in this loopback the Tx pin output will becomes High and Rx pin will be in open drain state, that will not happen in the digital loopback, in digital loopback only I/O buffers will get disabled.

    3. Loopback using both 16th bit of SCIGCR1 and IODFTCTRL analog loopback:

    As you can see in above code i enabled the SCIGCR1 loopback and also the IODFTCTRL analog loopback.

    In this testing also i can see the data in the RD register that means data was loop backed but i didn't received any data on the serial terminal. This is similar behavior of SCIGCR1 loopback, because this loopback will internally connects the Tx and Rx pins, and Tx pin will be in High and Rx pin will be High impedance state.

    --

    Thanks & regards,
    Jagadish.

  • Hello Jagadish,

    Thank you for the extensive explanation, this makes sense to me now!

    Best regards,

    Aaron