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.

TMS320F28P650DK: LIN: Sci multibuffer mode doesn't work properly

Part Number: TMS320F28P650DK
Other Parts Discussed in Thread: C2000WARE

Hi, experts,

I made the following changes in the example "lin_ex2_sci_loopback" to test the multibuffer mode:

1. Use “LIN_enableMultibufferMode” instead of “LIN_disableMultibufferMode” to enable multi-buffer Mode;

2. Change macro definition "FRAME_LENGTH" to 4

3. Transmit 4 bytes consecutively using "LIN_writeSCICharBlocking"

Then I encountered the following problem:

1. RxIsr was not triggered;

2. When I step through the register configuration, I find that no matter what value is set, SCIFORMAT.LENGTH is always equal to the set value of SCIFORMAT.CHAR, not the value I expect

Did I miss something or get something wrong? Look forward to your help.

Shawn

  • Hi Shawn,

    Thanks for your question.

    1. RxIsr was not triggered;

    This part is happening because of what you mention in #2. If the .LENGTH is not set correctly, it won't trigger an interrupt until the .LENGTH (which you are saying is set to 8) is reached.

    2. When I step through the register configuration, I find that no matter what value is set, SCIFORMAT.LENGTH is always equal to the set value of SCIFORMAT.CHAR, not the value I expect

    This is a bit more strange. Can you step through the code and see before/after stepping into the "LIN_setSCIFrameLength" function what the value of "FRAME_LENGTH" is? And also step into the function and see if maybe it's not writing properly? You can step through the code and see what happens in the "Register View" window to see if it's not setting properly, or if the variable itself is being overwritten somewhere in the code.

    Regards,

    Vince

  • Hi, Vince

    I steped through the code, and found that the register value did not change as expected.

    1. Before LIN_setSCICharLength, LENGTH and CHAR are all 0

    2. After LIN_setSCICharLength, both of them changed to 7, which was the expected value of CHAR

    3. After LIN_setSCIFrameLength, both of  the values are 7, and LENGTH was not changed to 3

    4. Here's another problem, after LIN_enableIntLoopback, SCIFCR1.LOOPBACK was not set. I don't know if loopback really works.

    I modified the original routine directly, I don't know if I missed anything. Look forward to your help.

    Shawn

  • Hi, Vince,

    I tried to view the value of the register in different ways and found that I could not correctly read the high bits of the register through Expressions view or Registers view, but I could see the contents of the entire 64bit through Memory Browser, and find the mapping method was a little different from other peripherals.

    Please check whether there are problems with the CCS Expressions and Registers display, or is there anything I can adjust to make the CCS display correctly?

    Regards,

    Shawn

  • Hi, Vince

    I made some adjustments and the program is now working, and the following questions remain:

    1. The register value observed by CCS does not match the actual register value, which is inconvenient during debugging, Is there a way to deal with it?

    2. In multi-buffer mode, there seems to be no way to observe the value of the 3-bit counter, and I can only judge the reception status by RXRDY and the associated interrupts, is that correct?

    3. If I want to reset the multi-buffer function when an exception occurs in the reception, especially the 3-bit counter, is it possible to use SCIGCR1.SWnRST?

    Regards,

    Shawn

  • Hi ShawnYu,

    1. The register value observed by CCS does not match the actual register value, which is inconvenient during debugging, Is there a way to deal with it?

    This is a known bug that will be corrected in the next revision of C2000Ware.

    2. In multi-buffer mode, there seems to be no way to observe the value of the 3-bit counter, and I can only judge the reception status by RXRDY and the associated interrupts, is that correct?

    Correct.

    3. If I want to reset the multi-buffer function when an exception occurs in the reception, especially the 3-bit counter, is it possible to use SCIGCR1.SWnRST?

    Yes, you should be able to use SWnRST.

    Regards,

    Vince

  • Hi, Vince,

    I am clear about the above questions, thank you for your answers.

    Shawn