still could not fix this problem, anyone can help....:(

Discussion created by XIANGYANG LIU on Jun 14, 2008
Latest reply on Jun 16, 2008 by CrasyCat
Hi, Dear All.  I got a very strange problem ,and still can not fix it:smileysad: , just a simple code from TI FFT code

void FFT_TI(short xy[],short n,short w[]) {
    short n1,n2,ie,ia,i,j,k,l,xt,yt,c,s;
    n2 = n;
    ie = 1;
    for (k=n; k > 1; k = (k>>1) )
        n1 = n2;    n2 = n2>>1;        ia = 0;
        for (j=0; j < n2; j++)
            c = w[2*ia]; s = w[2*ia+1]; ia = ia+ie;
            for (i=j; i < n; i = i + n1)
                /*compute Butterfly with inputs xy[i] and xy[l], twiddle factor w[ia]*/
                l = i + n2;
                xt = xy[2*l] - xy[2*i];
                xy[2*i] = xy[2*i] + xy[2*l];
                yt = xy[2*l+1] - xy[2*i+1];
                xy[2*i+1] = xy[2*i+1] + xy[2*l+1];
                xy[2*l] = (c*xt + s*yt)>>15;
                xy[2*l+1] = (c*yt - s*xt)>>15;
        ie = ie<<1;

    //print outputs
    for (j=0; j < n; j++)
    {    printf( " xy[%d]= \t", 2*j );         printf( "%d \t", xy[2*j] );
        printf( " xy[%d]= \t", 2*j+1 );        printf("%d \n", xy[2*j+1]);

everytime I tried to debug it, the Code Warrior IDE for StarCore always gives me the following error message:

scc  -r "C:\Documents and Settings\victorlxy\My Documents\FreeScale Projecs\test"  -g -ge -env "C:\Program Files\Freescale\CodeWarrior for StarCore 3.1\StarCore_Support\compiler"  -be  -arch sc3400 -c -sc -mod -O3 -cfe -I . -I- -I "..\..\..\..\..\Program Files\Freescale\CodeWarrior for StarCore 3.1\StarCore_Support\compiler\include" -I "..\..\..\..\..\Program Files\Freescale\CodeWarrior for StarCore 3.1\StarCore_Support\compiler\src\rtlib\expanded" -o "test_Data\C_for_SC_Simulator\ObjectCode\main.obj" "C:\Documents and Settings\victorlxy\My Documents\FreeScale Projecs\test\main.c"

Warning : "main.c", line 8: Warning: return value expected

Tool = MWFE | Error ID = 10184
main.c line 8  

scc -g -ge -env "C:\Program Files\Freescale\CodeWarrior for StarCore 3.1\StarCore_Support\compiler"  -be  -arch sc3400 -sc -mod -Og -O3 -Xlnk "-w" -Xlnk "-n" -o "C:\Documents and Settings\victorlxy\My Documents\FreeScale Projecs\test\project.eld" "test_Data\C_for_SC_Simulator\ObjectCode\main.obj"

Link Error   : ERROR: Non-zero return status from "C:\Program Files\Freescale\CodeWarrior for StarCore 3.1\StarCore_Support\compiler\bin\icode.exe".

Tool = SCC | Error ID = 1027

Error   : "prototype_be.obj", line -1: Error: Bad call to linear solver (build_ud_linear_combi)
 - Context: <main'_main>

Tool = ICODE | Error ID = 3401

Link Error   : link exit status = 2

but the strange thing is that when I changed the compiler settings from "Optimised For Faster Execution Speed" to "Optimized for Smaller Code Size", it will work fine, and the above error message won`t bother me anymore....

but I definitely need to set the compiler to optimize the code for faster execution speed to collect the best possible performance data/....

so anyone can help me in this regard.... thank you so much in advance....