HI,
I'm trying to setup DSPLINK on GHS Integrity OS.
I moved all the code and I'm tryng to test it with the LOOP example.
I'm using:
- CCS Version: 5.5.0.00077
- C6000 Code Generation Tools: v6.1.23
- DSPLINK: 1.65.02.09
- DSP/BIOS: 5.42.01.09
DSP executable loads successfully and also the handshake but, at first attempt to transfer data , when the execution reaches:
- CHNL_reclaim on GPP side
- SIO_recalim on DSP side
both hang and i cant' go on.
Here's the code involved on GPP side:
LOOP_Execute (IN Uint32 numIterations, Uint8 processorId) { DSP_STATUS status = DSP_SOK ; Uint32 i ; LOOP_0Print ("Entered LOOP_Execute ()\n") ; /* * Start execution on DSP. */ status = PROC_start (processorId) ; /* * Fill the IO Request structure * It gives Information for adding or reclaiming an input request. */ if (DSP_SUCCEEDED (status)) { LOOP_IOReq.buffer = LOOP_Buffers [0] ; LOOP_IOReq.size = LOOP_BufferSize ; } else { LOOP_1Print ("PROC_start failed. Status = [0x%x]\n", status) ; } // LOOP_0Print ("Hit Enter to continue...\n"); //getchar(); for (i = 1 ; ( (LOOP_NumIterations == 0) || (i <= LOOP_NumIterations)) && (DSP_SUCCEEDED (status)) ; i++) { /* * Send data to DSP. * Issue 'filled' buffer to the channel. */ status = CHNL_issue (processorId, CHNL_ID_OUTPUT, &LOOP_IOReq) ; if (DSP_FAILED (status)) { LOOP_1Print ("CHNL_issue failed (output). Status = [0x%x]\n", status) ; } /* * Reclaim 'empty' buffer from the channel */ if (DSP_SUCCEEDED (status)) { status = CHNL_reclaim (processorId, CHNL_ID_OUTPUT, WAIT_FOREVER, &LOOP_IOReq) ; if (DSP_FAILED (status)) { LOOP_1Print ("CHNL_reclaim failed (output). Status = [0x%x]\n", status) ; } } /* * Receive data from DSP * Issue 'empty' buffer to the channel. */ if (DSP_SUCCEEDED (status)) { status = CHNL_issue (processorId, CHNL_ID_INPUT, &LOOP_IOReq) ; if (DSP_FAILED (status)) { LOOP_1Print ("CHNL_issue failed (input). Status = [0x%x]\n", status) ; } } /* * Reclaim 'filled' buffer from the channel */ if (DSP_SUCCEEDED (status)) { status = CHNL_reclaim (processorId, CHNL_ID_INPUT, WAIT_FOREVER, &LOOP_IOReq) ; if (DSP_FAILED (status)) { LOOP_1Print ("CHNL_reclaim failed (input). Status = [0x%x]\n", status) ; } } #if defined (VERIFY_DATA) /* * Verify correctness of data received. */ if (DSP_SUCCEEDED (status)) { status = LOOP_VerifyData (LOOP_IOReq.buffer) ; if (DSP_FAILED (status)) { LOOP_0Print ("Data integrity failed\n") ; } } #endif if (DSP_SUCCEEDED (status) && (i % 1000) == 0) { LOOP_1Print ("Transferred %ld buffers\n", i) ; } } LOOP_0Print ("Leaving LOOP_Execute ()\n") ; return status ; }
AND on DSP side:
Int TSKLOOP_execute(TSKLOOP_TransferInfo * info) { Int status = SYS_OK ; Char * buffer = info->buffers [0] ; Arg arg = 0 ; Uint32 i ; Int nmadus ; /* Execute the loop for configured number of transfers * A value of 0 in numTransfers implies infinite iterations */ for (i = 0 ; ( ((info->numTransfers == 0) || (i < info->numTransfers)) && (status == SYS_OK)) ; i++) { /* Receive a data buffer from GPP */ status = SIO_issue(info->inputStream, buffer, info->bufferSize, arg) ; if (status == SYS_OK) { nmadus = SIO_reclaim (info->inputStream, (Ptr *) &buffer, &arg) ; if (nmadus < 0) { status = -nmadus ; SET_FAILURE_REASON (status) ; } else { info->receivedSize = nmadus ; } } else { SET_FAILURE_REASON(status); } /* Do processing on this buffer */ if (status == SYS_OK) { /* Add code to process the buffer here*/ } /* Send the processed buffer back to GPP */ if (status == SYS_OK) { status = SIO_issue(info->outputStream, buffer, info->receivedSize, arg); if (status == SYS_OK) { nmadus = SIO_reclaim (info->outputStream, (Ptr *) &(buffer), &arg) ; if (nmadus < 0) { status = -nmadus ; SET_FAILURE_REASON (status) ; } } else { SET_FAILURE_REASON (status) ; } } } return status ; }
I think I'm missing something but I don't know what.
What should I check?
Thanks in advance.
Best Regards,
Giovanni Malfarà