hello, everyone,
my development platform is Devkit8500 (DM3700), and I use the xdctools to develop my code,
it by dvsdk_dm3730-evm_4_02_00_06_setuplinux and use dvsdk's Codec Engine GenCodecPkg Wizard,
According to this developers guide,
http://processors.wiki.ti.com/index.php/Codec_Engine_Application_Developers_Guide
and at "Reconfiguring the Server's Algorithm Heap"
I following this step, to write my code at ARM, but not successful,
/**********************************************************/
Engine_Handle hEngine; Server_Handle hServer; XDAS_Int8 *buf; Uint32 physAddr; /* * Open the Engine and get Server handle. Note, the * Engine_open() call will load and start the DSP. */ hEngine = Engine_open("audio_copy", NULL, NULL); hServer = Engine_getServer(hEngine); /* Allocate a large block of physically contiguous memory for our "alg heap" */ buf = (XDAS_Int8 *)Memory_contigAlloc(BUFSIZE, ALIGNMENT); /* Convert virtual address to physical address. */ physAddr = Memory_getBufferPhysicalAddress(buf, BUFSIZE, NULL); /* Reconfigure the algorithm heap */ Server_redefineHeap(hServer, "DDRALGHEAP", physAddr, BUFSIZE); /* ...Create, run and delete codecs... */ /* Reconfigure alg heap back to its original state. */ Server_restoreHeap(hServer, "DDRALGHEAP"); /* Free the "alg heap" buffer */ Memory_contigFree(buf, BUFSIZE);
/**********************************************************/
My code is as follows:
At ARM code:
At DSP code:
My idea is that, in the ARM side, first with fopen to read a txt file (this is an image buffer) and then name number_array matrix, then get number_array's physical location, and location to the DSP, and let DSP to do arithmetic.
So, I use Memory_contigAlloc to creat a space for buf, and use memcpy copy the number_array value to buf,
and use Memory_getBufferPhysicalAddress to get physical address to DSP, but not successful,
I have three questions:
1. how I can send Physical Address from the ARM to DSP , and DSP can receive the image buffer address, and do something
2. if DSP receive the Physical Address, how to use the physical address to get the image buffer
3. and where my code was wrong?
Thank you, I rellay need help, it confuse me a long time, please help me