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.

66AK2G12: DSP loading in Linux

Part Number: 66AK2G12

I succeeded in QSPI boot mode and SDCard boot mode.
It has been confirmed that my DSP source is functioning normally.

Now I installed Linux OS.
I want to load DSP with the same source code in a Linux environment.

My question:
1. Is there any other way to load and run DSP.out other than MPMCL command?



2. If I boot the Linux and load it directly into the CCS, It's will operate normally,  But If I load with MPMCL, It doesn't work.

if I try that mpmcl load after mpmcl reset are occurs -104 error msg, but I will load again , they are displayed load success msg.

ex)

:~# mpmcl reset dsp0
reset succeeded
:~# mpmcl load dsp0 thunderDSP.out
load failed (error: -104)
:~# mpmcl load dsp0 thunderDSP.out
load succeeded

I have to load twice every time to get a message of success after reset. Is this relevant to not operating normally?

reference(

source  memory configuration

name                       origin           length
---------------------------------------------------------------
MSMCSRAM       0c000000     00100000     
L2SRAM             10800000      00100000     
DDR3                  80000000     60000000     
DDR3CODE        e0000000     20000000     

)



3. If DSP loads normally and runs, I want to debug. Is there any way to place a string in the Linux bash directly from the DSP source, such as printf?

Thanks,

DG

  • Hello DG,

    Could you please see if the following helps?

    Linux IPC for K2x

    Regards,
    Sahin

  • Hi Sahin 

    I checked the document you attached, It has helped a lot

    The problem of error '-104' still continues.

    I checked the log file and here is more detail:

    Jan 8 06:39:50 k2g-evm daemon.info mpmsrv[356]: mpmsrv.c:110:mpm_server: received message of size 70 bytes for cmd 1
    Jan 8 06:39:50 k2g-evm daemon.info mpmsrv[356]: mpmsrv.c:134:mpm_server: received load command for dsp0 filename /home/root/thunderDSP.out
    Jan 8 06:39:50 k2g-evm daemon.err mpmsrv[356]: mpmdlif.c:197:map_and_copy_segment: transport mmap failed for addr 0x80000000 size 81110288 (err: No such file or directory)
    Jan 8 06:39:50 k2g-evm daemon.err mpmsrv[356]: mpmdlif.c:1279:DLIF_allocate: map and copy failed for image /home/root/thunderDSP.out with addr 0x80000000, size 0x4d5a510
    Jan 8 06:39:50 k2g-evm daemon.err mpmsrv[356]: mpmdlif.c:1442:DLIF_error: << D L O A D >> ERROR:
    Jan 8 06:39:50 k2g-evm daemon.err mpmsrv[356]: mpmdlif.c:1445:DLIF_error: Failed to allocate target memory for static executable.
    Jan 8 06:39:50 k2g-evm daemon.err mpmsrv[356]: mpmdlif.c:864:mpm_dlif_load: Image loading failed for file /home/root/thunderDSP.out
    Jan 8 06:39:50 k2g-evm daemon.err mpmsrv[356]: mpmssm.c:510:mpm_load_slave: Image loading failed for dsp0 : image
    Jan 8 06:39:50 k2g-evm daemon.err mpmsrv[356]: mpmssm.c:419:mpm_ssm_state_error: entered error state for dsp0
    Jan 8 06:39:50 k2g-evm daemon.info mpmsrv[356]: mpmsrv.c:77:mpm_server: waiting for slave message

    and my  memory map:

             name            origin    length      used     unused   attr    fill
    ----------------------  --------  ---------  --------  --------  ----  --------
      MSMCSRAM              0c000000   00100000  00020010  000dfff0  RW X
      L2SRAM                10800000   00100000  000b031e  0004fce2  RW X
      DDR3                  80000000   60000000  07659278  589a6d88  RW X
      DDR3CODE              e0000000   20000000  0041dafc  1fbe2504  RW X
    
    

    I checked mpm_config.json  because I thought it may be a memory size problem:

    {

    "name": " local-ddr",

    "globaladdr": "0x80000000",

    "length": "0x60000000",

    "devicename": "/dev/dspmem"

    }

    As a result of confirmation, it is not a problem mpm_config.json, is there a problem that I missed?

    DG

  • I checked the Linux device tree source for K2G. It allocates 40MB for DSP memory at address 0x9D000000. Refer to the "dsp_common_mpm_memory" entry in the snippet below from keystone-k2g-evm.dts:

    reserved-memory {
    		#address-cells = <2>;
    		#size-cells = <2>;
    		ranges;
    
    		dsp_common_mpm_memory: dsp-common-mpm-memory@81d000000 {
    			compatible = "ti,keystone-dsp-mem-pool";
    			reg = <0x00000008 0x1d000000 0x00000000 0x2800000>;
    			no-map;
    			status = "okay";
    		};
    
    		dsp_common_memory: dsp-common-memory@81f800000 {
    			compatible = "shared-dma-pool";
    			reg = <0x00000008 0x1f800000 0x00000000 0x800000>;
    			reusable;
    			status = "okay";
    		};
    	};

    At the moment, your application is trying to place the DSP code/data at address 0x80000000 with size 60MB. Your DSP application needs to reside within the "dsp_common_mpm_memory" region but this region is not at the correct address and is not big enough, that is why you are getting the -104 load error. 

    You can increase the size of the dsp_common_mpm_memory region and change the start address as shown below.

    dsp_common_mpm_memory: dsp-common-mpm-memory@81d000000 {
    			compatible = "ti,keystone-dsp-mem-pool";
    			reg = <0x00000008 0x00000000 0x00000000 0x60000000>;
    			no-map;
    			status = "okay";
    		};

    This will change the size of the dsp_common_mpm_memory pool to 60MB at start address 0x80000000

    You will also need to move the dsp_common_memory pool as a result of this to prevent trampling over it. This pool is required for IPC vring and virtqueue buffers.

    Regards,
    Sahin

  • I check and change "dsp_common_mpm_memory" , but the same error message is printed out.

    Is there another problem?

    Regards,

    DG

  • I believe you need to rebuild the Linux kernel and zImage as described in the guide below. 

    Linux Kernel User's Guide

    Regards,
    Sahin