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.

C6416: a problem of pointer

Hello,

A friend told me his problem of using pointer in DSP6416 and I don’t know how to fix it.

The code is listed below:

 

pixel=(unsigned char*)0x00025000;

ssat=(unsigned int*)0x00090000;

ssat[0]=pixel[0]*pixel[0];

for (i=1;i<320;i++)

{           

       ssat[i]=ssat[i-1]+pixel[i]*pixel[i];

       ssat[i*320]=ssat[(i-1)*320]+pixel[i*320]*pixel[i*320];

}

for (i=1;i<240;i++)

{

       for (j=1;j<320;j++)

       {                   ssat[i*320+j]=ssat[i*320+j-1]+ssat[(i-1)*320+j]+pixel[i*320+j]*pixel[i*320+j]-ssat[(i-1)*320+j-1];       }

}

The error is that Trouble running Target CPU: Error 0x0000000C/-2044 Error during: Register, Break Point,  No breakpoint at 0x00000000.

Error: Error 0x0000000C/-2044 Error during: Register, Break Point,  No breakpoint at 0x00000000.

He used the CCS2.2 and CCS3.3 to compile the code, but met the same problem.

So thanks for your reply.

  • Start by finding out which line is being executed when the problem happens. Then break the complex line into multiple assignments, or look at the indexes to figure out which reference is going to an invalid place.

    Your friend might benefit by moving to CCSv5, but that may not be practical. CCS 3.3 is definitely useful for debug. It does not recover from errors quite as well, but I have been trying to debug my own CCS-crash problem on CCSv5, so it happens there, too, occasionally.

    Regards,
    RandyP

  • Your are using pretty large data buffers. You must be sure to not exceed available memory. As we don't know details about the project configuration, its hard to judge if that is OK.

  • Hello,

    He told me that the memory used by the program is all available. He breaks the code into two ‘for’ circles and he runs every single ‘for’ circle to see the result.

    If it runs the first ‘for’ circle, the result is right.

     

    pixel=(unsigned char*)0x00025000;

    ssat=(unsigned int*)0x00090000;

    ssat[0]=pixel[0]*pixel[0];

    for (i=1;i<320;i++)

    {           

           ssat[i]=ssat[i-1]+pixel[i]*pixel[i];

           ssat[i*320]=ssat[(i-1)*320]+pixel[i*320]*pixel[i*320];

    }

     

    If it runs the second for circle, the result is ok.

     

    pixel=(unsigned char*)0x00025000;

    ssat=(unsigned int*)0x00090000;

    ssat[0]=pixel[0]*pixel[0];

    for (i=1;i<240;i++)

    {

    for (j=1;j<320;j++)

    {                  

    ssat[i*320+j]=

    ssat[i*320+j-1]+ssat[(i-1)*320+j]+pixel[i*320+j]*pixel[i*320+j]-ssat[(i-1)*320+j-1];}

    }

     

    But if it runs the two for circle together, the error comes out.

    pixel=(unsigned char*)0x00025000;

    ssat=(unsigned int*)0x00090000;

    ssat[0]=pixel[0]*pixel[0];

    for (i=1;i<320;i++)

    {           

           ssat[i]=ssat[i-1]+pixel[i]*pixel[i];

           ssat[i*320]=ssat[(i-1)*320]+pixel[i*320]*pixel[i*320];

    }

    for (i=1;i<240;i++)

    {

    for (j=1;j<320;j++)

    {                  

    ssat[i*320+j]=

    ssat[i*320+j-1]+ssat[(i-1)*320+j]+pixel[i*320+j]*pixel[i*320+j]-ssat[(i-1)*320+j-1];}

    }

    The error is that Trouble running Target CPU: Error 0x0000000C/-2044 Error during: Register, Break Point,  No breakpoint at 0x00000000.

    Error: Error 0x0000000C/-2044 Error during: Register, Break Point,  No breakpoint at 0x00000000.

     

    Thanks for your reply.

  • I met this kind of problem before and usually it happened when there was buffer overrun. If your friend does not mind to share his project, I can take a look at my place.

  • Hello,

    Thanks for your help. Here is his program and He uses the CCS2.2 to compile the program.

    6558.FaceDetect_Test1.rar

  • Hello,

    I compiled provided project, loaded to my C6416 based machine, set breakpoint at the closing brace of main(), then run. Executed without any errors, no unexpected behaviour at all. If I let it run to exit, still its fine, it jumps to disassembly location labelled as "abort, C$$EXIT:" and stops.  I used CCS 3.3 with CGT 6.0.8. If same code does not work for your friend, I don't know what to think.

  • Hello,

    When I run the program, I meet this problem:

    Trouble running Target CPU: Error 0x0000000C/-2044 Error during: Register, Break Point,  No breakpoint at 0x00000000

    Error: Error 0x0000000C/-2044 Error during: Register, Break Point,  No breakpoint at 0x00000000

    The Program is very short and simple:

     

    #include "intr.h"

    #include "declare.h"

     

    int main()

    {

           int i=0;

           int j=0;

          

           unsigned int origWindowSize_height=20;

           unsigned int origWindowSize_width=20;

          

           unsigned int min_neighbors=2;

           float scale_factor=1.1;

          

           unsigned int detRegion_x=1;

           unsigned int detRegion_y=1;

           unsigned int detRegion_height=240;

           unsigned int detRegion_width=320;

          

           unsigned int min_size_width=20;

           unsigned int min_size_height=20;

          

           float factor=1.0;

          

           unsigned int max_size_width=256;

           unsigned int max_size_height=192;

          

           unsigned int iMaxSize=192;

           float WindowSize=0.0;

          

           unsigned int win_size_width=0;

        unsigned int win_size_height=0;

           float ystep=0.0;

          

           unsigned int realWindowSize_width=0;

           unsigned int realWindowSize_height=0;

          

           float weight_scale=0.0;

           float invWindowArea=0.0;

          

           unsigned int stop_width=0;

        unsigned int stop_height=0;

          

           WindowSize=factor*20.0;

          

           while (WindowSize<iMaxSize)

           {

                  if(factor>2)

                  {

                         ystep=factor;

                  }

                  else

                  {

                         ystep=2;

                  }

                 

                  /*if(win_size_width<min_size_width||win_size_height<min_size_height)

                  {

                 continue;

                  }*/

                 

               realWindowSize_width=origWindowSize_width*factor;

                  realWindowSize_height=origWindowSize_height*factor;

                 

                  weight_scale=1/(factor*factor);

                  invWindowArea=1.0/(realWindowSize_width*realWindowSize_height);         

                  factor=factor*scale_factor;

                  WindowSize=factor*20.0;

           }

          

    }

     

    When I remove “invWindowArea=1.0/(realWindowSize_width*realWindowSize_height)”,the program can run well, but when I add this code and the error comes out.

    6378.FaceDetect_Test_test0526.rar

  • Hello,

    I've tried last attached project with both invWindowArea... commented and enabled. In both cases works perfect for me: I can reach closing brace of the main(), on exit it goes to disassembly location labelled as "abort, C$$EXIT:". Mine is CCS3.3 with CGY 6.0.8, chip is C6416, emulator is BlackHawk-560. I think your trouble is not related with code itself, but its hard for me to suggest a test. Can you run any other project?