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.

TMS320F280039: The LINTD and LINRD register are wrong when debugging LIN example project

Part Number: TMS320F280039
Other Parts Discussed in Thread: C2000WARE

Hi Champs,

Now I debug the project in C:\ti\c2000\C2000Ware_4_03_00_00\driverlib\f28003x\examples\lin\lin_ex7_external_loopback, my CCS version is 12.2. I did not make any modifications. I found LINTD and LINRD register have something wrong.

When the code runs to the for() loop in LIN_sendData(LINA_BASE, txData), which is the code in the figure below, I found that there is a problem with the data of the LINTD1 register. 

When the first for() loop ends, the value of the register is displayed as follows, both TD5 and TD7 are assigned the value 0xEF.

After looping 2-4 times, the register and memory browser display as follows:

2:

3:

4:

I read in the TRM that only the lower 32 bits are valid for LINTD1, so it looks like the value written in the upper 32 bits is invalid. I'm not sure if I made it clear, what I mean is that LINTD1 should be assigned the value 9AAB CDEF 0000 0000 in the memory browser, not CDEF CDEF 9AAB 9AAB. And LINRD1 and LINTD1 have the same problem.

Could you please help to check it? Thanks!

Best Regards,

Julia

  • Hi Julia,

    Can you check if this is just a "Memory Browser" issue by directly reading the register and storing in a variable? I've seen the LIN register view be incorrect from time to time, even though the data in the actual device is correct. Sometimes it gets shifted.

    Regards,

    Vince

  • Hi Vince,

    I found that no matter what I change the code in the for loop of LIN_sendData in lin.c, the register shows the same result. As shown in the picture below, you can see that I have commented the code that writes the LINTD0 register, but the register is still being written with a value. And it's not in the correct position.

    I try to read the value of the register but I don't know why it keeps showing 0.Below is my configuration.

    But I can read the address

    Could you please try to debug this code to see if it can be reproduced? Now customers are eager to solve this problem. Thanks!

    Best Regards,

    Julia

  • Julia,

    The address you are reading from is wrong. Please use something like the following (change to LINB_BASE if you're using LINB):

    // using a driverlib function, this is preferred:
    uint16_t rxData[8] = {0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF};
    LIN_getData(LINA_BASE, rxData);
    
    // -OR- manually reading values
    uint16_t *pData;
    *pData = HWREGB(base + LIN_O_RD0 + ((uint32_t)i ^ 3U))

    Regards,

    Vince