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.
Hello,
We are developing an application that requires high ARM-->DSP data transportation (up to few MB/Sec), on a DM3730, on a WIN CE 6.0 OS.
The Dsp--> arm data is negligible (it's the result of many calculations), and so are some control messages which need to be exchanged between the processors, mainly to sync and handle the data transfers.
From what I understand, all the omap3530 dsplink configurations are supposed to be 100% valid for the DM3730, so we work according to omap3530 code&documents.
We have successfully operated the message example just to get started,
Then thought of using channels to transfer our data, as in the loop example, but came across a 0x4000 byte size limit during chnl_allocation which did not seem easy to solve.
On the other hand we were not sure for such high data rates the shared memory approach (using proc_read / proc_write) isn't better, so we thought of trying the read/write example to get a feel of how it works.
However, I am unable successfully operate this example.
Here are the steps that I have taken:
1.
reserved DSP space in my WIN CE memory configuration file image_cfg.h :
//------------------------------------------------------------------------------
//
// Define: IMAGE_SHARE_ARGS
//
// Following constants define location and maximal size of arguments shared
// between loader and kernel. For actual structure see args.h file.
//
#define IMAGE_SHARE_ARGS_CA 0x80000000
#define IMAGE_SHARE_ARGS_SIZE 0x00001000
//------------------------------------------------------------------------------
//
// Define: CPU_INFO_ADDR
//
// Following constants define location and maximal size of arguments shared
// between loader and kernel. For actual structure see args.h file.
//
#define CPU_INFO_ADDR_PA 0x80001000
#define CPU_INFO_ADDR_CA 0x80001000
#define CPU_INFO_ADDR_SIZE 0x00001000
//------------------------------------------------------------------------------
//
// Define: IMAGE_WINCE_CODE
//
// Following constants define Windows CE OS image layout.
//
#define IMAGE_WINCE_CODE_CA 0x80002000 //
#define IMAGE_WINCE_CODE_SIZE 0x02800000 // CODE 40 MB
#define IMAGE_WINCE_RAM_CA 0x82802000 //
#define IMAGE_WINCE_RAM_SIZE 0x01FFE000 // RAM 32 MB
#define IMAGE_WINCE_DISPLAY_CA 0x84800000 //
#define IMAGE_WINCE_DISPLAY_SIZE 0x01000000 // VIDEO 16 MB
#define IMAGE_CMEM_DSP_CA 0x85800000 //
#define IMAGE_CMEM_DSP_SIZE 0x02800000 // DSP 40 MB
#define IMAGE_WINCE_RAM_BANK1_CA 0x88000000 //
#define IMAGE_WINCE_RAM_BANK1_SIZE 0x08000000 // RAM (2nd BANK) 128 MB
#define IMAGE_WINCE_NOR_OFFSET 0x00060000
#define NAND_ROMOFFSET 0x40000000
#define NOR_ROMOFFSET 0x60000000
2. added two 1MB memory areas to cfg_omap3530_shmem.c:
{
10, /* ENTRY : Entry number */
"WRITEMEM", /* NAME : Name of the memory region */
0x86000000, /* ADDRPHYS : Physical address */
0x86000000, /* ADDRDSPVIRT : DSP virtual address */
(Uint32) -1, /* ADDRGPPVIRT : GPP virtual address (if known) */
0x0100000, /* SIZE : Size of the memory region */
FALSE, /* SHARED : Shared access memory? */
FALSE /* SYNCD : Synchornized? */
},
{
11, /* ENTRY : Entry number */
"READMEM", /* NAME : Name of the memory region */
0x86100000, /* ADDRPHYS : Physical address */
0x86100000, /* ADDRDSPVIRT : DSP virtual address */
(Uint32) -1, /* ADDRGPPVIRT : GPP virtual address (if known) */
0x00100000, /* SIZE : Size of the memory region */
FALSE, /* SHARED : Shared access memory? */
FALSE /* SYNCD : Synchornized? */
}
} ;
3. added those two dsplink-omap3530-base.tci accodingly:
/* ============================================================================
* MEM : WRITEMEM
* ============================================================================
*/
var WRITEMEM= prog.module("MEM").create("WRITEMEM");
WRITEMEM.base = 0x86000000;
WRITEMEM.len = 0x100000;
WRITEMEM.createHeap = false;
WRITEMEM.comment = "WRITEMEM";
/* ============================================================================
* MEM : READMEM
* ============================================================================
*/
var READMEM= prog.module("MEM").create("READMEM");
READMEM.base = 0x86100000;
READMEM.len = 0x100000;
READMEM.createHeap = false;
READMEM.comment = "READMEM";
Here is my command line argument (dsprw.exe is the same as readwrite.exe):
dsprw.exe \release\readwrite.out 2248146944 1048576 1
The code fails during proc write, and receives a data abort.
This is the specific function inside proc_write that fails:
status = DRV_INVOKE (DRV_handle, CMD_PROC_WRITE, &args) ;
if (DSP_FAILED (status)) {
SET_FAILURE_REASON ;
here is a trace of the failure area:
468783 PID:7b40002 TID:7b50002 Leaving _SYNC_USR_enterCS () status [0x8000]
468783 PID:7b40002 TID:7b50002 Entered DRV_Invoke ()
drvObj [0x1a020340]
cmdId [0x6f01]
arg1 [0x1a01f9a0]
arg2 [0x0]
468785 PID:7b40002 TID:7b50002 Status: 8000
468785 PID:7b40002 TID:7b50002 DRV_Invoke: cmd 0x6F01, DSPStatus 0x8000
468785 PID:7b40002 TID:7b50002 Leaving DRV_Invoke DSPStatus 0x8000 () status [0x1a01ff00]
468786 PID:7b40002 TID:7b50002 Entered _SYNC_USR_leaveCS ()
csObj [0x1a020400]
468786 PID:7b40002 TID:7b50002 Leaving _SYNC_USR_leaveCS () status [0x8000]
468786 PID:7b40002 TID:7b50002 Leaving MSGQ_transportOpen () status [0x8000]
468786 PID:7b40002 TID:7b50002 Entered MSGQ_locate ()
queueName [0x260c0]
msgqQueue [0x260e4]
attrs [0x1a01fa04]
468786 PID:7b40002 TID:7b50002 Entered DRV_Invoke ()
drvObj [0x1a020340]
cmdId [0x6f05]
arg1 [0x1a01f9bc]
arg2 [0x0]
468787 PID:7b40002 TID:7b50002 Status: 8000
468787 PID:7b40002 TID:7b50002 DRV_Invoke: cmd 0x6F05, DSPStatus 0x8000
468787 PID:7b40002 TID:7b50002 Leaving DRV_Invoke DSPStatus 0x8000 () status [0x1a01ff00]
468787 PID:7b40002 TID:7b50002 Leaving MSGQ_locate () status [0x8000]
468787 PID:7b40002 TID:7b50002 Leaving RDWR_Create ()
497490 PID:7b40002 TID:7b50002 Entered RDWR_Execute ()
497493 PID:400002 TID:f60002 OMAPDDGPE::DrvEscape: IOCTL_POWER_SET
497494 PID:400002 TID:f60002 OMAPDDGPE::DrvEscape: IOCTL_POWER_SET = to D2
501632 PID:7b40002 TID:7b50002 Entered PROC_write ()
procId [0x0]
dspAddr [0x86100000]
numBytes [0x100000]
buffer [0x1a170000]
510110 PID:7b40002 TID:7b50002 Entered DRV_Invoke ()
drvObj [0x1a020340]
cmdId [0x6c0c]
arg1 [0x1a01f994]
arg2 [0x0]
510111 PID:400002 TID:7b50002 Exception 'Data Abort' (4): Thread-Id=07b50002(pth=8b1f5564), Proc-Id=00400002(pprc=8299eaa0) 'NK.EXE', VM-active=07b40002(pprc=8b77b690) 'dsprw.exe'
510111 PID:400002 TID:7b50002 PC=c0176bac(k.coredll.dll+0x000b6bac) RA=c1257e48(dsplinkk.dll+0x00007e48) SP=d69efc38, BVA=ffffffff
I'd like to know if some one could answer the following questions:
1. What am I doing wrong in the read write example?
2. What method is preferable in general for our needs?
3. why cant you allocate more than 16MB for channel?
I'd really appreciate some help here.
Best Regards,
Elad
Are the CMEM managed buffers overlapping your READMEM/WRITEMEM buffers?
Chris
Hi Chris,
I don't believe I'm using any cmem buffers.. cmemk.dll isn't loaded in the system. how do I find out for sure where (&if) are these buffers defined and used?
Anyhow, perhaps this will aid in understanding the problem:
My workaround (followed by another poster here who bumped into the same problem) was to substantially increase the DDR2 section in GPP & DSP (see below). and to just give an address pointing to somewhere inside that enhanced DDR2 area. This works! so it leads me to conclude it's *not* something wrong with the address (as your inquiry may suggest) because then my workaround (using the same address I wanted to use with my new mem areas) wouldn't work either (for example if the CMEM buffs were overlapping).
DDR2 has an attribute of "space" where it says "code/data". In all your examples the new MEM areas don't include this attribute, perhaps it's required?
Thanks,
Elad
/* ============================================================================
* MEM : Adjust DDR2
* ============================================================================
*/
var DDR2 = prog.module("MEM").instance("DDR2");
DDR2.base = RESET_VECTOR.base + RESET_VECTOR.len ;
DDR2.len = 0x26FFF80;
DDR2.space = "code/data";
DDR2.createHeap = true;
DDR2.heapSize = 0x10000;
DDR2.comment = "DDR2";
- I am not sure if it is going to help (as I am not familiar with WincE) but the following E2E posts provide information on where the CMEM memory is reserved and memory map is setup:
http://e2e.ti.com/support/embedded/f/353/p/52071/184143.aspx#184143
http://e2e.ti.com/support/embedded/f/353/p/83428/287405.aspx#287405
If CMEM is really not used then you could try to remove it from the memory map.
- On the other side CMEM is used to create buffers that are contiguous in memory. Double check if in your case it is something (or not) that will be used as it might be useful if the same buffers is access by multiple requestors (like ARM CPU, EDMA, ...etc).
Anthony
There are as well some FAQ like:
"What is the NK.bin image memory layout? How to calculate the total allocated memory size in System->memory tab?"
"how to reserve a memory region?"
that can help on the porcesor Twiki. See the WINCE FAQ and WINCE BSP FAQ at:
http://processors.wiki.ti.com/index.php/Category:WinCE