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.

AM335x Enabling Cache

Other Parts Discussed in Thread: AM3359

Hey,

I want to do some benchmarking to compare der AM3359 on ICE board to another controller. In this context a want to enable the caches manually in a project without SYS/BIOS.

I included the Starterware File "cache.h" - the file is resolved by Code Composer Studio v5.4 - but when i build the project i get the errors:

#10010 errors encountered during linking; "SD6_comp.out" not built  
#10234-D  unresolved symbols remain
unresolved symbol CacheEnable, first referenced in ./main.obj 

I think this is caussed by  incorret linker settings. What Path/File/lib/... do I have to add to the "ARM Linker -> File Search Path" to use the cache API?

I now added the cache.h, cache.c, and cp15.h, cp15.asm manually to the workspace and then the build process worked. But when I run the project, the  "CacheEnable(CACHE_ALL);" functions hangs in some loops of the assembler file.

What steps have to be done to manually enable the caches of the AM3359?

(sdk v1.0.0.8)

Regards,
Tim

PS: is there a documentation on what lib has to be used for an API module? I already had such problems several times before...

  • Hi Tim,

    Tim Kraus said:
    #10010 errors encountered during linking; "SD6_comp.out" not built  
    #10234-D  unresolved symbols remain
    unresolved symbol CacheEnable, first referenced in ./main.obj 
    This is definitely a link issue. You're missing the library containing the cache code.

    Tim Kraus said:
    I now added the cache.h, cache.c, and cp15.h, cp15.asm manually to the workspace and then the build process worked. But when I run the project, the  "CacheEnable(CACHE_ALL);" functions hangs in some loops of the assembler file.
    I don't think forcing StarterWare code into a SYS/BIOS project is going to accomplish what you want. I don't believe the two play nice with one another (or at least I have never seen it done graciously). SYS/BIOS already supports DCACHE so you can enable it via the BIOS kernel. Check out Chapter 6.6 in the SYS/BIOS User's Guide.

  • Hey Tim,

    thanks for your answer!
    As I wrote in my  post I am NOT using SYS/BIOS, because I'm trying to evaluate the performance of the HW architecture itself, without any Software being excecuted beside my benchmarking routines.

    The problem is that the starterware APIs don't work at all. In a new, blank CCS Project the routines for cache-enabling in the files a wrote before (cache.h/.c, cp15.h/.asm) result in hanging up the controller.
    The same happens when I'm using the API "MMUConfigAndEnable(void)" from "sdk\starterware\examples\evmAM335x\cache_mmuuart\Edma_Cache.c"

    TimHarron said:
    SYS/BIOS already supports DCACHE so you can enable it via the BIOS kernel. Check out Chapter 6.6 in the SYS/BIOS User's Guide.

    I'll give that a try.
  • Tim,

    Sorry about that - I read your post several times and kept focusing in on the word SYS/BIOS while blatantly skipping past the key qualifier without. With that embarrassment out of the way...

    In the disassembly can you see any symbols suggesting where the code is? Is it still within one of the cache functions, or does it appear to be off in the weeds? Sometimes when the processor catches an error it will branch to an error routine which is a glorified while(1) loop. As a for-instance this can happen when accessing memory blocked off by the MMU.

    I build the cache_mmu example in StarterWare v2.00.00.07 and ran it on my StarterKit just fine. I'm not sure what you are missing in building up your project, but are you still unable to build the example application and successfully run?

  • Hello Tim,

    Its probably better if i give some context on what im doing. I created a new CCS Project (not using a Starterware example projectfile) to do the following three steps and not more:
    1. Initialize the Device: Enabling Cache and MMU
    2. Run Benchmark Routines
    3. while(1){}

    For 1.:
    - I copied the function "void MMUConfigAndEnable(void)" with necessary defines from sdk\starterware\examples\evmAM335x\cache_mmu\uartEdma_Cache.c into my projects main file.

    - I copied the following files into my project folder:
         * "mmu.c"(sdk\starterware\system_config\armv7a)
         * "mmu.h" (sdk\starterware\include\armv7a)
         *
    "cache.h" (sdk\starterware\include\armv7a)
         * "cache.c" (sdk\starterware\system_config\armv7a)
         * "cp15.h" (sdk\starterware\include\armv7a)
         *
    "cp15.asm" (sdk\starterware\system_config\armv7a\cgt)

    -  Building the project works without errors

    At the beginning of main() I excecute the Memory Management initialization. I debugged through the function calls:
    main()->MMUConfigAndEnable() -> MMUInit((unsigned int*)pageTable) -> CP15TlbInvalidate();

    When I step into "CP15TlbInvalidate()" the device keeps running and does not stop in that routine (can be found in cp15.asm)

    TimHarron said:
    In the disassembly can you see any symbols suggesting where the code is?

    After holding the debugger manually the Device hangs at 0x00020080. This behaviour ist 100% reproducible.

    Do you know what I'm doing wrong?
    Maybe you could give me an advice how to initialize the MMU() correctly in Project without SYS/BIOS?

    Could there be anything wrong with including the .asm file? I get the same behavior when I'm debugging into main() -> CacheEnable(0x3) -> CP15ICacheFlush();

    Best Regards,
    Tim

  • Hi Tim, I am having a same problem. How did you resolve this problem?