Project

General

Profile

shared memory in the DSP Helloworld example

Added by Vinod Ganesh over 11 years ago

hi,

Where does the memory allocated by GetBuffer() reside? Is it in the external RAM or OMAP's internal memory? For my application I just want to make sure that the memory allocated is from the external RAM.
I tried displaying the address by adding the following line in the arm side, where apBuffer is the pointer to the shared memory, if what i understand is right.
printf("shared mem arm-dsp %p\n",apBuffer);

The code execution gave me the following output

root@mityomapl138:~/drivers# ./helloarm hellodsp.out
Loading file hellodsp.out
PROC Load successful
Starting application.
ARM received a message from the DSP:
shared mem arm-dsp 0x40c77014
DSP Message = "DSP Initialization finished."
Waiting for DSP response (type 'q' to quit)...
q
Exiting application.

This location(0x40c77014) doesnot correspond to the external ram or the omap internal memory. Please help me understand this.

thanks,
Vinod


Replies (2)

RE: shared memory in the DSP Helloworld example - Added by Michael Williamson over 11 years ago

Hello Vinod,

The memory allocated is in the OMAP external DDR2 memory, and is actually in the DSPLINK POOL segment in the DSPBIOS/DSPLINK memory map. When you print out a pointer address in a linux user space allocation, you are printing out the virtual memory address, not the physical address. This is how the linux operating system works. It uses virtual memory management and translates pages to physical addresses using the MMU.

If you want to see the physical address, then you could print the address out on the DSP (which does not use the MMU, and all addresses are physical), or you will need to convert the virtual address to physical. This is normally not possible in user space, you would need to do that in the kernel.

If you google "linux virtual memory" there are several articles that explain virtual memory concepts for linux.

-Mike

RE: shared memory in the DSP Helloworld example - Added by Vinod Ganesh over 11 years ago

Thanks mike. That cleared my doubts.

    (1-2/2)
    Go to top
    Add picture from clipboard (Maximum size: 1 GB)