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.

locating buffer in SDRAM rather than internal

Other Parts Discussed in Thread: THS1206

Hi,

I have a C6713DSK talking with a THS1206 using the example program provided for the DCP (data converter plugin).

My new problem is that when I move the buffer the data is read into from internal memory to the external SDRAM, which is located at 0x8000 0000 to 0x80FF FFFF, the program runs to completion but no data is written to the buffer.

Any ideas?

Thanks,

Harry

  • Open the memory window and try to manually write values to the 0x80000000 address. If you are unable to write and readback data, try running the GEL functions to initialize the SDRAM again.

    Jeff

  • Harry Thompson said:
    My new problem is that when I move the buffer the data is read into from internal memory to the external SDRAM, which is located at 0x8000 0000 to 0x80FF FFFF, the program runs to completion but no data is written to the buffer.

    I assume you are reading the buffer in using the DMA? If so my initial suspicion is that you are looking at a form of cache coherency issue, you may want to make sure that the cache is invalidated for the SDRAM region before reading it to ensure your cache gets the latest 'version' of external memory that has been updated by the DMA. For the C6713 I believe you can use some CSL functions to initiate such cache operations, on more modern systems you would use BIOS based BCACHE APIs.

    EDIT: I did not see Jeff's post until after I posted, but he has another good point, it is certainly worth while to verify the SDRAM itself is functional.

  • I tried to use the CSL CACHE_invL2(buffer, size, CACHE_WAIT) function, but get an undefined symbol link error.

    I looked in csl_cache.h and see CACHE_invL2 is only visible for the C64 (ie,  "C64_SUPPORT" needs to be defined for that routine to be visible)

    Note: this is for the tools which come with the C6713 DSK & CCS 3.1

  • Harry Thompson said:
    I looked in csl_cache.h and see CACHE_invL2 is only visible for the C64 (ie,  "C64_SUPPORT" needs to be defined for that routine to be visible)

    Good point, the invalidate only capability was added in the C64x architecture, so it is not available for the C67x.

    In this case I think you will have to do a writeback/invalidate before starting the DMA to move the data into SDRAM, and than read the data afterwards, or alternatively disable caching for the region you are putting the data into with the MAR registers. Something like the below should work as an initial pass

    //setup code for DMA transfer to SDRAM...
    some_ADC_init_code();

    //do a writeback/invalidate to ensure the external memory you are about to use is not in cache
    CACHE_wbInvAllL2(CACHE_WAIT);
    //this could be done cleaner/faster with CACHE_wbInvL2(start address, byte count, CACHE_WAIT) for just the region of interest

    //start DMA transfer to SDRAM
    some_ADC_start_function();

    //wait for ADC to complete capturing the buffer...
    while(ADC_still_working) { /*wait*/ }

    //examine the data from the ADC now that the cache should have been empty for the region in question
    verify_incoming_data();