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.

Problems loading simple DSP program using procmgrapp



I have a trivial DSP program :-

int main( int argc, char* argv[] )

{

    volatile int *ptr = (int*) SHARED_MEM ;

    int value = 0 ;

    for(;;){

        if( value != *ptr ){

            value = *ptr ;

            value *= 2 ;

            *ptr = value ;

        }

    }

    return 0 ;

}

I want to load this onto the DSP core of a C6A816x from the ARM9 core.

I used the following compile options :-

cl6x --abi=eabi  -k dspboot.c -z -i  ../ti-ezsdk_dm816x-evm_5_01_01_80/cgt6x_7_2_2/lib/ --dynamic=exe --retain_Ipc_ResetVector -m DspBoot.map -o DspBoot.exe

I copy the resultant file, DspBoot.exe to the ARM9 Linux filesystem, I load the syslink module and attempt to run the DSP program using:

./procmgrapp_debug 0 /home/root/dm816x-evm/syslink/DspBoot.exe 0

I get the following output:
ProcMgrApp sample application
Entered SysLinkSamples_startup
SysLinkSamples_setHiddenProcId. ProcID: 1
SysLinkSamples_setHiddenProcId. ProcID: 2
SysLinkSamples_osStartup
Entered ProcMgrApp_startup
ProcMgr_attach status: [0x0]
After attach: ProcMgr_getState
    state [0x1]
ProcMgr_load status: [0x3046000]
Error in Ipc_control Ipc_CONTROLCMD_LOADCALLBACK [0xffffffff]
ProcMgr_close status: [0x97d2000]
Leaving ProcMgrApp_startup
SysLinkSamples_shutdown
SysLinkSamples_osShutdown
Loading syslink with tracing enabled I can see the following error:
...... Lots of calls to ElfLoaderMem_Alloc Meory_alloc  MemoryOS_alloc ..  and then
Entered ElfLoaderMem_alloc
        clientHandle    [0x0]
        size    [0x4]
Leaving ElfLoaderMem_alloc
Entered Memory_alloc
        heap    [0x0]
        size    [0x4]
        align   [0x0]
        eb      [0x0]
Entered MemoryOS_alloc
        size    [0x4]
        align   [0x0]
        flags   [0x0]
Leaving MemoryOS_alloc
        ptr     [0xd5332000]
Leaving Memory_alloc
        buffer  [0xd5332000]
Entered ElfLoaderMem_alloc
        clientHandle    [0x0]
        size    [0x0]
Assertion at Line no: 339 in /home/gnewton/ti-ezsdk_dm816x-evm_5_01_01_80/syslink_02_00_00_68_beta1/ti/syslink/utils/hlos/knl/Linux/../../d
Leaving ElfLoaderMem_alloc
Entered Memory_alloc
        heap    [0x0]
        size    [0x0]
        align   [0x0]
        eb      [0x0]
Assertion at Line no: 127 in /home/gnewton/ti-ezsdk_dm816x-evm_5_01_01_80/syslink_02_00_00_68_beta1/ti/syslink/utils/hlos/knl/Linux/../../d
Entered MemoryOS_alloc
        size    [0x0]
        align   [0x0]
        flags   [0x0]
Assertion at Line no: 261 in /home/gnewton/ti-ezsdk_dm816x-evm_5_01_01_80/syslink_02_00_00_68_beta1/ti/syslink/utils/hlos/knl/Linux/../../d
*** MemoryOS_alloc: Could not allocate memory
        Error [0x897d2001] at Line no: 302 in file /home/gnewton/ti-ezsdk_dm816x-evm_5_01_01_80/syslink_02_00_00_68_beta1/ti/syslink/utilsc
Leaving MemoryOS_alloc
        ptr     [0x0]
*** Memory_alloc: Failed to allocate memory!
        Error [0x8c97e001] at Line no: 139 in file /home/gnewton/ti-ezsdk_dm816x-evm_5_01_01_80/syslink_02_00_00_68_beta1/ti/syslink/utilsc
Leaving Memory_alloc
        buffer  [0x0]
Entered ElfLoaderMem_alloc
        clientHandle    [0x0]
        size    [0x95]
Leaving ElfLoaderMem_alloc
For some reason the Elf Loader has tried to allocate a 0 sized memory area.  What I also don't understand is why so many allocations for such a trivial program.
Is this the correct way to load a DSP program from the ARM9?
 

  • Graham Newton said:
    ProcMgr_load status: [0x3046000]
    Error in Ipc_control Ipc_CONTROLCMD_LOADCALLBACK [0xffffffff]

    The above failure from Ipc is because there is no Ipc_start() in the DSP program.  ProcMgrApp issues this call to Ipc_control(Ipc_CONTROLCMD_LOADCALLBACK), and that function eventually ends up calling Ipc_start() on the ARM, which won't succeed unless there is a corresponding Ipc_start() on the DSP for a sync-up.

    ProcMgrApp.c is a sample application, designed to work with a DSP program that performs Ipc operations.  You can create your own app loader based on ProcMgrApp.c and other samples, and in that you don't have to call Ipc_control() if there is no corresponding Ipc_start() in the DSP program.  You can just do ProcMgr_load() followed by ProcMgr_start().

    Graham Newton said:
    For some reason the Elf Loader has tried to allocate a 0 sized memory area.  What I also don't understand is why so many allocations for such a trivial program.

    Perhaps all those Elf errors are a result of the Ipc_control failure, not sure.

    But to answer your question, ELF is a section-heavy format, and probably each section that gets loaded needs an allocation.  Even the simplest of programs has *lots* of sections associated with it.

    Regards,

    - Rob