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.

Starterware (1.1.0.6) Example SD_SPI_Flasher with Sysbios using doesn't work with activated cache. Why?

Other Parts Discussed in Thread: SYSBIOS

I've problems to use your mmcsd examples inside of our sysbios project for integrating of a filesystem. There is one example SD_SPI_Flasher, which is written as Sysbios project (not only Bootloaderproject). But it isn't using the cache:

Cache.enableCache = false; // inside of cfg file

If I switch on the cache, it doesn't work anymore! The read first block of sd-card is getting wrong data (cache problems?) with no file-system as result.


1. How this example must be changed to work with using cache?

2. Can I use the edma instead of polling the mmcsd-registers by cpu?

  • correction: I use starterware v2.0.1.1 in sysbios-ind/sdk v1.1.06
  • Hi Frank, Refer to other example to enable EDMA.
    In which stage is it going bad? Read/Write?
    I think performance optimization is not required for Flashing. Usually it will be more useful in case of Reads.
    Regards,Murali Krishna
  • Hi Murali,

    It's the polling (no use of edma) method of reading and writing data from/to mmcsd-interface in this example. But I've found the bug in it!

    If you don't use the edma transfer, mostly of reads from mmcsd-interface to a software buffer will direct placed into the cpu-cache and not into the ddr-ram!

    In this case, if there is a call of

    Cache_inv(ptr, (512 * nblks), Cache_Type_ALLD, 1);
    or
    CacheDataInvalidateBuff((unsigned int) ptr, (512 * nblks));

    behind the reading of data from mmcsd-interface, the real ddr-ram content will be overwriten to the cache. But if the data was only placed to the cache, the data will be overwritten then!

    So this example is working only if the cache is globaly deacitivated, or if the edma-mode is added or if the cache-functions are removed!!!
  • This application example is wrong! I've the problem found.

    This example works only if cache is globaly deactivated!

    Why?

    With a non-edma polled methode of reading data from mmcsd-interface with globaly activated cache, the data will read mostly to the cache itself, not to the ddr-ram! So a call of

    CacheDataInvalidateBuff((unsigned int) ptr, (512 * nblks));

    will overwrite the correct cache data with illegal ddr-ram-data!

    The call of CacheData-functions should only taken in edma mode! Not in polled mode!

    Solution is simple: make CacheData-function-calls only in edma-mode of your drivers-lib! Remove the call in polling mode, otherwise you will get wrong data at every read!