[coldfire-gnu-discuss] save value at 0x1000090C with board 5485

Paul McConkey paul.mcconkey at cambridgeimaging.co.uk
Thu Feb 1 10:52:47 UTC 2007


Hi,

Maybe the compiler optimisations that you have set mean that some of the
code is being removed.
 
It is a good idea to make memory locations like this volatile, you could
try:
 
#define SLT_SSR0   (*(volatile unsigned long *)(void*)(0x1000090C))

If this doesn't work, please post the commands you use to compile this.
 
Cheers,
 
Paul.
 
________________________________

From: Ha Luong [mailto:haluongvn at gmail.com] 
Sent: 01 February 2007 10:38
To: coldfire-gnu-discuss at codesourcery.com
Subject: [coldfire-gnu-discuss] save value at 0x1000090C with board 5485


I run code 

int main (void)
{
 int i=0;
 SLT_SSR0=i;
 i=1;
 SLT_SSR0=i;
 printf("%lu",SLT_SSR0);
 i=2;
 SLT_SSR0=i;
 printf("%lu",SLT_SSR0); 
 i=3;
 SLT_SSR0=i;
 printf("%lu",SLT_SSR0);
 i=4;
 SLT_SSR0=i;
 printf("%lu",SLT_SSR0);

 return 0;
}

and receive 0034 . I don't know why 2 first values didn't receive 1,2 . 

Thanks for your help




More information about the coldfire-gnu-discuss mailing list