title: Error while running code in the TMS320C6713 DSK?
body: <p>I am trying to run the following code to implement FFT in the DSP processor whose model is mentioned above. The code is written in C Langauge</p>
  
  <pre><code>//All codes submitted by  Srivatsa Sinha
  /*Include Library Files*/
  #include &lt;stdio.h&gt;
  #include&lt;math.h&gt;
  
  /*Templates*/
  //#define ll long long
  #define cmp struct complex
  #define print_cmp(z) printf("%lf + %lfj\n",z.re,z.im)
  #define M_PI 3.14159265358979
  
  struct complex
  {
      float re;
      float im;
  }res,w,w_var,t,u;
  
  cmp signal[4];
  cmp result[4];
  int j,s,k,n,z,x,no_of_bit,rev,pow2[10],m,a;
  void calc()
  {
      pow2[0]=1;
      for(k=1; k&lt;10; k++) { pow2[k] = pow2[k-1]*2;}
  }
  
  cmp add(cmp a, cmp b)
  {
      res.re = a.re + b.re;
      res.im = a.im + b.im;
      return res;
  }
  
  cmp sub(cmp a, cmp b)
  {
      res.re = a.re - b.re;
      res.im = a.im - b.im;
      return res;
  }
  
  cmp mul(cmp a, cmp b)
  {
      res.re = a.re*b.re - a.im*b.im;
      res.im = a.re*b.im + a.im*b.re;
      return res;
  }
  
  cmp cmp_pow(cmp base, int exp)
  {
      res.re = 1.0; res.im = 0.0;
      for(a=1; a&lt;=exp; a++)
          res = mul(res,base);
      return res;
  }
  
  void bit_rev()
  {
      no_of_bit = log2(n);
      for(z=0; z&lt;n; z++)
      {
        rev = 0;
        for(x=0; x&lt;no_of_bit; x++)
        {
          if((z&gt;&gt;x)&amp;1)
          {
            rev = rev|(1&lt;&lt;(no_of_bit-1-x));
          }
        }
        result[rev] = signal[z];
      }
  }
  
  void fft()
  {
    bit_rev();
    for(s=1; s&lt;=(int)log2(n); s++)
    {
       m = pow2[s];
       w.re = (float)cos(((float)2.0*(float)M_PI)/(float)m); w.im = (float)-1.0*sin(((float)2.0*(float)M_PI)/(float)m);
       for(k=0; k&lt;n; k+=m)
       {
         w_var.re = 1; w_var.im = 0;
         for(j=0; j&lt;=(m/2 - 1); j++)
         {
           t = mul(w_var, result[k+j+(int)(m/2)]);
           u = result[k+j];
           result[k+j] = add(u,t);
           result[k+j+(int)(m/2)] = sub(u,t);
           w_var = mul(w_var, w);
         }
       }
  
    }
  }
  
  void dft()
  {
      w.re = (float)cos(((float)2.0*(float)M_PI)/(float)n); w.im = (float)-1.0*sin(((float)2.0*(float)M_PI)/(float)n);
      for(k=0; k&lt;n; k++)
      {
          result[k].re = 0.0; result[k].im = 0.0;
          for(j=0; j&lt;n; j++)
          {
              result[k] = add(result[k],mul(signal[j],cmp_pow(w,k*j)));
          }
      }
  }
  
  int main()
  {
     calc();
     printf("Enter length of the signal: ");
     scanf("%d",&amp;n);
     printf("Enter the signal sequence: \n");
     for(k=0;k&lt;n; k++)
     {
         scanf("%f",&amp;signal[k].re);
         scanf("%f",&amp;signal[k].im);
     }
     fft();
     printf("The Result of FFT is: \n");
     for(k=0; k&lt;n; k++)
     {
       print_cmp(result[k]);
     }
     dft();
     printf("The Result of DFT is: \n");
     for(k=0; k&lt;n; k++)
     {
       print_cmp(result[k]);
     }
     return 0;
  }
  </code></pre>
  
  <p>The following files are added before compilation:</p>
  
  <pre><code>hello.cmd The Linker file
  rts6700.lib The Library file
  </code></pre>
  
  <p>Although the code compiles successfully, but when built gives following error:</p>
  
  <pre><code>can't allocate .stack size 00000400 (page 0) in IRAM (avail: 000003ec)
  can't allocate .sysmem size 00000400 (page 0) in IRAM (avail: 000003ec)
  can't allocate .cio size 00000120 (page 0) in IRAM (avail: 0000010a)
  errors in input - ./Debug/FFTa.out not built 
  </code></pre>
  
  <p>Please help??</p>