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.

Linux/AM5728: DSP customizing issue

Part Number: AM5728

Tool/software: Linux

Hi, Ti and all,

I use PSDK05.00 and TI AM5728 IDK kit.

I want to use 2 DSP cores at same time, so I have modified the big-data-ipc-linux-demo(host_linux) of PDSK as bellow for DSP1 & DSP2:

big-data-ipc-demo-linux-01.01.00.00/host_linux/simple_buffer_example/shared/DRA7XX/config1.bld for DSP1:

...

    EXT_CODE: {
        name: "EXT_CODE",
        base: 0x95000000,
        len:  0x00100000,
        space: "code",
        access: "RWX"
    },
    EXT_DATA: {
        name: "EXT_DATA",
        base: 0x95100000,
        len:  0x00200000,
        space: "data",
        access: "RW"
    },
    EXT_HEAP: {
        name: "EXT_HEAP",
        base: 0x95300000,
        len:  0x00300000,
        space: "data",
        access: "RW"
    },

... 

big-data-ipc-demo-linux-01.01.00.00/host_linux/simple_buffer_example/shared/DRA7XX/rsc_table_dsp1.h for DSP1:

...

#define DSP_MEM_TEXT            0x95000000
/* Co-locate alongside TILER region for easier flushing */
#define DSP_MEM_IOBUFS          0x80000000
#define DSP_MEM_DATA            0x95100000
#define DSP_MEM_HEAP            0x95300000

#define DSP_MEM_IPC_DATA        0x9F000000
#define DSP_MEM_IPC_VRING       0x99000000
#define DSP_MEM_RPMSG_VRING0    0x99000000
#define DSP_MEM_RPMSG_VRING1    0x99004000
#define DSP_MEM_VRING_BUFS0     0x99040000
#define DSP_MEM_VRING_BUFS1     0x99080000

#define DSP_MEM_IPC_VRING_SIZE  SZ_1M
#define DSP_MEM_IPC_DATA_SIZE   SZ_1M
#define DSP_MEM_TEXT_SIZE       (SZ_1M * 1)
#define DSP_MEM_DATA_SIZE       (SZ_1M * 2)
#define DSP_MEM_HEAP_SIZE       (SZ_1M * 3)
#define DSP_MEM_IOBUFS_SIZE     (SZ_1M * 90)

big-data-ipc-demo-linux-01.01.00.00/host_linux/simple_buffer_example/shared/DRA7XX/config2.bld for DSP2:

...

    EXT_CODE: {
        name: "EXT_CODE",
        base: 0x95600000,
        len:  0x00100000,
        space: "code",
        access: "RWX"
    },
    EXT_DATA: {
        name: "EXT_DATA",
        base: 0x95700000,
        len:  0x00200000,
        space: "data",
        access: "RW"
    },
    EXT_HEAP: {
        name: "EXT_HEAP",
        base: 0x95900000,
        len:  0x00300000,
        space: "data",
        access: "RW"
    },

...

big-data-ipc-demo-linux-01.01.00.00/host_linux/simple_buffer_example/shared/DRA7XX/rsc_table_dsp2.h for DSP2:

...

#define DSP_MEM_TEXT            0x95600000
/* Co-locate alongside TILER region for easier flushing */
#define DSP_MEM_IOBUFS          0x80000000
#define DSP_MEM_DATA            0x95700000
#define DSP_MEM_HEAP            0x95900000

#define DSP_MEM_IPC_DATA        0x9F000000
#define DSP_MEM_IPC_VRING       0x99000000
#define DSP_MEM_RPMSG_VRING0    0x99000000
#define DSP_MEM_RPMSG_VRING1    0x99004000
#define DSP_MEM_VRING_BUFS0     0x99040000
#define DSP_MEM_VRING_BUFS1     0x99080000

#define DSP_MEM_IPC_VRING_SIZE  SZ_1M
#define DSP_MEM_IPC_DATA_SIZE   SZ_1M
#define DSP_MEM_TEXT_SIZE       (SZ_1M * 1)
#define DSP_MEM_DATA_SIZE       (SZ_1M * 2)
#define DSP_MEM_HEAP_SIZE       (SZ_1M * 3)
#define DSP_MEM_IOBUFS_SIZE     (SZ_1M * 90)
...

the others (include DTS) was not changed.

Then DSP1 booting successes, but DSP2 failed as bellow:

root@am57xx-evm:/home/test_arm_dsp# ./big-data-ipc2.sh
[ 2512.811718] omap_hwmod: mmu0_dsp1: _wait_target_disable failed
[ 2512.817678] remoteproc remoteproc2: stopped remote processor 40800000.dsp
[ 2512.824945] remoteproc remoteproc2: releasing 40800000.dsp
[ 2512.831147] remoteproc remoteproc3: releasing 41000000.dsp
[ 2512.842309] omap-rproc 40800000.dsp: assigned reserved memory node dsp1-memory@99000000
[ 2512.851539] remoteproc remoteproc2: 40800000.dsp is available
[ 2512.859494] omap-rproc 41000000.dsp: assigned reserved memory node dsp2-memory@9f000000
[ 2512.862563] remoteproc remoteproc2: powering up 40800000.dsp
[ 2512.862575] remoteproc remoteproc2: Booting fw image dra7-dsp1-fw.xe66, size 4426452
[ 2512.869257] omap_hwmod: mmu0_dsp1: _wait_target_disable failed
[ 2512.869294] omap-iommu 40d01000.mmu: 40d01000.mmu: version 3.0
[ 2512.869328] omap-iommu 40d02000.mmu: 40d02000.mmu: version 3.0
[ 2512.898584] virtio_rpmsg_bus virtio2: rpmsg host is online
[ 2512.898622] remoteproc remoteproc2: registered virtio2 (type 7)
[ 2512.898626] remoteproc remoteproc2: remote processor 40800000.dsp is now up
[ 2512.899365] virtio_rpmsg_bus virtio2: creating channel rpmsg-proto addr 0x3d
[ 2512.938381] remoteproc remoteproc3: 41000000.dsp is available
[ 2512.951035] remoteproc remoteproc3: powering up 41000000.dsp
[ 2512.956943] remoteproc remoteproc3: Booting fw image dra7-dsp2-fw.xe66, size 4426452
[ 2512.971454] omap_hwmod: mmu0_dsp2: _wait_target_disable failed
[ 2512.977356] omap-iommu 41501000.mmu: 41501000.mmu: version 3.0
[ 2512.983283] omap-iommu 41502000.mmu: 41502000.mmu: version 3.0
[ 2512.989461] alloc_contig_range: [9f004, 9f007) PFNs busy
[ 2512.995335] cma: cma_alloc: alloc failed, req-size: 2048 pages, ret: -12
[ 2513.002074] omap-rproc 41000000.dsp: failed to allocate dma memory: len 0x800000
[ 2513.009542] remoteproc remoteproc3: Failed to process resources: -12
[ 2513.022765] omap_hwmod: mmu0_dsp2: _wait_target_disable failed
>> main() start:
Main_main() start:
App_create() start:
msgqName=DSP1:MsgQ:01
msgqName=DSP2:MsgQ:01
^CIpc: Caught SIGINT, calling Ipc_stop...

########## dsp1 log ##########
[      0.000] 18 Resource entries at 0x95000000
[      0.000] [t=0x000252a1] xdc.runtime.Main: --> main:
[      0.000] registering rpmsg-proto:rpmsg-proto service on 61 with HOST
[      0.000] [t=0x00295f77] xdc.runtime.Main: NameMap_sendMessage: HOST 53, port=61
[      0.000] [t=0x002a5b7a] xdc.runtime.Main: --> smain:
[      0.000] [t=0x002afd94] Server: msgqName=DSP1:MsgQ:01
[      0.000]
[      0.000] [t=0x002bdfcd] Server: Server_create(): server is ready
[      0.000] [t=0x002c2d7a] Server: Server_create() leave: 0
[      0.000] [t=0x002c6868] Server: Server_exec(): start

How can I solve this issue?

Please lead me to success.

Thanks,

Best Regards.

Aither.

  • In addition, I have tested my DSP2 firmware with big-data-ipc-demo-linux sample as below:
    root@am57xx-evm:/home/test_arm_dsp# app_host DSP2
    [ 230.035390] remoteproc remoteproc3: releasing 41000000.dsp
    [ 230.043808] omap-rproc 41000000.dsp: assigned reserved memory node dsp2-memory@9f000000
    [ 230.053696] remoteproc remoteproc3: 41000000.dsp is available
    [ 230.064885] remoteproc remoteproc3: powering up 41000000.dsp
    [ 230.070581] remoteproc remoteproc3: Booting fw image dra7-dsp2-fw.xe66, size 4426452
    [ 230.085807] omap_hwmod: mmu0_dsp2: _wait_target_disable failed
    [ 230.091698] omap-iommu 41501000.mmu: 41501000.mmu: version 3.0
    [ 230.097632] omap-iommu 41502000.mmu: 41502000.mmu: version 3.0
    [ 230.109408] cma: cma_alloc: alloc failed, req-size: 2048 pages, ret: -12
    [ 230.116184] omap-rproc 41000000.dsp: failed to allocate dma memory: len 0x800000
    [ 230.123667] remoteproc remoteproc3: Failed to process resources: -12
    [ 230.136857] omap_hwmod: mmu0_dsp2: _wait_target_disable failed
    >> main() start:
    Main_main() start:
    App_create() start:
    msgqName=DSP1:MsgQ:01
    App_create(): Host is ready
    App_create() leave:
    App_exec() start:
    [231334] CMEM_init success
    [231334] CMEM_getPool success
    CMEM_allocPool success: Allocated buffer 0xa5dd4000
    SharedRegion_setup success
    App_taskFxn: SR_1, base 0xa5dd4000, len=1000000
    HeapMem_setup success
    HeapMem_create success
    App_taskFxn: SR_1 heap, totalSize=16777216,totalFreeSize=16777216,largestFreeSize=16777216
    App_taskFxn: SR_1 heap, buf=0x0xa5dd4080,size=16777216
    [231335] Shared memory phys Addr ffffffffa0000000
    [231335] sending INIT message
    [231336] INIT-resp received 1
    [231337] Sending DATA message
    [231388] DATA resp received 2
    [231388] Sending QUIT message
    [231388] QUIT resp received: 3
    App_exec() leave: 0
    App_delete() start:
    App_delete() leave:
    >> Main_main() leave:

    >> Host: Test Passed
    >>- main() leave:
    I think that the issue occurs when DSP1 and DSP2 run at same time.

    What is the solution?

    Thanks,
    Atiher
  • Hello Aither,

    Config.bld is a shared file so you should either have one for your entire application or they should match. You can differentiate between DSPs by defining a platform table for each DSP as shown below and then modifying the makefile to match.

    Build.platformTable["ti.platforms.evmDRA7XX:dsp1"] = {
        externalMemoryMap: [
            [ "EXT_CODE", evmDRA7XX_ExtMemMapDsp.EXT_CODE ],
            [ "EXT_DATA", evmDRA7XX_ExtMemMapDsp.EXT_DATA ],
            [ "EXT_HEAP", evmDRA7XX_ExtMemMapDsp.EXT_HEAP ],
            [ "EXC_DATA", evmDRA7XX_ExtMemMapDsp.EXC_DATA ],
            [ "PM_DATA", evmDRA7XX_ExtMemMapDsp.PM_DATA ],
        ],
        codeMemory: "EXT_CODE",
        dataMemory: "EXT_DATA",
        stackMemory: "EXT_DATA",
    };
    Build.platformTable["ti.platforms.evmDRA7XX:dsp2"] = {
        externalMemoryMap: [
            [ "EXT_CODE", evmDRA7XX_ExtMemMapDsp.EXT_CODE ],
            [ "EXT_DATA", evmDRA7XX_ExtMemMapDsp.EXT_DATA ],
            [ "EXT_HEAP", evmDRA7XX_ExtMemMapDsp.EXT_HEAP ],
            [ "EXC_DATA", evmDRA7XX_ExtMemMapDsp.EXC_DATA ],
            [ "PM_DATA", evmDRA7XX_ExtMemMapDsp.PM_DATA ],
        ],
        codeMemory: "EXT_CODE",
        dataMemory: "EXT_DATA",
        stackMemory: "EXT_DATA",
    };

  • Hi, Sahin,

    First, thanks you very much for quick reply.

    I modified config1.bld and config2.bld as your mention, and tested as bellow(previous error disappear, but new error occurs) :

    root@am57xx-evm:/home/test_arm_dsp# ./big-data-ipc2.sh

    [  334.265439] remoteproc remoteproc2: releasing 40800000.dsp

    [  334.272267] remoteproc remoteproc3: releasing 41000000.dsp

    [  334.285239] omap-rproc 40800000.dsp: assigned reserved memory node dsp1-memory@99000000

    [  334.294104] remoteproc remoteproc2: 40800000.dsp is available

    [  334.305375] omap-rproc 41000000.dsp: assigned reserved memory node dsp2-memory@9f000000

    [  334.305790] remoteproc remoteproc2: powering up 40800000.dsp

    [  334.305801] remoteproc remoteproc2: Booting fw image dra7-dsp1-fw.xe66, size 4425220

    [  334.312463] omap_hwmod: mmu0_dsp1: _wait_target_disable failed

    [  334.312502] omap-iommu 40d01000.mmu: 40d01000.mmu: version 3.0

    [  334.312563] omap-iommu 40d02000.mmu: 40d02000.mmu: version 3.0

    [  334.345366] remoteproc remoteproc2: erroneous trace resource entry

    [  334.352848] remoteproc remoteproc3: 41000000.dsp is available

    [  334.358223] remoteproc remoteproc3: powering up 41000000.dsp

    [  334.358234] remoteproc remoteproc3: Booting fw image dra7-dsp2-fw.xe66, size 4425220

    [  334.364890] omap_hwmod: mmu0_dsp2: _wait_target_disable failed

    [  334.364928] omap-iommu 41501000.mmu: 41501000.mmu: version 3.0

    [  334.365017] omap-iommu 41502000.mmu: 41502000.mmu: version 3.0

    [  334.390993] remoteproc remoteproc2: Failed to process resources: -22

    [  334.405083] omap_hwmod: mmu0_dsp1: _wait_target_disable failed

    [  334.420880] alloc_contig_range: [9f000, 9f003) PFNs busy

    [  334.426486] alloc_contig_range: [9f004, 9f007) PFNs busy

    [  334.433663] alloc_contig_range: [9f000, 9f003) PFNs busy

    >> main() start:

    [  334.442671] remoteproc remoteproc3: erroneous trace resource entry

    [  334.449186] remoteproc remoteproc3: Failed to process resources: -22

    [  334.465163] omap_hwmod: mmu0_dsp2: _wait_target_disable failed

    Main_main() start:

    App_create() start:

    msgqName=DSP1:MsgQ:01

    How can solve this issue?

    Thank you again.

    Best Regards.

    Aither

  • Aither,

    There is most likely some mismatch between the config.bld, resource table, and dts file. Make sure you have enough memory allocated in the dts file and rsc table.

    Please take a look at these documents:

    software-dl.ti.com/.../Foundational_Components_IPC.html

    http://www.ti.com/lit/an/sprac60/sprac60.pdf