TS201 cache flush

I use part of internal memory in TS201 as a buffer to save some debug info. Section address is 0xC1000 size is about 1000 words. Idea is that when application is running it writes to this buffer some statistics. And when application crashes I can download other firmware to that DSP and read debug info from known place.

I found that when application uses cache, this debug idea doesn't work. When I comment macros "cache_enable(750)" everything works fine. I suppose that's because all debug info I write to debug section goes to cache and doesn't go to phisical RAM. That's why when application craches and I read data from debug area (address 0xC1000) I can't find anything.

How can I flush cache to be sure that data will be written to phisical RAM? I found that there is __builtin_flush for Blackfin processor, but I can't find such function for ADSP TS201.

  • Problem is solved. To flush cache I use cache copyback comand. Description I found in programmers manual. Following code flushes cache for certain data block:

    asm("#include <defts201.h>");
    asm("J1 = 0x00000000 ;;");
    asm("CCAIR6 = J1 ;;");
    asm("J0 = (CACMD_CB | (0x80 << CACMD_LEN_P) | CACMD_NOSTALL ) ;;");
    asm("CACMD6 = J0 ;;");
  • 0
    •  Analog Employees 
    on Aug 2, 2018 4:50 PM
    This question has been assumed as answered either offline via email or with a multi-part answer. This question has now been closed out. If you have an inquiry related to this topic please post a new question in the applicable product forum.

    Thank you,
    EZ Admin