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: SDSPI Library triggers ESTOP0

Part Number: TMS320F28377D
Other Parts Discussed in Thread: C2000WARE

Tool/software:

Dear TI forum,

i am currently developing on on a F28377D using C2000Ware_5_03_00_00. In order to access the SD Card, i am using the fatfs and sdspi library provided in C2000Ware. As long as the SD Card is inserted, everything works totally fine. Whenever I remove the card and then try to access it again, or when I remove and put it back in, the file sdspi.c throws an ESTOP0 in line 417.

/* Single block read */
if (sectorCount == 1) {
    sendCmdResult = sendCmd(handle->spiHandle, CMD17, sector);
    recvStatus = recvDataBlock(handle->spiHandle, buf, SD_SECTOR_SIZE);
    if ((sendCmdResult == 0) &&
         recvStatus) {
        status = SD_STATUS_SUCCESS;
    }
    else
    {
        ESTOP0;
    }
}


Why does the library behave this way and does not just return an SD_STATUS_ERROR, as done in many other parts of that file? Is there any way to prevent that behavior, since it halts the entire microcontroller?

Thank you very much for your response in advance!

Kind regards

  • Hi Nicole,

    The emulation stop commands are added in there for debugging purposes. When the app is deployed and running without a debugger connected, these commands will be ignored.

    To change this behaviour, you can go ahead and edit these lines in sdspi.c to update the status flag instead. Then you can rebuild the project at [c2000ware]\libraries\fatfs\ccs\f2837xd. This will regenerate the .lib which can now be linked and used with your application.

    Regards,

    Arnav

  • Hi Arnav,

    Thank you for your response! In that case, I guess i will just accept that behavior and put a note that that it is intended in that case. When the debugger is not connected, the correct error status gets returned anyway.

    Regards,

    Nicola