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.

SPI with EDMA on OMAPl138

Other Parts Discussed in Thread: OMAPL138

I've recently started with SPI with DMA on OMAPl138. I have tried to test the example spiEDMA coming with StarterWare. The compiling of the code works well but when I try to debug in the experimenter kit it fails in the downloading time (ARM9_0: GEL: File: C:\Archivos de programa\Texas Instruments\OMAPL138_StarterWare_1_10_01_01\build\armv5\cgt_ccs\omapl138\evmOMAPL138\spi_edma\Debug\spiEdma.out: a data verification error occurred, file load failed.)

So I tried to compile it to use C674x core and I can start the execution. The problem is that it doesn't work always, some times the transfer from the memory to the SPI port doesn't work just because the inclusion of a new code line like an assignment of an unused variable. I thought that it could be compiler problem but I have installed the last actualization (TI v7.3.1) and the problem remains. I'm not able to make work the reading to from the SPI to the memory too.

 

I need some help.

Thanks.

 

  • For the ARM side, sounds like you don't have the DDR configured yet before trying to load code into it. Make sure your  GEL file is doing that before you load.

    For the DSP side, what level of optimization are you using? If you modify that option does the behavior change?

    Jeff

  • Hello Jeff,

    I already tried to change the optimization levels. I'm using none optimization, by the way, is it the same no selecting any level or size optimization as using 0? But it wasn't the problem. While I was trying again to solve the problem by changing the optimizations I found the solution.

    The problem is that some part of the data array used to be transmitted from the memory to the SPI was in a cache block so I was writing the cache and seeing these values in the debugger window, while the edma was reading from the memory. So I need to make a writeback send the data with the EDMA-SPI and then a cache invalidate to be able to use the data received by the SPI.

    Another questions come to my mind:

    - Can I reserve memory and be sure that is or isn't in cache?

    - How I use Cache_wb and Cache_inv?. Because I'm trying to write back and invalidate a memory region but it seems to affect the whole memory.

     

    Regards.

  • Marcos,

    On the DSP side, you can disable ranges of memory via the DSP's MAR (Memory Attribute Register).  This is available via the CacheEnableMAR() function. This operates on 16 MB sections of memory.

    For use of the Cache_wb and Cache_inv, please see examples in the examples/evmOMAPL138/cache_mmu directory.

    Regards
    Kyle