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.

[OMAP-L137] linking in CMEM library in DSPLINK based app.

Other Parts Discussed in Thread: OMAP-L137

Hello,

I am attempting to integrate the use of CMEM to share a large data block between my DSP signal processing application and my GPP application on an OMAP-L137 project. This project is based on the message sample program from DSPLINK. I have been able to successfully build and install the cmemk.ko driver on my eval board. I need to understand how to include the appropriate cmem interface archive/library in my GPP side application or change the associated makefile for the project to allow it to link the cmem library into the project so I can actually make calls to the cmem API. Right now I'm stuck with unresolved externals.

 

Thanks

Richard Bagdazian

 

  • Follow up...

    I found the source code to the cmem API routines so I'm just going to use the source code file in my project. The call to CMEM_init returned with success so I think I should be ok.

    -rb

  • Richard,

    If your question is about how to link with the cmem user-space lib using the GCC cross-compiler, you simply include it as one of your sources on the command line. For example:

         arm-none-linux-gnueabi-gcc -o hello_world hello_world.o cmem.a470MV -lpthread

    This will build a program called hello_world using object file hello_world.o and the cmem user-space library. 

    Using the source should work just as well (it's a single source file I think).

    Regards, Daniel

  • Thanks Daniel,

    Can you comment on the -lpthread switch on the command line above? I was getting an error from the make process that said that my cmem.a470MV module was not being included in the build because there was no link being performed. The application did build fine and initially appeared to work correctly just by including the cmem.c and cmem.h files in the build.

    Which lead to another problem.

    I am using the linuxutils_2_25 version and the cmemk.ko driver appears to be running correctly, and in my GPP application on an OMAP-L137 the CMEM_init and related calls seem to be working correctly. I am allocating a memory space of size 0x100000 as one large pool for passing some raw data from my DSP processing to the GPP side for use later on in the cmem initializaton. My problem arises in that as I attempt to fill my cmem buffer with raw data on the dsp side, somewhere after writing to 0x2000 to 0x2800 elements from the start of my cmem buffer, the application crashes. If I ensure that my dsp application doesn't write beyond 0x2000 elements into my memory space it works fine, even though I have allocated a much larger space to the cmemk.ko driver. Here is what my cmemk installation line looks like:

    insmod cmemk.ko pools=1x1048576 phys_start=0xc2000000 phys_end=0xc2100000

    From my dsp memory map, that region of memory is unused and my linux kernel is restricted to 32Mbyte.

    Is there something else required for me to directly access this memory on the DSP side as relates to cache control, etc?

    Your help is greatly appreciated,

    Richard

     

     

     

     

  • The problem I was having above was a programming bug on my side due to a bad pointer setup cmem transfer is working fine now.

     

    -Richard