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.

C6748 IFFT data error and printf/LOG_printf

Other Parts Discussed in Thread: CCSTUDIO

Hi,

I am having problem with the C6747/48 dsp fft library.  I am using code generation v6.1.10 and cc v3.3.83.19

The output buffer is corrupted unless I have a printf or LOG_printf statement preceding it.

LOG_printf(" Why do I need this????\r\n");

 DSPF_sp_ifftSPxSP_c(S_256,ptrBufIn,ptr_w,ptrBufOut,brev,4,0,S_256);

I did try aligning both of my input and output data with this statement

#pragma DATA_ALIGN (ptrBufIn,2*S_256)

#pragma DATA_ALIGN (ptrBufOut,2*S_256)

But it still doesn't work.  What does the printf do to my data that help the dsp call ?

Thanks.

 

 

 

  • there should be no reason to add a dummy LOG_printf for the kernel to work. There may be some other issue that is getting masked due to the presence of the log printf.
    There is example pjt C:\CCStudio_v3.3\c674x\dsplib_v12\src\DSPF_sp_ifftSPxSP\DSPF_sp_ifftSPxSP.pjt that demonstrates usage of these APIs. You can see there is no need to do anything special like what you describe.

    How easy it is to recreate this issue? Can you provide an example pjt that we can use to see your issue on Simulator?

    Regards,
    Gagan

     

  • Kevin,

    Are you sure that it has to be a printf?  Have you tried putting some other delay in front of the IFFT function?  For instance, you could use the following to test a more generic delay:

    for (int i = 0; i < 0xFFFF; i++) asm(" nop");

    (Note the space inside the quotation marks; this is required.)

    Also, I notice that you are using the C-language version of the DSPLIB function.  That should give you the correct result, but it will be considerably slower than the optimized ASM we provide for the FFT/IFFT kernels.  The "standard" function for each kernel in the C674 DSPLIB is named DSPF_sp_<name>.  For many kernels, this function is written in C, but for others (such as fftSPxSP and ifftSPxSP) it is written in assembly.

    Hope this helps.

  • Hi Gagan & Joe,

    You are right that I do have other issues with my code that the printf some how masks it.  I found out that I did not init my IFFT input buffer properly and it corrupted the IFFT output.

    I used the c version of the IFFT library for readability for now.  The asm version is no doubt noticeably faster .

    Thanks,

    Kevin.