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.

Memory Map Error

Other Parts Discussed in Thread: TMDSOSKL137, TMS320C6748, TMS320C6747, OMAP-L138, CCSTUDIO

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

  • Vivek,

    The only problem with asking lots of questions in one post is that you may not get all of them answered.

    On which line does the error occur?

    If you look at the value of x right after the malloc, what do you notice about its value?

    For the 1 second of audio and the fft and the peak detection, what constraints do you think you need to consider to make a processor decision? Or, what constraints or parameters do you have in mind as requirements for the audio data and the fft and the peak detection?

    Regards,
    RandyP

  • Hi,

    Really sorry about posting so many questions. This is my first post.

    The thing is when I tried it with malloc the error occurred in the malloc line and on stepping through the assembly I found out that the error occurs under the minsert section of the assembly during excecution of malloc. So I thought it might be a problem with the dynamic allocation and tried allocating the memory during declaration using

    double x[32];

    In that case the error occurs in one of the sub functions

    void gen_w_r2(double* w, int n)                                 

              {    .                                                           

                   int i, j=1;                                                

                   double pi = 4.0*atan(1.0);    

    ........

    }

    Error   occurs at the line double pi=4*atan(1.0);

    and on stepping through the assembly I found that the error occurs under the atan function section of the assembly. 

    The error: TMS320C6713: Error:   Memory Map Error: WRITE access by CPU to address 0xfffff9b0, which is RESERVED in Hardware.  

    I am really confused because the code works without any error when I declare x to be an array of size less than or equal to  32.

    However even then the value of x keeps changing whenever a function is called.

     

    Regarding the FFT basically I am looking at keeping the cost low. But I need to sample audio at atleast 48kHz preferably upto 96kHz. I need to take a fft of the entire duration of sample that would mean nearly 44100 point fft if that is possible and would need the result to be available in less than half second at the max. Ideally I would like to display the output on a screen but if this is not possible and LED would do fine too. Do you think I should buy th 6713DSK to practice on? Also the thing is I have the code for this ready in matlab so if i can link it directly it would be ideal but if not its not a problem.

    Actually even the fft i am working on in code composer is to implement the above problem. I wanted to simulate and learn before actually going on to buy a processor.

    Any help you can provide will be helpful

    Thanks a lot(next time I will remember to post the questions as different posts and not to post all the questions in one post: thanks)

    Vivek 

  • Vivek,

    This error is almost always due to either stack overflow or an invalid memory pointer. The easiest thing to try is to increase the size of your stack. The next thing to do is to debug around the point where the failure occurs. If the stack is okay, then some pointer variable or array address argument will be incorrect. Compare the types of the arguments to the types of the value being passed.

    If you have not purchased your DSP development board, you may want to consider the C6747 or C6748 DSPs. Assuming you need floating point for your code, these floating+fixed DSPs have higher performance that the older C6713B. And I think the Starter Kits are fairly inexpensive.

    Regards,
    RandyP

  • Hi Randyp,

    Thank you so much for the input. Regarding the c6747 starter kit do you mean the OMAP L138 Experimenter like kits? They come with a display as well is it? http://focus.ti.com/docs/toolsw/folders/print/tmdsexpl138.html. If so could you provide any help regarding where I could get info about programming that device.

     

    Regarding the code I tried allocating lots of stack and heap I even tried upto 0x10000 for each but the thing is that the same error keeps occurring the weird thing is that there is no error when I use x to be of size 16 and all other 8 element array for both static or dynamic. Whereas if use x as a 32 element array and the others as 16 or more then the error keeps occurring. If I use static the error occurs within the void gen_w_r2(double* w, int n)       For dynamic function calls it occurs in the Malloc section. I am very confused I am passing only double everywhere but am still getting the error. Any help would be helpful. Sorry to ask such basic questions.

    Vivek 

  • Hi 

    I am sorry just wanted to update this. I tried running the same code on a c674x cpu cycle accurate simulator and it ran perfectly no errors.

    I tried the same thing over again using a c6747 cpu cycle accurate simulator and  I got the following error on debugging and could not even run the program.

    TMS320C64X+_0: Warning: C674x_or_EDMA: READ access  - 0x16a00  

    Does this mean something is wrong in the code or with my settings or is  the code incompatible with the c6713? I am very very confused

     

    Vivek

  • Vivek,

    The TMDSOSKL137 is a good board and costs $395, and the TMDSEXPL138 is a good board and costs $495. "How to program it" is a very open-ended question. The boards come with support software and examples, and CCSv4.2 (and above) comes with sample project templates, and the TI Wiki Pages have lots of information about using these devices, and the TI Home Page can lead you to lots of application and device documentation. You can see the TMS320C6747 and TMS320C6748 Product Folders  Both DSP devices have a similar family member ARM+DSP device which adds an ARM core to the DSP. The kits listed above may have the super-set OMAP-L13x part on it, but it can be used as if it were the C674x DSP version by ignoring the ARM core (maybe slightly more complicated than that, but not much). Either will do fine for most applications, but you may want to do some comparisons between them to decide which would be best for your application.

    Vivek Hari said:

    I tried the same thing over again using a c6747 cpu cycle accurate simulator and  I got the following error on debugging and could not even run the program.

    TMS320C64X+_0: Warning: C674x_or_EDMA: READ access  - 0x16a00

    My opinion is that you have something wrong in your code. You will have to continue debugging it to find out where the faulty address occurs.

    Regards,
    RandyP

  • Hi Randy,

    Thank you so much for the information I will debug the code and figure it out.  The TMDSEXPL138  comes with a display right? So that should be better suited for my application I think. However I just have one small doubt 

    http://focus.ti.com/dsp/docs/dspcontent.tsp?contentId=66115 This link seems to say that the TMDSEXPL138 does not have a c6748 so I was just a little confused between the EVM and EXP does the EXP have a DSP? 

    Also does is there any way to connect a display to the  TMDSOSKL137 

     

    Thank you again for all your help. I am sorry if I have been asking a few very basic questions.

     

    Vivek

  • Vivek,

    Vivek Hari said:
    The TMDSEXPL138  comes with a display right?

    I will defer to the web description on the TMDSEXPL138 Product Folder for any items that are included.

    Vivek Hari said:
    This link seems to say that the TMDSEXPL138 does not have a c6748 so I was just a little confused between the EVM and EXP does the EXP have a DSP?

    The EVM comes with two System On Module (SOM - I think that is what SOM stands for) boards, one with a C6748 and one with an OMAP-L138. You can use either on the EVM, and if you choose the C6748 SOM, then you will have none of the ARM features available. The EXP only has the OMAP-L138, which is a superset of the C6748 device. Anything you can do on the C6748, you can also do on the OMAP-L138. So it is quite reasonable to use an OMAP-L138 for development of C6748 code and applications. Just be aware of the datasheet differences so that you do not use any of the OMAP-L138 features, like the ARM processor.

    Vivek Hari said:
    Also does is there any way to connect a display to the  TMDSOSKL137

    If there is not a display included with the board, then you would have to add one on an expansion board. You can find the "Technical Documentation and Schematics" link on the TMDSOSKL137 Product Folder page. So the answer is, yes but you will have to do more work than with the TMDSEXPL138.

    Regards,
    RandyP

  • Hi,

    Thank you for all the help. I am still a little confused but I think a little reading should clear it. Thank you.

     

    Vivek

  • Vivek,

    i had the same problem you had some time ago. I believe it is a bug in CCStudio (in my case I used version 3.1) for the simulator.

    In my case I downloaded a new driver version from the emulator board manufacturer home page and it worked well.

    Recently I tried to install in another computer and the same problem occurred. This time, the driver refresh didn't work.

    Regards,

    Henrique