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.

DSP / OMX examples with EZSDK 5.05.02

Other Parts Discussed in Thread: SYSBIOS

Hi,

We are trying to run the DSP OMX examples with the DM8148 following the instructions with the firmware_loader 0 file.

The firmware_loader is not always successful from boot to boot.  Sometimes it works, sometimes it fails.  I am suspecting there is a caching problem with the DSP and perhaps the shared regions somewhere.  This seems like a configuraiton issue somewhere.

I enabled the OMX UIA tracing for the DSP according to:

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

When the firmware_loader hangs, the DSP is stuck in IpcAttach(), here are the DSP traces:

N:DSP P:0 #:00000 T:00000000002713e5 M:xdc.runtime.Main S:DSP: in main
N:DSP P:0 #:00001 T:00000000002ac1d1 M:xdc.runtime.Main S:DSP: IPC Start Successful
N:DSP P:0 #:00002 T:00000000002d8947 M:xdc.runtime.Main S:DSP: In Dsp_AppTask
N:DSP P:0 #:00003 T:00000000002f9e23 M:xdc.runtime.Main S:in DSP platform Init: Calling TIMM_OSAL_Init
N:DSP P:0 #:00004 T:00000000003e9563 M:xdc.runtime.Main S:in DSP platform Init: TIMM_OSAL_Init Success
N:DSP P:0 #:00005 T:000000000040ef51 M:xdc.runtime.Main S:in DSP platform Init: Calling OMX_Init
N:DSP P:0 #:00006 T:0000000000480c61 M:xdc.runtime.Main S:Module<ti.omx> Entering<DomxCore_procInit> @line<250>
N:DSP P:0 #:00007 T:00000000037a2c2f M:xdc.runtime.Main S:Module<ti.omx> @<DomxCore_procInit> @line<277> msg<Before Ipc_attach>

Then it hangs, and eventually the ARM syslink bails out with

[ 311.090000] *** Platform_startCallback: Ipc_attach timeout
[ 311.090000] Error [0xffffffff] at Line no: 2720 in file /export/space/ti-ezsdk_dm814x-evm_5_05_02_00/component-sources/syslink_2_21
_01_05/packages/ti/syslink/utils/hlos/knl/Linux/../../../../../../ti/syslink/family/hlos/knl/ti81xx/Platform.c
[ 311.110000] *** Ipc_control: Platform_startCallback failed!
[ 311.110000] Error [0xffffffff] at Line no: 841 in file /export/space/ti-ezsdk_dm814x-evm_5_05_02_00/component-sources/syslink_2_21_
01_05/packages/ti/syslink/utils/hlos/knl/Linux/../../../../../../ti/syslink/ipc/hlos/knl/Ipc.c
FIRMWARE: Ipc_CONTROLCMD_STARTCALLBACK Error: ProcMgr status 0xffffffff

The above run was using syslink_2_21_01_05, but the behavior is identical with the stock syslink_2_20_02_20 (I tried upgrading syslink to see if that would help).

When the DSP successfully loads, I get many more traces and the application works without any issues.

The only thing I am doing different is rebooting the system.  All of the images / executables are the same.

I am thinking that this is a CACHING issue or some uninitialized variable, but I need some guidance as to what to look for in Ipc_attach.  Can anyone please help me out?

-Mike

  • CACHING issues are usually due to wrong MAR bit setting .Did you change the memory map by any change. I am not familiar with eZSDK but you should see some configuration like

    var Cache = xdc.useModule('ti.sysbios.family.c64p.Cache');

    /* Disable caching for HWspinlock addresses */
    Cache.MAR0_31    = 0x00000000;
    Cache.MAR32_63   = 0x00000000;
    /* Config/EDMA registers cache disabled */
    Cache.MAR64_95   = 0x00000000;
    Cache.MAR96_127  = 0x00000000;
    /* CPU access code and data  - 0x80000000 cache enable */
    Cache.MAR128_159 = 0xFFFFFFFF;
    /* TILER memory cache disabled  - 0xA0000000*/
    Cache.MAR160_191 = 0xFFFFFFFF;
    /* memory cache disabled  - 0xC0000000*/
    Cache.MAR192_223 = 0xFFFFFFFF;
    /* memory cache disabled  - 0xE0000000*/
    Cache.MAR224_255 = 0xFFFFFFFF;

    in the c674 cfg file. MAR bits configuration is part of the firmware so if you change memory map you should also rebuild firmware.

    Another possibility is a IPC SHaredRegion isCache property is wrongly set. I.e SharedRegion is actually cached but is marked as non-cached. For regions marked as non-cached cache coherency operations will not be performed resulting in random failures depending on whether cache is naturally getting evicted or not.,

     

  • Hi,

    Thanks for the response.  

    I did update the memory map from 1GB to 512MB according to the TI DM8148 EVM Memory Map Instructions.  But I am not convinced I didn't have the same problem when running it using the 1G EVM board.  The instructions for OMX basically move 1 shared memory section (region 2, IPC_SR_FRAME_BUFFERS) from 0xB3D00000 down to 0xAB000000.  All other memory map areas remain the same.  The instructions basically involve two steps:

    1. Modify a header file in omx_05_02_00_48/src/ti/omx/memcg/memtbl_cfg.h changing the addresses mentioned above in a #define and rebuild (which I did).  The file configures 3 sections:


    Section 0, 0x9F700000 size 2M, control, cache enabled
    Section 1, 0x9A100000 size 1M, control, cache disabled (should not be used by DSP according to wiki page)
    Section 2, 0xAB000000 size 188M, data, cache disabled

    2. Update the provided memory segment bin file passed to the firmware_loader for the DSP and Video hardware loads.  I am using the same file for each.  I don't have any issue with the video loads.  I am attaching a copy of the file.  I note that there is no entry in this file for Section 0.  I also assume that the cache_enable_mask and cache_operation_mask fields in this structure, when set, mean to *disable* the cache for that processor.  So I think that this file is consistent with the header file from step 1.

    /*
     *  Copyright (c) 2010-2011, Texas Instruments Incorporated
     *
     *  Redistribution and use in source and binary forms, with or without
     *  modification, are permitted provided that the following conditions
     *  are met:
     *  
     *  *  Redistributions of source code must retain the above copyright
     *     notice, this list of conditions and the following disclaimer.
     *  
     *  *  Redistributions in binary form must reproduce the above copyright
     *     notice, this list of conditions and the following disclaimer in the
     *     documentation and/or other materials provided with the distribution.
     *  
     *  *  Neither the name of Texas Instruments Incorporated nor the names of
     *     its contributors may be used to endorse or promote products derived
     *     from this software without specific prior written permission.
     *  
     *  THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
     *  AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
     *  THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
     *  PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
     *  CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
     *  EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
     *  PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
     *  OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
     *  WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
     *  OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
     *  EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
     *  Contact information for paper mail:
     *  Texas Instruments
     *  Post Office Box 655303
     *  Dallas, Texas 75265
     *  Contact information: 
     *  http://www-k.ext.ti.com/sc/technical-support/product-information-centers.htm?
     *  DCMP=TIHomeTracking&HQS=Other+OT+home_d_contact
     *  ============================================================================
     *  
     */
    
    /** 
     *  @file   memsegdef.c
     *
     *  @brief  Memory map segment definitions, This is auto generated file
     *
     *
     *
     *  @ver    0.1
     *  
     *  ============================================================================
     */
    /*----------------------------- Memory Segment configuration -----------------*/
    #include <ldr_memseg.h>
    
    uint32_t ldrmemcfg_ddrSize = LDR_DDR_SIZE_1G ;
    
    LDR_MemSeg sdk_memseg[] =
    {
      /* Segment 0 */
      {
       1,                           /* valid */
       "IPC_SR_VIDEO_M3_VPSS_M3",    /* name */
       0x00100000,                  /* size */
       LDR_SEGMENT_TYPE_DYNAMIC_SHARED_HEAP,  /* LDR_SEGMENT_TYPE_DYNAMIC_SHARED_HEAP,
                                       seg_type */
       0,                           /* flags */
       0x9A100000,                  /* system_addr */
       0x9A100000,                  /* slave_virtual_addr */
       LDR_CORE_ID_A8,             /* master_core_id */
       ((1 << LDR_CORE_ID_VM3) | (1 << LDR_CORE_ID_DM3) | (1 << LDR_CORE_ID_A8)),
       /* core_id_mask */
       ((1 << LDR_CORE_ID_VM3) | (1 << LDR_CORE_ID_DM3)),
       /* cache_enable_mask */
       0,                           /* cache_operation_mask */
       1                            /* shared_region_id */
      },
    
      /* Segment 1 , Temporarily used by VFPC internal buff heap */
      {
       1,                           /* valid */
       "VPSS_M3_INT_HEAP_CACHED",     /* name */
       0x01B00000,                  /* size */
       LDR_SEGMENT_TYPE_DYNAMIC_LOCAL_HEAP,        /* seg_type */
       0,                           /* flags */
       0x9A200000,                  /* system_addr */
       0x9A200000,                  /* slave_virtual_addr */
       -1,                          /* master_core_id */
       (1 << LDR_CORE_ID_DM3),      /* core_id_mask */
       0,                           /* cache_enable_mask */
       0,                           /* cache_operation_mask */
       -1                           /* shared_region_id */
      },
    
      /* Segment 2 , Temporarily used by VFPC internal buff heap */
      {
       1,                           /* valid */
       "VIDEO_M3_INT_HEAP_CACHED",  /* name */
       0x01800000,                  /* size */
       LDR_SEGMENT_TYPE_DYNAMIC_LOCAL_HEAP,        /* seg_type */
       0,                           /* flags */
       0x9BD00000,                  /* system_addr */
       0x9BD00000,                  /* slave_virtual_addr */
       -1,                          /* master_core_id */
       (1 << LDR_CORE_ID_VM3),      /* core_id_mask */
       1,                           /* cache_enable_mask */
       0,                           /* cache_operation_mask */
       -1                           /* shared_region_id */
      },
    
      /* Segment 3 */
      {
       1,                           /* valid */
       "IPC_SR_FRAME_BUFFERS",      /* name */
       0x0BC00000,                  /* size */
       LDR_SEGMENT_TYPE_DYNAMIC_SHARED_HEAP,        /* seg_type */
       0,                           /* flags */
       0xAB000000,                  /* system_addr */
       0xAB000000,                  /* slave_virtual_addr */
       LDR_CORE_ID_A8,              /* master_core_id */
       (1 << LDR_CORE_ID_VM3) | (1 << LDR_CORE_ID_DM3) | (1 << LDR_CORE_ID_A8) | (1 << LDR_CORE_ID_DSP),
       /* core_id_mask */
       (1 << LDR_CORE_ID_VM3) | (1 << LDR_CORE_ID_DM3) | (1 << LDR_CORE_ID_DSP),     /* cache_enable_mask */
       (1 << LDR_CORE_ID_VM3) | (1 << LDR_CORE_ID_DM3) | (1 << LDR_CORE_ID_DSP),     /* cache_operation_mask 
                                                             */
       2                            /* shared_region_id */
      },
    
      /* Segment 4 */
      {
       1,                           /* valid */
       "DSP_ALG_HEAP",              /* name */
       0x01400000,                  /* size */
       LDR_SEGMENT_TYPE_DYNAMIC_LOCAL_HEAP,        /* seg_type */
       0,                           /* flags */
       0x98000000,                  /* system_addr */
       0x98000000,                  /* slave_virtual_addr */
       LDR_CORE_ID_DSP,             /* master_core_id */
       (1 << LDR_CORE_ID_DSP),      /* core_id_mask */
       (1 << LDR_CORE_ID_DSP),      /* cache_enable_mask */
       (1 << LDR_CORE_ID_DSP),      /* cache_operation_mask */
       -1                           /* shared_region_id */
      },
    
      /* Last Segment, Marked by valid flag to 0 */
      {
       0,
      },
    };
    
    /* End Of File */
    

    For the DSP cache configuration, I looked at the config section in the omx build, there are several .cfg files.  The one that I think is relevant is the the DspAppMain.cfg file.  This file does not pull in ti.sysbios.family.c64p.Cache.  Instead it pulls in:

    var Cache = xdc.useModule('xdc.runtime.knl.Cache');

    There are no MAR assignments here.  I poked around in the xdc folder provided but did not see an obvious config file for the cache configuration.  However, I did locate the auto-generated c files from the OMX image build and have been able to determine the MAR configurations, (below).  Reading the MAR descriptions, it looks like the 0xAB000000 section, the one that changed, is still non-cacheable, and section 0 is cacheable, which is consistent with the compilation above.

    Perhaps this isn't a caching issue, but something is causing the Ipc_attach() call in the DSP to not work consistently.  Configuration is likely the problem, just not sure what to check. I am suspicious about the 0x9A100000 section.  In the description on the instructions link, that area is marked as 0 for the DSP and 1MB shared between the Video Coprocessor controller cores.  Perhaps that is the problem?

    -Mike


    /* MAR0_31__C */
    __FAR__ const CT__ti_sysbios_family_c64p_Cache_MAR0_31 ti_sysbios_family_c64p_Cache_MAR0_31__C = (xdc_UInt32)0x10000;
    /* MAR32_63__C */
    __FAR__ const CT__ti_sysbios_family_c64p_Cache_MAR32_63 ti_sysbios_family_c64p_Cache_MAR32_63__C = (xdc_UInt32)0x0;
    /* MAR64_95__C */
    __FAR__ const CT__ti_sysbios_family_c64p_Cache_MAR64_95 ti_sysbios_family_c64p_Cache_MAR64_95__C = (xdc_UInt32)0x1;
    /* MAR96_127__C */
    __FAR__ const CT__ti_sysbios_family_c64p_Cache_MAR96_127 ti_sysbios_family_c64p_Cache_MAR96_127__C = (xdc_UInt32)0x0;
    /* MAR128_159__C -- the below math translates to 0xE2000000 */
    __FAR__ const CT__ti_sysbios_family_c64p_Cache_MAR128_159 ti_sysbios_family_c64p_Cache_MAR128_159__C = (xdc_UInt32)(-0x1dffffff - 1);
    /* MAR160_191__C -- the below math translatest to 0x80000000 */
    __FAR__ const CT__ti_sysbios_family_c64p_Cache_MAR160_191 ti_sysbios_family_c64p_Cache_MAR160_191__C = (xdc_UInt32)(-0x7fffffff - 1);
    /* MAR192_223__C */
    __FAR__ const CT__ti_sysbios_family_c64p_Cache_MAR192_223 ti_sysbios_family_c64p_Cache_MAR192_223__C = (xdc_UInt32)0x0;
    /* MAR224_255__C */
    __FAR__ const CT__ti_sysbios_family_c64p_Cache_MAR224_255 ti_sysbios_family_c64p_Cache_MAR224_255__C = (xdc_UInt32)0x0;

  • Quick update.  The CACHE flags in the memsegdef_dm81xxbm_512M.c apparently are enable flags.  I removed the DSP core from the cache enable and cache  operation masks for the IPC_SR_FRAME_BUFFERS fields as the segment is defined as non-cacheable in the DSP firmware.  No effect.