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.

TMS320F28377D: When using the XDS560V2 emulator to debug, calling the FlashAPI the program will runaway

Part Number: TMS320F28377D

Hi team,

Here's an issue from the customer may need your help:

CCS version is 9.3.

Using the xds560V2 emulator to debug 28377d programs, when calling FlashAPI to erase the N sector, the program cannot work properly (An irregular write, while previous flash writes can be successful).

The xds100v3 emulator is used but does not have this issue. It is also good to operate the flash when the program downloaded with these two emulators is running offline.

The Flash write command is transmitted to DSP via the serial interface. Functions that mask flash writes do not exhibit the above issues.  CCS sometimes displays out at address 0x0 or 0x3ff16a when a problem occurs. Sometimes it also suddenly stops at _Fapi_issueFsmCommand. The program can only be downloaded again after flying and cannot be restarted.

Could you help look into this case? Thanks.

Best Regards,

Cherry

  • Hi Cherry,

    Just to make sure that I am understanding the problem correctly, the user is unable to erase the N sector of the flash with the xds560v2?  They are able to successfully erase the sector with the xds100v3? Also the program runs fine when no JTAG debug probe is connected?

    Best Regards,

    Ben Collier

  • Hello Ben,

    Thanks for your support and please let me specify the case here:

    Using the xds560 erase is a program that calls flashapi to read and write internal flash, but the emulator used by debug is xds560. When an SCI command is issued externally, there is a high chance that an error will be reported on a particular call during the lower computer program call flashapi to read and write.

    However, when doing the same with xds100v3, no error is reported. The lower computer program is running in BCDEF, not in N sector. 

    Debug via the xds560, send commands to DSP over the serial interface and DSP calls flashapi for data erase and write. The purpose of connecting the emulator is to see if the data was written correctly, but during this process, However, in this process, CCS errors and direct reset of DSP will occur randomly and occasionally.  But before that, the data can be written correctly.

    With the same procedure, debugging with emulator xds100v3 does not have the same issue.

    And please be noted that the program works fine offline regardless of which emulator is used. 

    Please let me know if anything unclear. 

    Thanks and Regards,

    Cherry

  • Hi Cherry,

    So there is something in their program so that the F28377D does a flash erase when it receives a certain command over SCI? 

    Could you show me how the the customer is using the flash API? Are you able to share code here, or can you send that section of their program in a private message? 

    Best Regards,

    Ben Collier

  • Hi Ben,

    Could you show me how the the customer is using the flash API? Are you able to share code here, or can you send that section of their program in a private message? 

    Please see the code:

    Fullscreen
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    void Flash_Write(Uint32 address,Uint16* Buffer,Uint16 length,uint16_t Status)
    {
    Uint32* Buffer32 = (Uint32*)Buffer;
    Uint32 u32Index = 0;
    Uint16 i = 0;
    // Disable ECC. ECC does not have to be disabled to do FSM operations like
    // program and erase.
    // However, on Sonata Rev. 0 silicon, due to an OTP ECC errata,
    // disable ECC to avoid ECC errors while using Flash API functions that
    // read TI-OTP
    EALLOW;
    Flash0EccRegs.ECC_ENABLE.bit.ENABLE = 0x0;
    EDIS;
    EALLOW;
    // Before performing FSM operations, set the waitstates for FSM operations
    // calculated using RWAIT = (SYSCLK/50MHz)-1
    // If RWAIT results in a fractional value, round it up to the nearest
    // integer.
    XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

    Fullscreen
    1
    2
    3
    4
    5
    6
    7
    8
    9
    uint16_t Data_r[150];
    float_to_Byte(Location_PID_Data1[0].KP, &Data_r[0]);
    float_to_Byte(Location_PID_Data1[0].KI, &Data_r[4*1]);
    float_to_Byte(Location_PID_Data1[0].KD, &Data_r[4*2]);
    float_to_Byte(Location_PID_Data1[0].MAX_Integration, &Data_r[4*3]);
    float_to_Byte(Location_PID_Data1[0].MIN_Integration, &Data_r[4*4]);
    float_to_Byte(Location_PID_Data1[0].Offect_Num, &Data_r[4*5]);
    Flash_Write(Bzero_SectorM_start, Data_r, 136, 0);
    XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

    Thanks and Regards,

    Cherry

  • Hi Cherry, 

    The xds100v3 and the XDS560V2 use separate software for generating the bits that they send to the device. It is possible that this problem is caused by some issue in the software of the XDS560V2, and this would be a very specific and difficult bug to find. Is this a critical issue for your customer, or are they satisfied with using the xds100v3 since it does not have this issue? 

    Best Regards,

    Ben Collier

  • Hi Ben,

    Is this a critical issue for your customer, or are they satisfied with using the xds100v3 since it does not have this issue? 

    Although it is okay to debug with xds100v3, the download speed is slower than expected and the xda560 is now used for faster debugging. It would be great to find the cause.

    Thanks and regards,

    Cherry

  • Hi Cherry,

    I agree that it would be great to find the cause, but this is likely not an issue with the C2000 device, but rather the XDS560 debug probe. I have asked one of the owners of the software for the XDS560 if they know what could cause this issue, but they said that they have not heard of this issue before, and they do not have time to look into the specific code, unless this is a critical issue.

    Would your cusomter be open to trying a different JTAG debug probe? The XDS110 would be faster at debugging than the XDS100, with the option to set TCK frequency as high as 14MHz. The XDS200 debug probe can be set to run at 20MHz.

    Best Regards,

    Ben Collier