Sign in

username:

password:



Not a member?

Search c55x



Search tips

Subscribe to c55x



c55x by Keywords

AIC23 | C5509 | CCS | CSL | EMIF | EVM | GEL | GPIO | HPI | Interfacing | JTAG | McBSP | OMAP | Omap15 | OMAP59 | RTDX | SDRAM | TMS320VC5509 | USB | XDS5

Ads

Discussion Groups

Discussion Groups | TMS320C55x | Variables not working

Technical discussions about the TI C55x DSPs (including the c5501, c5502, c5503, c5507, c5509, c5510 and OMAP5910).

  

Post a new Thread

Variables not working - joe_...@yahoo.com - Sep 26 9:06:34 2006



I wrote a very simple C program in Code Composer Studio 3.1 (CCS).  No errors resulted
from compiling the following code, yet when I single step through this code the variable watch
window indicates that none of the variables shown in this code actually get assigned moreover
the loop does not function properly.

void main(){

int c=3428;
int x=2;
int a=0;
int n=3;

c=786;

for (c=0;c<=n;c++){};

*(unsigned volatile int *)0x300000 = 0xffff;  
}

I have no idea why this would happen and can only guess that I need to set up the compiler in
some way.  

The only other file being used or linked (aside from the above C code) is a run time support
library file called "rts55x.lib" 

Does anyone have any suggestions on what I should check with regards to troubleshooting this
problem?



(You need to be a member of c55x -- send a blank email to c55x-subscribe@yahoogroups.com )

Re: Variables not working - Jeff Brower - Sep 26 13:07:08 2006

Joe-

> I wrote a very simple C program in Code Composer Studio 3.1 (CCS).  No errors
> resulted from compiling the following code, yet when I single step through
> this code the variable watch window indicates that none of the variables shown
> in this code actually get assigned moreover the loop does not function properly.
> 
> void main(){
> 
> int c=3428;
> int x=2;
> int a=0;
> int n=3;
> 
> c=786;
> 
> for (c=0;c<=n;c++){};
> 
> *(unsigned volatile int *)0x300000 = 0xffff;
> }
> 
> I have no idea why this would happen and can only guess that I need to set up the compiler
in some way.

Suggest to try this way:

  int c, x, a, n;
  volatile int i;

  void main(){

  c=3428;
  x=2;
  a=0;
  n=3;

  c=786;

  for (c=0; c<=n; c++) {

    i++; /* put something here to make it easier to single step */
  };

  *(unsigned volatile int *)0x300000 = c;  /* use value of c */

If you create temporary variables (e.g. stack or register) then using a memory watch
window during single-step is not valid.  They need to be in memory.  As for the loop,
why would the compiler bother with a null loop?  You don't do anything with the
variable c -- either during the loop or after -- so why would you worry whether the
loop executes or not?

-Jeff



(You need to be a member of c55x -- send a blank email to c55x-subscribe@yahoogroups.com )