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.

syslink: ProcMgr_load failure

Other Parts Discussed in Thread: OMAPL138

Hello,

I am working with OMAP L138 and trying to upload a simple DSP program by calling ProcMgr_load. I create the DSP side using CCS projects. The project contains just an empty main function. When I map it to use the shared memory (i.e. 0x80000000) the program is loaded fine. But if I add SYS/Bios to the DSP project and use ti.platforms.evmOMAPL138 platform then I get memory mapping errors. For example:

WARNING: at arch/arm/mm/ioremap.c:207 __arm_ioremap_pfn_caller+0x15c/0x16c()
Modules linked in: syslink
[<c000d364>] (unwind_backtrace+0x0/0xf0) from [<c001b87c>] (warn_slowpath_common+0x4c/0x64)
[<c001b87c>] (warn_slowpath_common+0x4c/0x64) from [<c001b8b0>] (warn_slowpath_null+0x1c/0x24)
[<c001b8b0>] (warn_slowpath_null+0x1c/0x24) from [<c000f320>] (__arm_ioremap_pfn_caller+0x15c/0x16c)
[<c000f320>] (__arm_ioremap_pfn_caller+0x15c/0x16c) from [<c000f3a0>] (__arm_ioremap_caller+0x58/0x60)
[<c000f3a0>] (__arm_ioremap_caller+0x58/0x60) from [<bf025a0c>] (MemoryOS_map+0x148/0x3e0 [syslink])
[<bf025a0c>] (MemoryOS_map+0x148/0x3e0 [syslink]) from [<bf006d80>] (_ProcMgr_map+0x3c0/0x57c [syslink])
[<bf006d80>] (_ProcMgr_map+0x3c0/0x57c [syslink]) from [<bf010298>] (CoffLoaderTrgWrite_copy+0xc8/0x3bc [syslink])
[<bf010298>] (CoffLoaderTrgWrite_copy+0xc8/0x3bc [syslink]) from [<bf00b6b4>] (Coff_load+0xa80/0x1f70 [syslink])
[<bf00b6b4>] (Coff_load+0xa80/0x1f70 [syslink]) from [<bf00f5b4>] (CoffLoader_load+0x14c/0x3c0 [syslink])
[<bf00f5b4>] (CoffLoader_load+0x14c/0x3c0 [syslink]) from [<bf0025a4>] (Loader_load+0x98/0x174 [syslink])
[<bf0025a4>] (Loader_load+0x98/0x174 [syslink]) from [<bf004c6c>] (ProcMgr_load+0x104/0x358 [syslink])
[<bf004c6c>] (ProcMgr_load+0x104/0x358 [syslink]) from [<bf009ab0>] (ProcMgrDrv_ioctl+0xd40/0x1bd4 [syslink])
[<bf009ab0>] (ProcMgrDrv_ioctl+0xd40/0x1bd4 [syslink]) from [<c009200c>] (do_vfs_ioctl+0x7c/0x598)
[<c009200c>] (do_vfs_ioctl+0x7c/0x598) from [<c0092560>] (sys_ioctl+0x38/0x60)
[<c0092560>] (sys_ioctl+0x38/0x60) from [<c0009320>] (ret_fast_syscall+0x0/0x2c)
---[ end trace 414793cb713960c8 ]---
*** MemoryOS_map: Failed to map to host address space!
Error [0x897d2003] at Line no: 517 in file /home/glebf/ti/syslink_2_21_03_11/packages/ti/syslink/utils/hlos/knl/Linux/../../../../../../ti/syslink/c
*** _ProcMgr_map: Memory_map failed
Error [0xfffffff1] at Line no: 2441 in file /home/glebf/ti/syslink_2_21_03_11/packages/ti/syslink/utils/hlos/knl/Linux/../../../../../../ti/syslinkc
_ProcMgr_map for SlaveVirt:
dstAddr [0xc3011000]
sgList.paddr [0xc3011000]
sgList.offset [0x268]
sgList.size [0x2268]
Coff_load: Reading section [3] from file into host buffer

The DSP SW uses memory starting at 0xC3000000 as shown in the map file:

OUTPUT FILE NAME: <DemoDsp.out>
ENTRY POINT SYMBOL: "_c_int00" address: c3009380


MEMORY CONFIGURATION

name origin length used unused attr fill
---------------------- -------- --------- -------- -------- ---- --------
IROM 11700000 00100000 00000000 00100000 R X
IRAM 11800000 00040000 00000000 00040000 RW X
L3_CBA_RAM 80000000 00020000 00000000 00020000 RW X
DDR c3000000 01000000 00013d26 00fec2da RWIX

My question is: how does the hlos side determines memory mapping and what do I need to do to match the mapping of DSP side?

Regards

Gleb

  • Hi,

    I presume that you are trying to load your own syslink project.

    1) Please refer the TI wiki,

    http://processors.wiki.ti.com/index.php/Creating_CCS_Project_for_SysLink_samples

    2) Take any existing syslink example code and try to modify as per your requirement.

    My question is: how does the hlos side determines memory mapping and what do I need to do to match the mapping of DSP side?

    Memory mappings would be present at the below file (config.bld)

    examples/ex01_helloworld/shared/config.bld

  • Hi Titus,

    Thank you for the reply. I have seen this  advise on similar posts. But I think that my question is more simple. Please let me describe it again in different terms.

    I build a CCS project for OMAP 138 DSP. There is only an empty main function in the project. The defaul OMAPL138.cmd  file places all code and data in shared memory starting at 0x80000000. I call ProcMgr_load to load the DSP executable and it works. For example I get for the first section:

    MemoryOS_map: pa=0x80000800, va=0xd0ee6800, sz=0x420

    _ProcMgr_map for SlaveVirt:
    dstAddr [0x80000000]
    sgList.paddr [0x80000000]
    sgList.offset [0x800]
    sgList.size [0xc20]
    Coff_load: Reading section [2] from file into host buffer

    Next I change the OMAPL138.cmd file to place all code and data in DDR starting at 0xc3000000. Now the ProcMgr_load  fails for the same section:

    *** MemoryOS_map: Failed to map to host address space!
    Error [0x897d2003] at Line no: 517 in file /home/glebf/ti/syslink_2_21_03_11/packages/ti/syslink/utils/hlos/knl/Linux/../../../../../../ti/syc
    *** _ProcMgr_map: Memory_map failed
    Error [0xfffffff1] at Line no: 2441 in file /home/glebf/ti/syslink_2_21_03_11/packages/ti/syslink/utils/hlos/knl/Linux/../../../../../../ti/sc
    _ProcMgr_map for SlaveVirt:
    dstAddr [0xc3000000]
    sgList.paddr [0xc3000000]
    sgList.offset [0x800]
    sgList.size [0xc20]

    So the question is what makes 0x80000000 ok and 0xc3000000 wrong? Is it part of syslink build or kernel build?

    P.S.

    As I understand  the config.bld file is used to define memory mapping of DSP side in the examples. That is what OMAPL138.cmd does in my program. Is this correct?

    Regards

    Gleb

  • Hi,

    P.S.

    As I understand  the config.bld file is used to define memory mapping of DSP side in the examples. That is what OMAPL138.cmd does in my program. Is this correct?

    http://processors.wiki.ti.com/index.php/Config_bld_basics

    So the question is what makes 0x80000000 ok and 0xc3000000 wrong? Is it part of syslink build or kernel build?

    0x80000000 is shared RAM for DSP as well ARM

    0xc3000000 is DDR/mDDR RAM address location

    So, Please make sure that your DDR memory is not conflict with DSP mapping.

  • Hi,

    What do you mean by "make sure that your DDR memory is not conflict with DSP mapping"? The address I load to, i.e. 0xc3000000, is within DDR limits and same address is used in examples. Where else should I check?

     I also tried to use slaveloader to upload DSP with identical results:

    *** MemoryOS_map: Failed to map to host address space!
    Error [0x897d2003] at Line no: 517 in file /home/glebf/ti/syslink_2_21_c
    *** _ProcMgr_map: Memory_map failed
    Error [0xfffffff1] at Line no: 2441 in file /home/glebf/ti/syslink_2_21c
    _ProcMgr_map for SlaveVirt:
    dstAddr [0xc3000000]
    sgList.paddr [0xc3000000]
    sgList.offset [0x800]
    sgList.size [0xc20]

    When I try to upload an example file I get, in addition to the MemoryOS_map error, a kernel crash:

    *** MemoryOS_map: Failed to map to host address space!
    Error [0x897d2003] at Line no: 517 in file /home/glebf/ti/syslink_2_21_c
    *** _ProcMgr_map: Memory_map failed
    Error [0xfffffff1] at Line no: 2441 in file /home/glebf/ti/syslink_2_21c
    _ProcMgr_map for SlaveVirt:
    dstAddr [0xc301c000]
    sgList.paddr [0xc301c000]
    sgList.offset [0x6a0]
    sgList.size [0x6fe8]
    Unable to handle kernel paging request at virtual address ffffffff
    pgd = cfb18000
    [ffffffff] *pgd=cfffe831, *pte=00000000, *ppte=00000000
    Internal error: Oops: 817 [#1] PREEMPT
    Modules linked in: syslink
    CPU: 0 Tainted: G W (3.1.10-gb6b7318-dirty #50)
    PC is at memset+0xb8/0xc0
    LR is at ElfLoaderTrgWrite_copy+0x184/0x450 [syslink]
    pc : [<c0140d78>] lr : [<bf00c204>] psr: 20000013
    sp : cfae5d00 ip : 00000001 fp : d0eb5000
    r10: ffffffff r9 : 0000000b r8 : 06a85000
    r7 : 00006948 r6 : d0e7c000 r5 : bf0eaf60 r4 : cfae5d90
    r3 : 00000003 r2 : 00000000 r1 : 00006944 r0 : ffffffff
    Flags: nzCv IRQs on FIQs on Mode SVC_32 ISA ARM Segment user
    Control: 0005317f Table: cfb18000 DAC: 00000015
    Process slaveloader (pid: 1036, stack limit = 0xcfae4270)

    I am really lost here :(

    Regards

    Gleb

  • Hi,

    Could you please share your u-boot boootargs ?

    If possible, attach your experimental project & steps that you followed to reproduce it into my side.

  • Hi Titus,

    I highly appreciate your help.

    My u-boot boootargs are (using nfs):

    U-Boot > printe
    baudrate=115200
    bootargs=console=ttyS0,115200n8 noinitrd rw ip=dhcp root=/dev/nfs nfsroot=10.0.0.26:/var/nfs/root/fs
    bootcmd=if mmc rescan 0; then if fatload mmc 0 0xc0600000 boot.scr; then source 0xc0600000; else fatload mmc 0 0xc0700000 uImage; boi
    bootdelay=3
    bootfile="uImage"
    ethact=DaVinci-EMAC
    ethaddr=00:00:00:00:0c:00
    ipaddr=10.0.0.148
    netmask=255.255.255.0
    serverip=10.0.0.26
    stderr=serial
    stdin=serial
    stdout=serial
    ver=U-Boot 2010.12-00000-g673deb0-dirty (May 05 2014 - 12:00:21)

    My DSP project is in the attached DspDemo.tar file. I also attached my syslink build and slaveloader.

    Steps to reproduce the problem are:

    root@hawkboard:/usr/work# insmod /lib/modules/3.1.10-gb6b7318-dirty/kernel/drive
    rs/dsp/syslink.ko TRACE=1 TRACEFAILURE=1 TRACECLASS=3
    SysLink version : 2.21.03.11
    SysLink module created on Date:Apr 22 2014 Time:17:55:53
    Trace enabled
    Trace SetFailureReason enabled
    Trace class 3
    MemoryOS_map: pa=0x1c00000, va=0xfec00000, sz=0x400000
    root@hawkboard:/usr/work#
    root@hawkboard:/usr/work# ./slaveloader startup DSP ./DemoDsp.out

     

    Regards

    Gleb

    7103.DspDemo.tar

    8081.syslink.ko.tar

    1602.slaveloader.tar

  • Hi,

    Could you please try the below bootargs,

    setenv bootargs  mem=32M@0xc0000000 mem=64M@0xc4000000 console=ttyS2,115200n8 ip=dhcp nfsroot=10.100.1.72:/usr/local/filesystem_omapl138 root=/dev/nfs rw rootwait

  • Hi Titus,

    That worked!!! Thank you very much for your time.

    Best regards

    Gleb

  • Hi,

    Sounds good.

    Thanks for your update.

  • Hi Titus,

    I am sorry to bother you again but I still have problems with loading DSP. Thanks to your help I have no problems loading a very small project. But when it gets to a bigger one the slaveloader crashes the kernel:

    _Coff_getSymbolTable: Symbol name [$C$L235]

    _Coff_getSymbolTable: Symbol name [$C$L236]

    _Coff_getSymbolTable: Symbol name [$C$L237]

    _Coff_getSymbolTable: Symbol name [$C$L238]

    _Coff_getSymbolTable: Symbol name [$C$RL99]

    _Coff_getSymbolTable: Symbol name [$C$L239]

    _Coff_getSymbolTable: Symbol name [$C$L240]

    _Coff_getSymbolTable: Symbol name [$C$L241]

    _Coff_getSymbolTable: Symbol name [$C$L242]

    _Coff_getSymbolTable: Symbol name [$C$RL100������������������}��������������g�������������������������������������������������}��
    Unable to handle kernel paging request at virtual address 5fffdffe
    pgd = c79cc000
    [5fffdffe] *pgd=00000000
    Internal error: Oops: 80000005 [#1] PREEMPT
    Modules linked in: syslink
    CPU: 0 Not tainted (3.1.10-gb6b7318-dirty #50)
    PC is at 0x5fffdffe
    LR is at 0x5fffdfff
    pc : [<5fffdffe>] lr : [<5fffdfff>] psr: 40000033
    sp : c6d8fcb0 ip : 00000000 fp : 0019f717

    I attach the file I try to download and project map and cfg files. Can you see what could be the problem?

    Thanks

    Gleb

    6114.dsp.tar

  • Hi,

    Okay, I will check your attachment and mean while you do update me with complete error logs (please attach it & don't do plain copy/paste) that what are all the steps followed by you.

  • I think I have found the cause of the problem or workaround: when I set TRACECLASS to 1 or 2 instead of 3 the project is loaded well. So it seems to be a problem with output load on TTY. Is that a known problem?

    Regards

    Gleb

  • Hi Titus,

    One more question please. I am at the last stage of setup calling

    status = Ipc_control( procId, Ipc_CONTROLCMD_STARTCALLBACK, NULL );

    After that I get an endless stream of "Ipc_attach: Ipc_procSyncStart failed!" messages. I found few threads on this topic but not sure the are relevant in my situation. In the .cfg file I changed the order of DSP and HOST:

    MultiProc.setConfig("DSP", ["DSP", "HOST"]);

    So now DSP process ID is 0. Otherwise the .cfg file is unchanged.

    I thought that may be there is a problem of cache but was not able to enable it.

    Could you help me with this one?

    Regards

    Gleb

  • I had some progress with the last issue. It turns out that DSP is not running after being loaded. When I connect with debugger, loading symbols only, and restart the execution then cores get synchronized. Same problem with slaveloader... 

    I wonder why after calling ProcMgr_start DSP is not running? The entry point is set correctly to _c_int00.

    root@hawkboard:/usr/work# ./slaveloader startup DSP ./AudioDsp.out 

    MultiProc Module already initialized!
    NameServer Module already initialized!
    SharedRegion Module already initialized!
    GateMP Module already initialized!
    Notify Module already initialized!
    MessageQ Module already initialized!
    HeapBufMP Module already initialized!
    HeapMemMP Module already initialized!
    ListMP Module already initialized!
    ClientNotifyMgr Module already initialized!
    FrameQBufMgr Module already initialized!
    FrameQ Module already initialized!
    ProcMgr_getProcInfo: bootMode: [0]
    MemoryOS_map: entry already exists
    mapInfo->src [0x1c00000]
    mapInfo->dst [0xfec00000]
    mapInfo->size [0x400000]
    OMAPL1XXPROC_attach: Mapping memory regions
    OMAPL1XXPROC_attach: slave is now in reset
    ProcMgr_getProcInfo: bootMode: [0]
    OsalDrv_mmap(): setting cache disabled for physical address 11800000
    OsalDrv_mmap(): setting cache disabled for physical address 11f00000
    Attached to slave procId 0.
    Loading procId 0.
    _Coff_getSymTabDetails: Number of symbols: 16588

    _Coff_getStringTable: String table [0xc8eaf000]
    _Coff_getSymbolTable: Allocated memory for the symbol table

    _Coff_getSymbolTable: Seeking to the location of the symbol table

    _Coff_getSymbolTable: Reading symbol table into memory

    _Coff_getSymbolTable: Start of string table [0x1f2c65]

    _Coff_getSymbolTable: Updated numSymbols after reading symbol table [14684]

    Coff_load: Number of sections: 22

    _Coff_getOptHeaderSize: Optional Header Size: 28

    MemoryOS_map: pa=0xc30bc800, va=0xc8f8c800, sz=0x34
    _ProcMgr_map for SlaveVirt:
    dstAddr [0xc30bc000]
    sgList.paddr [0xc30bc000]
    sgList.offset [0x800]
    sgList.size [0x834]
    MemoryOS_map: pa=0xc30b8180, va=0xc8f90180, sz=0x2000
    _ProcMgr_map for SlaveVirt:
    dstAddr [0xc30b8000]
    sgList.paddr [0xc30b8000]
    sgList.offset [0x180]
    sgList.size [0x2180]
    MemoryOS_map: pa=0xc30bc468, va=0xc8f96468, sz=0x39
    _ProcMgr_map for SlaveVirt:
    dstAddr [0xc30bc000]
    sgList.paddr [0xc30bc000]
    sgList.offset [0x468]
    sgList.size [0x4a1]
    MemoryOS_map: pa=0xc30ba180, va=0xc8f9c180, sz=0x1e3c
    _ProcMgr_map for SlaveVirt:
    dstAddr [0xc30ba000]
    sgList.paddr [0xc30ba000]
    sgList.offset [0x180]
    sgList.size [0x1fbc]
    MemoryOS_map: pa=0xc30bc4a4, va=0xc8fa04a4, sz=0x8
    _ProcMgr_map for SlaveVirt:
    dstAddr [0xc30bc000]
    sgList.paddr [0xc30bc000]
    sgList.offset [0x4a4]
    sgList.size [0x4ac]
    MemoryOS_map: pa=0xc3000000, va=0xc8fa8000, sz=0x6f14
    _ProcMgr_map for SlaveVirt:
    dstAddr [0xc3000000]
    sgList.paddr [0xc3000000]
    sgList.offset [0x0]
    sgList.size [0x6f14]
    MemoryOS_map: pa=0xc30bc000, va=0xc8fa6000, sz=0x200
    _ProcMgr_map for SlaveVirt:
    dstAddr [0xc30bc000]
    sgList.paddr [0xc30bc000]
    sgList.offset [0x0]
    sgList.size [0x200]
    MemoryOS_map: pa=0xc3062fc0, va=0xc9000fc0, sz=0x551c0
    _ProcMgr_map for SlaveVirt:
    dstAddr [0xc3062000]
    sgList.paddr [0xc3062000]
    sgList.offset [0xfc0]
    sgList.size [0x56180]
    MemoryOS_map: pa=0xc30bbfbc, va=0xc8fb4fbc, sz=0x40
    _ProcMgr_map for SlaveVirt:
    dstAddr [0xc30bb000]
    sgList.paddr [0xc30bb000]
    sgList.offset [0xfbc]
    sgList.size [0xffc]
    MemoryOS_map: pa=0xc30bc200, va=0xc8fb8200, sz=0x148
    _ProcMgr_map for SlaveVirt:
    dstAddr [0xc30bc000]
    sgList.paddr [0xc30bc000]
    sgList.offset [0x200]
    sgList.size [0x348]
    MemoryOS_map: pa=0xc3006f18, va=0xc9080f18, sz=0x5c0a8
    _ProcMgr_map for SlaveVirt:
    dstAddr [0xc3006000]
    sgList.paddr [0xc3006000]
    sgList.offset [0xf18]
    sgList.size [0x5cfc0]
    MemoryOS_map: pa=0xc30bc348, va=0xc8fbe348, sz=0x120
    _ProcMgr_map for SlaveVirt:
    dstAddr [0xc30bc000]
    sgList.paddr [0xc30bc000]
    sgList.offset [0x348]
    sgList.size [0x468]
    Loaded file ./Au Coff_getEntryPt: Entry point [0xc30af420]
    dioDsp.out on slCOFF File entry point: [0xc30af420]
    ave procId 0.
    OMAPL1XXPROC_start: Configuring boot register
    Reset vector [0xc30af420]!

    OMAPL1XXPROC_start: Slave successfully started
    Started slave procId 0.
    _NotifyDrv: Termination packet

    Regards

    Gleb