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.

PROC_load return 0x800b

Hi 

   In dmai(DVSDK 4.03), after run:

/* Load the executable on the DSP */
status = PROC_load (processorId, dspExecutable, 0, NULL);
if (DSP_FAILED (status)) {
printf ("PROC_load () failed. Status = [0x%x]\n",
(Uint16)status) ;
retVal = -1;
goto DSPmsgqClose;
}

 I got error, PROC_load  return 0x8009!  It means DSP_SDETACHED!

  What's problem about this?

 Does it need open DSP when system start?

  Thanks very much!

  • Hi,

    /* Load the executable on the DSP */


    The function is used to load the DSP executables so we need to attach the DSP before run.

    Ensure that you followed correct steps for running the DMAI apps.

    https://inmyswiki.atlassian.net/wiki/spaces/flyingpdf/pdfpageexport.action?pageId=3080199

    http://wenku.baidu.com/view/4a9173c608a1284ac8504342

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

  • Hi Tiusrathinaraj:

        Thanks very much!

        I get raw data success in DMAI. I wan to share raw data to DSP. So before get raw data I should do something:

    0042.dsp_config.c
    #if 1 //TO DSP
    	//if (processorId < MAX_PROCESSORS) {
    	/* Setup application */
    	printf ("TO DSP Init...\n");
    	status = PROC_setup (NULL);
    	if (DSP_FAILED (status)) 
    	{
    		printf("PROC_setup() failed. Status = [0x%x]\n",(Uint16)status);
    		retVal = -1;
    		goto DSPterminate;
    	}				
    		
    	/* Attach to the Dsp */
    	status = PROC_attach (processorId, NULL) ;
    	if (DSP_FAILED (status)) 
    	{
    		printf("PROC_attach () failed. Status = [0x%x]\n", (Uint16)status) ;
    		retVal = -1;
    		goto DSPdestroy;
    	}				
    
    	/* Open up the a specific pool from which to allocate buffers */
    	status = POOL_open (
    				POOL_makePoolId(processorId, APP_POOL_ID),
    					&AppPoolAttrs);
    	if (DSP_FAILED (status)) {
    		printf("POOL_open () failed. Status = [0x%x]\n",
    			(Uint16)status);
    		retVal = -1;
    		goto DSPdetach;
    	}
    
    	/* Allocate a buffer from the pool*/
    	status = POOL_alloc (POOL_makePoolId(processorId, APP_POOL_ID),
    				 (Void **) &AppDataBuf, BUFSIZE) ;
    	if (DSP_FAILED (status)) {
    		printf ("POOL_alloc () failed. Status = [0x%x]\n",
    			(Uint16)status) ;
    		retVal = -1;
    		goto DSPpoolClose;
    	} 
    
    	/* Translate buffer address to pass to DSP */
    	status = POOL_translateAddr (
    				POOL_makePoolId(processorId, APP_POOL_ID),
    				   &dspDataBuf, AddrType_Dsp, (Void *)AppDataBuf,
    				   AddrType_Usr);
    	if (DSP_FAILED (status)) {
    		printf ("POOL_translateAddr () dspDataBuf failed."
    			" Status = [0x%x]\n", (Uint16)status) ;
    		retVal = -1;
    		goto DSPpoolFree;
    	} 
    		
    	/* Open the GPP's message queue */
    	status = MSGQ_open (gppMsgqName, &gppMsgq, NULL) ;
    	if (DSP_FAILED (status)) {
    		printf ("MSGQ_open () failed. Status = [0x%x]\n",
    			(Uint16)status) ;
    		retVal = -1;
    		goto DSPpoolClose;
    	}
    
    	/* Load the executable on the DSP */
    	status = PROC_load (processorId, dspExecutable, 0, NULL);
    	if (DSP_FAILED (status)) {
    		printf ("PROC_load () failed. Status = [0x%x]\n", 
    		(Uint16)status) ;
    		retVal = -1;
    		goto DSPmsgqClose;
    	}
    
    	/* Start execution on DSP */
    	status = PROC_start (processorId) ;
    	if (DSP_FAILED (status)) {
    		printf ("PROC_start () failed. Status = [0x%x]\n",
    			(Uint16)status) ;
    		retVal = -1;
    		goto DSPmsgqClose;
    	}
    		
    	/* Open the remote transport */
     	mqtAttrs.poolId = POOL_makePoolId(processorId, APP_POOL_ID)  ;
    	status = MSGQ_transportOpen (processorId, &mqtAttrs) ;
     	if (DSP_FAILED (status)) {
    		printf ("MSGQ_transportOpen () failed. Status = [0x%x]\n",
    			(Uint16)status) ;
    		retVal = -1;
    		goto DSPstop;
    	}
    		
    	/*	Locate the DSP's message queue */
    	syncLocateAttrs.timeout = WAIT_FOREVER;
    	status = DSP_ENOTFOUND ;
    	while ((status == DSP_ENOTFOUND) || (status == DSP_ENOTREADY)) {
    		printf ("Calling MSGQ locate for DSP message\n") ;
    		status = MSGQ_locate (dspMsgqName, &dspMsgq,
    				&syncLocateAttrs) ;
    		if ((status == DSP_ENOTFOUND) || (status == DSP_ENOTREADY)) {
    			//Task_sleep(100000) ;
    			x = 100000;
    			while(x >0)
    				x --;
    			//usleep (100000) ;
    			printf ("Sleeping Waiting to locate DSP Message\n") ;
    		}
    		else if (DSP_FAILED (status)) {
    			printf ("MSGQ_locate () failed. Status = [0x%x]\n",
    				(Uint16)status) ;
    			retVal = -1;
    			goto DSPtransClose;
    		}
    	}
    	printf ("DSP message located\n") ;
    		
    	/* Register signal handler function for Ctrl C */
    	//(void) signal(SIGINT, signalHandler);
    
    #endif

       But when go into PROC_load, Fail in line:

     

    args.apiArgs.procLoadArgs.procId = procId ;
    args.apiArgs.procLoadArgs.imagePath = imagePath ;//What about this param?
    args.apiArgs.procLoadArgs.argc = argc ;
    args.apiArgs.procLoadArgs.argv = argv ;

    status = DRV_INVOKE (DRV_handle, CMD_PROC_LOAD, &args) ;
    if (DSP_FAILED (status)) {
    SET_FAILURE_REASON ;
    printf("PROC_load DRV_INVOKE\n");
    }

       What's problem? Can you help me to do this? 

       Thanks very much!

  • Hi 

      When I set correct param to PROC_load, it is ok. 

      But when PROC_start run, it will be locked at :

    DRV_INVOKE (DRV_handle, CMD_PROC_START, &args) ;

      why? thanks very much!