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.

EVMK2G: Load CMB example program in DSP from ARM Linux

Part Number: EVMK2G
Other Parts Discussed in Thread: SYSBIOS

Hi,

I want to develop an application that is loaded by ARM-Linux on the DSP and processes the audio streams from the CMB. Since it is a proof of concept, the idea is to start modifying an existing project, for example the audio analog loopback test.

Given that when loading  the default loopback example, I only have to load the audioAnalogLoopbackTest.out binary file to the DSP module, I have tried to load the same binary file using Multiple Processor Manager from ARM-Linux, as follows:

mpmcl reset dsp0

mpmcl load dsp0 audioAnalogLoopbackTest.out

but I get the following message:

load failed (error: -104)

I don't know if it is possible to do it this way and I am missing some previous configurations, or maybe the way to do this is completely different.

Thank you, and best regards,

Fernando

  • Hi, Fernando,

    Have you included resource table in the DSP application? If not, please refer to the Resource Table Guide to have it in your DSP application. Usually, the RTOS PDK examples is for RTOS only environment which does not require resource table. You can also take a look at IPC examples on how it is done for Linux/RTOS environment under <RTOS_PDK>/ipc_x_xx_xx_xx/examples/DRA7XX_linux_elf directory.

    Rex
  • Hi Rex,

    Rex Chang said:
    Usually, the RTOS PDK examples is for RTOS only environment which does not require resource table.

    I understand from your answer that resource tables are used for Linux/RTOS environments, for example inter-process communications between ARM-Linux and DSP-RTOS. What I want to do is to load an 'RTOS only' application, i.e. audio analog loopback test, in the DSP (RTOS) from ARM (Linux). Is it necessary to include the resource table, despite the application is executed only in DSP-RTOS, with no communication with ARM?

    Rex Chang said:
    please refer to the Resource Table Guide to have it in your DSP application.

    Where can I find this guide?

    Regards,

    Fernando

  • Hi, Fernando,

    What's the size of the RTOS binary?

    Rex
  • Hi, 

    The size of the binary is 3,632 KB. 

    Fernando

  • Hi, Fernando,

    K2G has 40MB reserved MPM memory space and your size seems ok. Does the .out file run on DSP using CCS?

    Rex
  • Yes, I have taken the same binary (.out) that I had loaded previously using CCS, and it worked.

  • Hi, Fernando,

    I have to point you to an old document which I see being a gap from current documentation. The MCSDK has migrated to Processor SDK, but the mechanism stays the same. You may find useful debug info in it.

    processors.wiki.ti.com/.../MCSDK_UG_Chapter_Developing_System_Mgmt

    I assume you didn't change anything on the system configuration such as reserved mpm memory area, and other DSP related configuration. In this case, you should read the section of "MPM error code and debugging" and see if there is any useful info in the daemon logs.

    Rex
  • Hi Rex,

    Rex Chang said:
    I assume you didn't change anything on the system configuration such as reserved mpm memory area, and other DSP related configuration.

    No, I didn't.

    Rex Chang said:
    In this case, you should read the section of "MPM error code and debugging" and see if there is any useful info in the daemon logs.

    I cannot find in /var/log/ any file named mpmsrv.log. Since the "outputif" parameter has a value of "syslog" in /etc/mpm/mpm_config.json, I thought maybe I could find an error message from mpm in  /var/log/syslog, but it's not the case. In fact, none of the files in /var/log/ is updated when I try to load the binary to the dsp, getting the aforementioned "-104" error.

    Fernando

  • Hi, Fernando,

    Have you tried downloading one of the IPC or PDK examples ? Does it work for you? Just sanity check.
    If you try IPC example, it can be the binary in /lib/firmware/ipc/ti_platforms_xxxxx_coreX/messageq_single.xe66.
    For PDK examples, you will need to build from RTOS PDK package.

    Rex
  • Hi Rex,

    I have executed the IPC example from the Matrix App Launcher (Multicore Demonstrations), that internally uses mpmcl command, and it worked. Then, I have also loaded the /lib/firmware/ipc/ti_platforms_xxxxx_coreX/messageq_single.xe66, 

    mpmcl reset dsp0

    mpmcl load dsp0 /lib/firmware/ipc/ti_platforms_xxxxx_coreX/messageq_single.xe66

    and it also worked.

    The audioAnalogLoopbackTest.out file for which I get the error message can be found in "pdk_k2g_1_0_12\packages\ti\addon\cmb\test\evmK2G\analog\loopback\build\make", and I haven't done any modification. 

    Regards,

    Fernando

  • Hi, Fernando,

    The CMB demo was meant to run using CCS in RTOS setup. Have you tried running it using CCS with Linux running on ARM? I suspect it won't run in this case, and may have something to do with memory configuration. You will need to adjust memory map when running with LInux. I looked at the memory configuration which has the code running off MSMC, but in .map, it shows DDR area is also used for some far data. That would conflict with Linux DDR usage. You will need to avoid that.

    SEGMENT ALLOCATION MAP
    run origin  load origin   length   init length attrs members
    ----------  ----------- ---------- ----------- ----- -------
    00800000    00800000    0002ac80   0002ac80    r-x
      00800000    00800000    0002ac80   0002ac80    r-x .text
    0082ac80    0082ac80    00048b3a   00000000    rw-
      0082ac80    0082ac80    00028000   00000000    rw- systemHeap
      00852c80    00852c80    00020b3a   00000000    rw- .fardata
    008737c0    008737c0    00003d8e   00003d8e    r—
    ::::::::
    0087ba98    0087ba98    00002e30   00002e30    r--
      0087ba98    0087ba98    00002e30   00002e30    r-- .cinit
    80000000    80000000    00004efe   00000000    rw-
      80000000    80000000    00004efe   00000000    rw- .far
     
    .far       0    80000000    00004efe     UNINITIALIZED
                      80000000    00002000     (.common:ti_sysbios_heaps_HeapMem_Instance_State_1_buf__A)
                      80002000    00001000     audioAnalogLoopbackTest_pe66.oe66 (.far:taskStackSection)
                      80003000    00000a38     (.common:Mcasp_Instances)
                      80003a38    00000400     (.common:xdc_runtime_LoggerBuf_Instance_State_0_entryArr__A)
                      80003e38    00000400     (.common:xdc_runtime_SysMin_Module_State_0_outbuf__A)
                      80004238    000001f8     (.common:UartObjects)
                      80004430    00000198     (.common:Mcasp_loopDstBuf)
                      800045c8    00000198     (.common:Mcasp_loopSrcBuf)
     
    80000000  ti_sysbios_heaps_HeapMem_Instance_State_1_buf__A
    80002000  ti_sysbios_knl_Task_Instance_State_0_stack__A
    80002800  ti_sysbios_knl_Task_Instance_State_1_stack__A
    80003000  Mcasp_Instances
    80003a38  xdc_runtime_LoggerBuf_Instance_State_0_entryArr__A
    80003e38  xdc_runtime_SysMin_Module_State_0_outbuf__A
  • Hi Rex,

    To solve the DDR memory confict, I changed the .far from DDR3 to L2SRAM in audioAnalogLoopbackTest.cfg:

    -Program.sectMap[".far"] 	= "DDR3";
    +Program.sectMap[".far"] 	= "L2SRAM";

    Now, I can load the program from CCS to DSP, even if Linux is running in ARM (that couldn't be done with the previous configuration), and it works and I can hear two channels from the CMB through the LineOut .

    Furthermore, I can now load and run the .out from ARM-Linux using mpmcl. However, the program does not work when it's loaded from ARM, and I have no clue on what could be wrong now.

    Thank you very much,

    Fernando

  • Hi, Fernando,

    You can add a spin loop in the beginning of the DSP code,and use CCS to connect to the DSP to debug it.

    Rex