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.

Create scalar handle for SwMs instance failed

Other Parts Discussed in Thread: SYSBIOS

Hi,

I use 8 swms instances each has 8 wins in my usecase. Each swms should be assigned a scalar handle. I useSYSTEM_SW_MS_SC_INST_VIP1_SC and SYSTEM_SW_MS_SC_INST_SC5 as the scalar, each set for 4 swms. The first 6 swms could be created successfully, but the 7th one failed when creating scalar handle for it.The following is the error massage.

[m3vpss ] 32463: SWMS: Create in progress !!!
[m3vpss ] UTILS: DMA: Allocated CH (TCC) = 30 (30)
[m3vpss ] UTILS: DMA: 0 of 1: Allocated PaRAM = 30 (0x490043C0)
[m3vpss ] SWMS: instance 0, sc id 3, start win 0 end win 7
[m3vpss ] AVSYNC:WallTime IGNORE Unexpected Discontinuity.PrevTs[32526]/CurTs[186457]
[m3vpss ] AVSYNC:WallTime IGNORE Unexpected Discontinuity.PrevTs[186457]/CurTs[191545]
[m3vpss ] 191545: Assertion @ Line: 2329 in links_m3vpss/swMs/swMsLink_drv.c: pDrvObj->fvidHandle != NULL : failed !!!

I checked the header files involved scalar(vpsdrv_m2mScPriv.h and vps_m2mSc.h) and found that each scalar instance could have 4 handles and all scalar instances could have 64 channels. The resources are enough for my requirement. I have struggled with this problem for a period of time and don't know how to resolve it. Could someone be kind enough to help me?

Thanks so much! 

  • Have you modified

    /dvr_rdk/mcfw/interfaces/link_api/swMsLink.h

     

    /** \brief Number of channels per scalar instance for 816x build */
    #ifdef TI_816X_BUILD
    /** \brief Max Number of channels per scalar instance */
        #define SYSTEM_SW_MS_MAX_WIN_PER_SC      (18)
    #endif 

    to

    /** \brief Number of channels per scalar instance for 816x build */
    #ifdef TI_816X_BUILD
    /** \brief Max Number of channels per scalar instance */
        #define SYSTEM_SW_MS_MAX_WIN_PER_SC      (8)
    #endif 

    as I mentioned previously.

  • Hi Badri,

    Thanks for your reply!

    I have modified that, and you can see the swms instance has 8 wins each from the message below:

    [m3vpss ] SWMS: instance 0, sc id 3, start win 0 end win 7

  • Do you have the ability to connect CCS + JTAG and single step thru the 7th SWMS instance FVID2_create call

  • Hi Badri,

    We have the JTAG interface, but I am afraid I don't know how to do this. Could you provide some introductions about it?

  • Do you have an emulator like spectrum digital xds560v2 and have you installed  CCS v5.3 ? Pls install CCS v5.3 and make sure you have an emulator. Connecting CCS to target is simple and I can provide the info once you are ready with the setup.

  • Hi Badri,

    I will get all these setup as soon as possible and let you know. 

  • Hi Badri,

    We don't have xds560v2, we have xds100v2 in hand. Could I use it to connect?

  • I have not tried it but it should work.

    Install CCS v5,3

     

    Make sure the JTAG head is connected to the target.

    Make sure you build VPSS M3 for debug mode by setting

        make dvr_rdk DVR_RDK_BOARD_TYPE=DM816X_UD_DVR PROFILE_m3vpss=debug

    Launch CCS

     

    Go to File -> New Target Configuration.

    Select your emulator and then select the TI816x device name.

    Save the configuration and launch the created configuration.

    You should see all the TI816x cores listed.

    Make sure you execute ./load.sh .

    You can now connecte to VPSS M3 (Cortex_M3_ISS0).

    Do Run  -> Load -> Load Symbols and select the vpss xem3.

     

    You will now be able to put breakpoint and single step the code to find exact point of failure.

  • Hi Badri,

    Thanks for your guide. I will have a try and let you know.

  • Hi Badri,

    I tried to connect the board to CCS5.3 but failed. I have some issues to be confirmed with you.

    1. Should I create a CCS project or C/C++ project?

    2.Should I launch CCS first or  power the board first?

    Thanks!

  • bing liu said:
    1. Should I create a CCS project or C/C++ project?

    No it is not required to create CCS project

     

    bing liu said:
    2.Should I launch CCS first or  power the board first? 

    You should power on the board first.You should launch CCS and connect to VPSS M3 after ./load.sh execution is completed.

     

  • Hi Badri,

    I read the wiki http://processors.wiki.ti.com/index.php/Linux_Debug_in_CCSv5, I don't know which mode should I use. I tried as follows:

    1.Create a CCS project with main.c

    2.Create the configuration file, choose the emulator as xds100v2 and the board as DM8168.

    3. Connect the emulator to the board and power on the board.

    4. Press the "Test Connect" button 

    But error occurs. I attach the log in the end. It seems something wrong with the driver of xds100v2. But It is said that the driver is inside CCS.

    [Start]
    
    Execute the command:
    
    %ccs_base%/common/uscif/dbgjtag -f %boarddatafile% -rv -o -F inform,logfile=yes -S pathlength -S integrity
    
    [Result]
    
    
    -----[Print the board config pathname(s)]------------------------------------
    
    /home/dm8168/.TI/1553742935/0/0/BrdDat/testBoard.dat
    
    -----[Print the reset-command software log-file]-----------------------------
    
    This utility has selected a 100- or 510-class product.
    This utility will load the adapter 'libjioserdesusb.so'.
    
    An error occurred while soft opening the controller.
    
    -----[An error has occurred and this utility has aborted]--------------------
    
    This error is generated by TI's USCIF driver or utilities.
    
    The value is '-151' (0xffffff69).
    The title is 'SC_ERR_FTDI_OPEN'.
    
    The explanation is:
    One of the FTDI driver functions used during
    the connect returned bad status or an error.
    The cause may one or more of: invalid emulator serial number,
    blank emulator EEPROM, missing FTDI drivers, faulty USB cable.
    Use the xds100serial command-line utility in the 'common/uscif'
    folder to verify the emulator can be located.
    
    [End]
    

  • I see you have already posted in CCS forum which is the correct forum where ppl can resolve this issue. Pls update your post in CCS forum with additional details:

    1.Mention the emulator used XDS100,

    2. Attach the ccxml target configuration

    3.Attach the logs you have attached to this post.

    4. I am sure you don't have to create a CCS project. Mention in your post that you just need to connect to the target ,load symbols and debug .

    The CCS team should be able to help you resolve the issue.

  • Hi Badri,

    Now I could connect to Cotex-A8 and DSP cores. But I don't know how to load the symbols. I will modify the post in CCS forum. After that I will need your help on how to debug the programs.

    Thanks 

  • Hi Badri,

    I think the board connect problem is solved. Now we could start to do the app debug. I find that when choose Run->Load->Load Symbols it requires to assign the executable binary. In my case it should be dvr_rdk_demo_mcfw_api.out. I don't know if we should build and gerenate dvr_rdk_demo_mcfw_api.out in CCS or use the one that already exists. And if we have to build it in CCS, then how to do it? Create a new project, add all the files and build?

  • You don't need to build in CCS.

    After executing load.sh, You should launch target , connect to CortexM3_ISS0 and do load symbols of the

    /dvr_rdk/build/dvr_rdk/bin/ti816x-evm/dvr_rdk_m3vpss_*.xem3

     

  • Hi Badri,

    Thanks for your reply!

    You said that I don't need to build it in CCS, then I still need to create a C project use the exist codes in /DVR_RDK3.5/dvr_rdk with makefile, do I?  

    My post in the Code Composer Forum gets no reply. I found a post at http://e2e.ti.com/support/development_tools/code_composer_studio/f/81/t/196928.aspx which said that using TI814x configuration file the M3 core could be connected. But I could not find the TI814x or TI816x type when choose the board in the configuration file. Could you have the ccxml file for DM8168 in hand?

  • bing liu said:
    You said that I don't need to build it in CCS, then I still need to create a C project use the exist codes in /DVR_RDK3.5/dvr_rdk with makefile, do I?  

    - No you need not create any project .Project is only for building. If you only use CCS for debugging you don't need to create any project.

    The ccxml I have is for XDS560v2.It is not useful for you. Are you not seeing an option for TI816x device for xds100 ? Can you confirm you are using latest CCS v5.3 ?

    I am attaching a target ccxml for TIXDS100v2 target configuration that I created with CS v5.3. I have no way of testing it but it does show the ISS M3.

    8666.TI816x_xds100.zip

  • Hi Badri,

    I use the lastest CCS v5.3 for sure. Do you mean that I just need to create a configuration file? I will try with the ccxml file you provided and let you know.

  • Hi Badri,

    I have tried with your ccxml file. If I choose import configuration file and choose "TI816x_xds100.ccxml", I get the error as below when launching it.

    If I create a new configuration file and copy the contents of "TI816x_xds100.ccxml" to it, I get the error as below when launching it.

    And, I could not see TI816x device when choosing xds100v2, I just could find DM8168 and EVMDM8168.

    I wonder if it is something wrong with the CCS5.3. I choose the free license after install. Should I choose the 90 days license instead?

  • Hi Badri,

    Thanks to your advance now I could connect to CortexM3_ISS and load symbols successfully. After load symbols CCS shows a window below. Then how could I start to debug the applications? Should I run the app on the board? It seems that the board could not be reached since it is connected to CCS.

    Thanks so much! I think we are about to solve the swms problem.

  • Once you have connected to target

    1.Set breakpoint in SwMsLink_drvCreate function

    2.do Run -> Resume. This will start running the VPSS M3.

    3. Then run your application as usual from A8 console.

    Breakpoint will be hit for SwMsLink_drvCreate function. You can keep doing Run -> Resume until the 7th time (assuming 7th instance is failing).You can then single step into the FVID2_create call to find out where it is exactly failing.

  • Hi Badri,

    I could not find the SwMsLink_drvCreate function in CCS. The following is the situation after load symbols. It shows that there is something wrong with 0xD2A60B04(no symbols are defined for 0xD2A60B04). I wonder if I should set the code offset and data offset when loading symbols.


  • You don't have to set code offset.After loading symbols do View -> Breakpoints. Then in the breakpoint window see the blue circle for new breakpoint and set breakpoint to SwMsLink_drvCreate

  • Hi Badri,

    I debug the app and find the error occurs in secCheckFormat function in vpscore_secPath.c. The following is the debug procedure:

    drvHandle = drv->drvOps->create()        fvid2_drvMgr.c   Line 576     function FVID2_create

                                   |

    retVal = vpsMdrvScSetChPrms()            vpsdrv_m2mSc.c   Line 2549     function  vpsMdrvScOpenCores

                                   |

    if (FVID2_DF_YUV420SP_UV == coreFmt->fmt.dataFormat)      vpscore_secPath.c   Line 1456      function secCheckFormat

    The app breakdown and give the msg "Assertion @ Line: 647 in core/src/vpscore_secPath.c: (NULL != instObj) : failed !!!".

    In addition, in the secCheckFormat function, the coreFmt->fmt.dataFormat could not match any of the FVID2 type FVID2_DF_YUV422I_YUYV, FVID2_DF_YUV420SP_UV or FVID2_DF_YUV422SP_UV. I check the coreFmt->fmt of the 6th swms and  7th swms both for the first channel. 

    6th: coreFmt->fmt->width=320 coreFmt->fmt->width=240  coreFmt->fmt->dataFormat=7(FVID2_DF_YUV420SP_UV)

    7th: all of the above are 0

    It is incomprehensible as the params of swms are all the same for the 8 swms instances. Could you find something unusal from the debug information?

  • .Check the swmsCreateParams for the 7th swms instance in CCS "Expression" window and check if they are matching what you are passing in your application. Is they are mismatching this could be due to stack overflow on the A8 side  .The swmsPrm structures are large and having 8 instances may cause stack to overflow causing bad parameters to be sent to swms link. In your function MultiCh_createVdecVmosaicVenc can you make all CreateParams global instead of local variables so that they are not allocated from stack/.

     

  • Hi Badri,

    I check the SwMsLink_CreateParam values at SwMsLink_drvCreate function. The 7th swms params are right just the same as the first 6 ones.

  • I was able to recreate the issue on my setup and debug it. The 7th instance failure is due to Maximum output queue of a link being defined to 6. To fix this change

    /dvr_rdk/mcfw/interfaces/link_api/system_const.h

    #define SYSTEM_MAX_OUT_QUE              (8u)

    There are a number of other issues with your usecase such as wrong notify values being set etc. Attached are the total patch set for all the issues.After these changes I see decode -> encode happening successfully.

    Pls compare with your codebase and merge in the patches.

     

    4452.mcu.zip

  • Hi Badri,

    Thanks for your reply! I modified the SYSTEM_MAX_OUT_QUE to 8 and do make -s all. I got the error below when creating dvr_rdk_c6xdsp_debug_1024M_256M.xe674.

    # Configuro done!
    # Making ti816x-evm:c6xdsp:debug:dvr_rdk_bios6...
    # Compiling ti816x-evm:c6xdsp:debug:dvr_rdk: src/main_c6xdsp.c
    # Compiling generated MAIN_APP_c6xdsp_pe674.oe674
    # Linking into /usr/local/DVRRDK_03.50.00.05/dvr_rdk/../dvr_rdk/build/dvr_rdk/bin/ti816x-evm/dvr_rdk_c6xdsp_debug_1024M_256M.xe674...
    #
    "/usr/local/DVRRDK_03.50.00.05/dvr_rdk/../dvr_rdk/build/dvr_rdk/obj/ti816x-evm/c6xdsp/debug/dvr_rdk_configuro/linker_mod.cmd", line 255: error #10099-D:
    run placement fails for object ".bss:taskStackSection", size 0xa6155 (page
    0). Available ranges:
    DDR3_DSP size: 0xde1000 unused: 0x3e08 max hole: 0x3e00
    "/usr/local/DVRRDK_03.50.00.05/dvr_rdk/../dvr_rdk/build/dvr_rdk/obj/ti816x-evm/c6xdsp/debug/dvr_rdk_configuro/linker_mod.cmd", line 241: error #10099-D:
    placement fails for object ".const", size 0x216da (page 0). Available
    ranges:
    DDR3_DSP size: 0xde1000 unused: 0x8 max hole: 0x4
    "/usr/local/DVRRDK_03.50.00.05/dvr_rdk/../dvr_rdk/build/dvr_rdk/obj/ti816x-evm/c6xdsp/debug/dvr_rdk_configuro/linker_mod.cmd", line 243: error #10099-D:
    placement fails for object ".fardata", size 0x30af (page 0). Available
    ranges:
    DDR3_DSP size: 0xde1000 unused: 0x8 max hole: 0x4
    "/usr/local/DVRRDK_03.50.00.05/dvr_rdk/../dvr_rdk/build/dvr_rdk/obj/ti816x-evm/c6xdsp/debug/dvr_rdk_configuro/linker_mod.cmd", line 231: error #10099-D:
    run placement fails for object ".stack", size 0x4000 (page 0). Available
    ranges:
    DDR3_DSP size: 0xde1000 unused: 0x8 max hole: 0x4
    "/usr/local/DVRRDK_03.50.00.05/dvr_rdk/../dvr_rdk/build/dvr_rdk/obj/ti816x-evm/c6xdsp/debug/dvr_rdk_configuro/linker_mod.cmd", line 252: error #10099-D:
    placement fails for object ".vecs", size 0x5ff (page 0). Available ranges:

    DDR3_DSP size: 0xde1000 unused: 0x8 max hole: 0x4
    "/usr/local/DVRRDK_03.50.00.05/dvr_rdk/../dvr_rdk/build/dvr_rdk/obj/ti816x-evm/c6xdsp/debug/dvr_rdk_configuro/linker_mod.cmd", line 256: error #10099-D:
    placement fails for object "ti_sdo_ipc_init", size 0x44b (page 0).
    Available ranges:
    DDR3_DSP size: 0xde1000 unused: 0x8 max hole: 0x4
    "/usr/local/DVRRDK_03.50.00.05/dvr_rdk/../dvr_rdk/build/dvr_rdk/obj/ti816x-evm/c6xdsp/debug/dvr_rdk_configuro/linker_mod.cmd", line 248: error #10099-D:
    placement fails for object ".cio", size 0x3c2 (page 0). Available ranges:
    DDR3_DSP size: 0xde1000 unused: 0x8 max hole: 0x4
    "/usr/local/DVRRDK_03.50.00.05/dvr_rdk/../dvr_rdk/build/dvr_rdk/obj/ti816x-evm/c6xdsp/debug/dvr_rdk_configuro/linker_mod.cmd", line 244: error #10099-D:
    placement fails for object ".switch", size 0x3bc (page 0). Available
    ranges:
    DDR3_DSP size: 0xde1000 unused: 0x8 max hole: 0x4
    "/usr/local/DVRRDK_03.50.00.05/dvr_rdk/../dvr_rdk/build/dvr_rdk/obj/ti816x-evm/c6xdsp/debug/dvr_rdk_configuro/linker_mod.cmd", line 232: error #10099-D:
    placement fails for object "GROUP_1", size 0x148 (page 0). Available
    ranges:
    DDR3_DSP size: 0xde1000 unused: 0x8 max hole: 0x4
    warning #10063-D: entry-point symbol other than "_c_int00" specified:
    "ti_sysbios_family_c64p_Hwi0"
    error #10010: errors encountered during linking;
    "/usr/local/DVRRDK_03.50.00.05/dvr_rdk/../dvr_rdk/build/dvr_rdk/bin/ti816x-e
    vm/dvr_rdk_c6xdsp_debug_1024M_256M.xe674" not built
    make[2]: *** [/usr/local/DVRRDK_03.50.00.05/dvr_rdk/../dvr_rdk/build/dvr_rdk/bin/ti816x-evm/dvr_rdk_c6xdsp_debug_1024M_256M.xe674] 错误 1
    make[1]: *** [apps] 错误 2
    make: *** [dvr_rdk_bios6] 错误 2

    Besides the changes you list in the patch file. I also do the following changes:

    1./dvr_rdk/mcfw/interfaces/link_api/swMsLink.h

    #define SYSTEM_SW_MS_MAX_INST                (8)

    #define SYSTEM_SW_MS_MAX_WIN_PER_SC      (8)

    2./dvr_rdk/mcfw/interfaces/link_api/system_linkId.h

    #define SYSTEM_LINK_ID_SW_MS_END (SYSTEM_LINK_ID_SW_MS_MULTI_INST_7)
    #define SYSTEM_LINK_ID_SW_MS_COUNT (SYSTEM_LINK_ID_SW_MS_END - \
                                                                                       SYSTEM_LINK_ID_SW_MS_START) + 1

    3./dvr_rdk/mcfw/src_bios6/cfg/ti816x/config_1G_256MLinux.bld

    SR1_SIZE                                = 200*MB;//202

    VIDEO_M3_BSS_SIZE          = 12*MB  + 512*KB;//10

    I think there is something wrong with the memory map.

  • In addition, before this new build  what I changed is just set SYSTEM_MAX_OUT_QUE to 8. All the other changes were done before and if remain the SYSTEM_MAX_OUT_QUE to 6, there is no problem with building.

  • You will have to increase the data section of DSP and M3. Reduce SR1 by 6MB and increase each VIDEO M3/VPSS M3 and DSP by 2 MB each.

    Change

    /dvr_rdk/mcfw/src_bios6/cfg/ti816x/config_1G_256MLinux.bld

    SR1_SIZE = 201*MB - 6 *MB;

    And increase

    VIDEO_M3_BSS_SIZE by 2*MB

    DSS_M3_BSS_SIZE by 2*MB

    DSP_DATA_SIZE by  2*MB

     

     

  • Hi Badri,

    Thanks so much! I find in the dsp.map file that the DDR3_DSP is used up. It is corresponding to DSS_M3_BSS_SIZE in memory map. So, I increase the  DSS_M3_BSS_SIZE by 2MB just as what you say. Now the building is successful. I will run the demo and let you know.

  • Hi Badri,

    I am sorry to tell you that the app still has problem when running. When I choose "b" in the run-time menu to print the buffer status. The app hug hang after print the swms instance buffer status. I attach the log file and you could have a look. It seems the swms instances did not receive date from the previous instance.7774.logm3.txt

  • In addition, If I just use 6 channels everything is alright. I check the DEC FPS and find that in 8 channels case the FPS is abnormal. Maybe the some kind of system resources are not enough? The differences between 6 channels and 8 channels are just the number of instances and input/output channels. All the params for each instances and channels are just the same.

    And in the usecase file you offered I find

    ipcBitsOutHostPrm.maxQueueDepth[i] =  MAX_BUFFERING_QUEUE_LEN_PER_CH;

    But the IpcBitsOutLinkHLOS_CreateParams does not has maxQueueDepth option.

  • Hi Badri,

    I test 8 DEC channels, 7 swms instances, 7 ENC channels. The app runs fine. Now the differences is just 1 swms instances and 1 encode channel.

  • Hi Badri,

    Could you see my reply? We are almost to solve the swms problem. There is just a little trick left. So could you be kindly enough to see the issue and help me to solve the problem? 
    Thank you so much!
  • As it is working at my end I don't know why it isn't working for you. I would suggest you carefully merge in all my changes. One thing is you are not assigning the IVA channel map correctly.Current all decode and encode are going to IVA0. You should have 8  decodes in IVA0, 4 encodes in IVA1 and 4 encodes in IVA2 to balance the load.Also check by doing Vsys_printDetailedStatistics and Vsys_printBufferStatistics why the usecase in not working at your end.

  • Hi Badri,

    Thanks for your reply! Sorry for trouble you so much! I will check my codes carefully and set the IVA channel map as you said to see the result.

  • Hi Badri,

    I set the IVA channel map as what you said and now the 8 channel demo runs OK. But when I choose "e" in the Run-Time Menu to stop the demo there is an error when delete the dec link. The error msg is as follows:

    [m3video] 107283:ERR::linkID:10000022::channelID:-1::errorCode:-10::FileName:links_m3video/iva_dec/decLink_common.c::linuNum:155::errorCondition:(Utils_queIsFull(&pObj->dupObj.dupQue) == TRUE)

    It occurs in DecLink_codecDeleteDupObj() function. It seems that the dupQue is not empty before delete it. What is the DupObj of DecLink used for? Shall I comment the creat and delete function for DupObj?

  • You can ignore this error msg.It will not cause any issue. Don't comment out any code. The warning indicates that the link after decLink didn't free back all the buffers when decLink was deleted. This is expected .

  • Hi Badri,

    Thanks so much! You really help me a lot. With your help we finally manage to run the 8 channel demo successfully. As I need to bring audio into the demo, Maybe I will need your help in the future. Thanks again!