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.

cache flush fucntions for C6747??

Other Parts Discussed in Thread: OMAP-L138, OMAPL138

All

 Can you send me the function to flush the cache? I know we dont have CSL any more but wondering if anybody has the function to flush the cache. I know if you use Bios there are certain instrucations to flush the cache but my customer is not using BIOS.

Thanks

Regards

Mohsen

  • Mohsen,

    I have not used it but the CSLr does include support for the cache module. As an example, you could write something like the below to writeback and invalidate L2:

    CSL_CacheRegsOvly CacheRegs = (CSL_CacheRegsOvly)CSL_CACHE_0_REGS;

    // ...

    CSL_FINST(Cache_Regs->L2WBINV, CACHE_L2WBINV_CMDANDSTAT, WBINV);
    while(Cache_Regs->L2WIWC != 0); // Wait for operation to complete

    To reiterate I haven't tested this, but I think this would effectively accomplish the same thing the old functional CSL.

  • I am using CCS4.0 with OMAP-L138, I need a function to flush the cache in the DSP for a specified address with specified number of words/bytes. Like the CACHE_flush function in CCS2. Can anyone give me a pointer to it.

    Thanks,

    Jian

  • Jian,

    We have an early-adopter release of a software package called Starterware that is available for OMAP-L138 and C6748 devices, including cache support APIs.  The offiical release will be in late October. Note that changes will happen to the package between the two releases, so if that's a concern you may choose to wait for the official release for broader usage beyond the cache apis.

    Please send an email to c6swlib_dev@list.ti.com and we can provide access to the prelim release.

    Regards
    Kyle

     

  • Hi Kyle,

    I am looking for a function name and parameters to call to flush the cache in the DSP (OMAP-L138), preferably not to invalidate the cache. I need the syntax to do it and able to compile the codes. Would you please provide me with the info? I have no plan to use any new software package. I just want to use the current one.

    Jian

  • Jian,

    The StarterWare code can be used for this purpose.  You don't need to use any of the other functionality.  Even if you don't want to use the package the source code is provided and you could copy that code into your own source.

    It provides the following function to flush (aka writeback) the cache without performing an invalidation:

    extern void CacheWB (unsigned int baseAddr, unsigned int byteSize);

    I have sent the download info to Kevin and Chris who I understand have been supporting you ... They should send it to you soon.

    Does this suit your needs?

    Regards
    Kyle

  • Hi Kyle,

    Thanks for the package. I got it from Kevin now. I am having problem of compiling it. Is it possible for you or someone to build a library out of it so I can just simply include the lib into my compiling script to do it? I am compiling the DSP codes using "wine" in a linux server. Please let me know if it is possible.

    Thanks,

    Jian

  • Jian,

    The precompiled libs are available in the lib\c674\ directory.

    The cache related stuff is in the system.lib file.

    Regards
    Kyle

  • Hi Kyle,

    I am having trouble of linking the cache functions. I found my current linker uses rts6740.lib. I added the path and the system.lib to the linker command as followed:

    wine --debugmsg -all -- Z:/swdev/tools/ti_dsp/c6000_6_1_12/bin/cl6x.exe  -mv6740 -g --rtti --diag_warning=225 --call_assumptions=0 -z -m=mojoDspAppPre.map --warn_sections -x --rom_model --reread_libs -l.externSymbols  -i=/swdev/tools/ti_dsp/c6000_6_1_12/lib -i=/nixhome/jho/p4/mojo/OTM/OMAPL138_StarterWare_1_10_00_00/lib/c674/ -o mojoDspApp.out -l*.cmd *.obj *.o -lrts6740.lib -lsystem.lib

    However, I still cannot use the functions. Do you know anything about how to make it work? I am sorry to brother you with this problem.

    Thanks,

    Jian

  • Jian,

    What is the specific error being reported?  Do you point to the relevant include files when you compile the source code that references those functions?

    For reference, please look at the file:

    makedefs

    Also, look at the following example:

    examples\evmOMAPL138\game

    This will show how your source can take advantage of the cache apis (e.g., in game_example.c), as well as how to build the overall application (makefile in examples\evmOMAPL138\game\build\c674\cgt)


    Hope this helps.

    Regards

    Kyle

  • Hi Kyle,

    Here is the error message:

    wine --debugmsg -all -- Z:/swdev/tools/ti_dsp/c6000_6_1_12/bin/cl6x.exe  -mv6740 -g --rtti --diag_warning=225 --call_assumptions=0 -z -m=mojoDspAppPre.map --warn_sections -x --rom_model --reread_libs -l.externSymbols  -i=/swdev/tools/ti_dsp/c6000_6_1_12/lib -i=/nixhome/jho/p4/mojo/OTM/OMAPL138_StarterWare_1_10_00_00/lib/c674/ -o mojoDspApp.out -l*.cmd *.obj *.o -lrts6740.lib -lsystem.lib
    <Linking>
    warning: creating output section ".heap" without a SECTIONS specification

     undefined first referenced
      symbol       in file    
     --------- ----------------
     _CacheWB  rxCtrlLoop.o   

    error: unresolved symbols remain
    error: errors encountered during linking; "mojoDspApp.out" not built

    >> Compilation failure
    make: *** [makelinkDspPre] Error 1
    Link Failed - mojoDspAppout at /nixhome/jho/p4/mojo/OTM/build/buildImage.pl line 656.

    The example you gave me compile the whole StarterWare. It is not an example of using the system.lib. I am having trouble of compiling the whole thing. That is why I tried to use the system.lib instead. Do you have know why the extern "C" change the function name to _CacheWB? I think this may be the problem since the name is different from CacheWB. Any idea?

    Many thanks,

    Jian

  • Hi Kyle,

    Here is the error message:

    wine --debugmsg -all -- Z:/swdev/tools/ti_dsp/c6000_6_1_12/bin/cl6x.exe  -mv6740 -g --rtti --diag_warning=225 --call_assumptions=0 -z -m=mojoDspAppPre.map --warn_sections -x --rom_model --reread_libs -l.externSymbols  -i=/swdev/tools/ti_dsp/c6000_6_1_12/lib -i=/nixhome/jho/p4/mojo/OTM/OMAPL138_StarterWare_1_10_00_00/lib/c674/ -o mojoDspApp.out -l*.cmd *.obj *.o -lrts6740.lib -lsystem.lib
    <Linking>
    warning: creating output section ".heap" without a SECTIONS specification

     undefined first referenced
      symbol       in file    
     --------- ----------------
     _CacheWB  rxCtrlLoop.o   

    error: unresolved symbols remain
    error: errors encountered during linking; "mojoDspApp.out" not built

    >> Compilation failure
    make: *** [makelinkDspPre] Error 1
    Link Failed - mojoDspAppout at /nixhome/jho/p4/mojo/OTM/build/buildImage.pl line 656.

    The example you gave me compile the whole StarterWare. It is not an example of using the system.lib. I am having trouble of compiling the whole thing. That is why I tried to use the system.lib instead. Do you have know why the extern "C" change the function name to _CacheWB? I think this may be the problem since the name is different from CacheWB. Any idea?

    Many thanks,

    Jian

  • Jian,

    The error message is a little unclear, but I believe the core problem here is that the StarterWare library files and your application *.o files are mismatched.  The StarterWare libraries are all built as ELF binaries (i.e. EABI), while your application appears to build as COFF.  You can fix this in one of two ways:

    1. Rebuild the StarterWare libraries as COFF (change "--abi=eabi" to "--abi=coff" in makefiles/CCS projects and rebuild)
    2. Build your application as ELF (add "--abi=eabi" to your compiler options)

    I recommend the second option since it should be considerably less work, but you will probably need to upgrade to a more recent version of the C6000 compiler.  You can download the newer compiler from the following web page:

    You will need a 7.x release to build DSP applications as ELF.  Please give this a try and let me know if you run into any more problems.

  • Hi Joe,

    It is a bit risky for me to change the compiler since the product is already out of the door and people are afraid of making big change. Since all I want is the CacheWB function, can you identify the minimum directories that I need to compile to get this function from the StarterWare? If you identify these directories for me, I can build them as applications.

    Many thanks,

    Jian

  • Hi Joe,

    Is it possible for you to have someone in TI to provide me with a system.lib which is compiled as COFF? This is an easier way for me to get it done. But it will take you more some time. Sorry for this extra request.

    Thanks,

    Jian

  • Jian,


    IMO the best way to proceed is to attempt to

    a) compile the cache.c and related files directly within your project, or

    b) copy the cacheWB related functions and header definitions directly within your project code

    From a quick glance, at minimum you'll need the interrupt.c related code in either of above approaches.

    Regards
    Kyle

     

  • Jian,

    I rebuilt the system config library as COFF binaries.  Please find the attached files.  If you want to repeat this on your own PC, all you need to do is change the "--abi=eabi" option to "--abi=coffabi" (not just coff; that was an error in my previous post).  For makefile build, this means editing the makedefs file where CFLAGS is originally defined.  For a CCS project, you should be able to change the binary format in the project properties.

    Regardless, the attached libraries should work with your COFF application.

    starterware_system_c674x_coff.zip
  • Hi Joe and Kyle,

    I managed to get this compile and it is working now. Many thanks to both of you for all of your help.

    Jian