Hi,
I am just trying to implement perform fft of a 32 sample points using the functions from DSP Lib. I am just a beginner and I was trying it out on the code composer studio with a c6713 simulator. I have attached the code I used below. The problem is that during runtime I keep getting this error
TMS320C6713: Error: Memory Map Error: READ access by CPU to address 0x3fe6a09c, which is RESERVED in Hardware.
This error seems to occur whenever I use malloc to allocate 32 or more elements in the array x. I have allocated 0xA000 to stack and 0xA000 to heap...
#include <math.h>
#include <stdio.h>
#include <dspf_dp_cfftr2.h>
#include <stdlib.h>
/*void DSPF_sp_cfftr2_dit(float* x,float* w,int n)
{
short n2,ie,ia,i,j,k,m;
float rtemp,itemp,c,s;
n2=n;
ie=1;
for(k=n;k>1;k>>=1)
{
n2>>=1;
ia=0;
for(j=0;j<ie;j++)
{
c=w[2*j];
s=w[2*j+1];
for(i=0;i<n2;i++)
{
m=ia+n2;
rtemp=c*x[2*m]+s*x[2*m+1];
itemp=c*x[2*m+1]-s*x[2*m];
x[2*m]=x[2*ia]-rtemp;
x[2*m+1]=x[2*ia+1]-itemp;
x[2*ia]=x[2*ia]+rtemp;
x[2*ia+1]=x[2*ia+1]+itemp;
ia++;
}
ia += n2;
}
ie <<= 1;
}
}*/
void gen_w_r2(double* w, int n)
{
int i, j=1;
double pi = 4.0*atan(1.0);
double e = pi*2.0/n;
for(j=1; j < n; j <<= 1)
{
for(i=0; i < ( n>>1 ); i += j)
{
*w++ = cos(i*e);
*w++ = -sin(i*e);
}
}
}
bit_rev(double* x, int n)
{
int i, j, k;
double rtemp, itemp;
j = 0;
for(i=1; i < (n-1); i++)
{
k = n >> 1;
while(k <= j)
{
j -= k;
k >>= 1;
}
j += k;
if(i < j)
{
rtemp = x[j*2];
x[j*2] = x[i*2];
x[i*2] = rtemp;
itemp = x[j*2+1]; x[j*2+1] = x[i*2+1];
x[i*2+1] = itemp;
}
}
}
void main()
{
double w[16];
double *x;
gen_w_r2(w,16);
x = (double *)malloc(32*sizeof(double));
x[0]=1;
x[2]=2;
x[4]=3;
x[6]=4;
x[8]=5;
x[10]=6;
x[12]=7;
x[14]=8;
DSPF_dp_cfftr2(16,x,w,1);
bit_rev(x,16);
}
Any help you can provide will be helpful..
Also I this is basically my first step with DSPs but I am looking at developing an application which needs to record one second of audio and perform fft on the signal and analyse the signals to look for peaks. Do you think the c6713 is ideal for it or is anyother processor better suited.
Also I have the code for the above in matlab but i am not able to link matlab with code composer 4.4 is there anything else that I can do? If I buy a c6713 starter kit will it allow interfacing with matlab? Will it have an older version of code composer?
Thank you so much and sorry for asking so many questions...
Vivek