avr-gcc-list
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [avr-gcc-list] 4433 .data+.text sensitivity.


From: Herb Peyerl
Subject: Re: [avr-gcc-list] 4433 .data+.text sensitivity.
Date: Wed, 24 Dec 2003 08:10:13 -0700

Richard Urwin <address@hidden>  wrote:
 > I don't know the 4433, or avr-gcc, but in the interests of a quick answer:
 > 4K flash is of course 2K instructions. But the section size will be reported 
 > in bytes anyway, so that isn't likely to be the problem.

right.

 > When moving data around changes the behaviour, the problem is usually a 
 > loose 
 > pointer. So check for uninitialised variables.
 > 
 > Are you using a pointer to automatic data? eg
 > 
 > char * badpointer ()
 > {
 >      char buffer[64];
 >      return buffer;
 > }

nope. All my functions are either (void) or (int):

extern int uart_putchar(char);
extern int uart_getchar(void);
extern int spi_out(int);        
extern void print_date(void);
extern void change_date(void);

 > If you have a spare output, try setting it as the first thing in main(). If 
 > that works move it down the program until it stops working. Of course if the 
 > problem is interrupt-related things may get ill-defined, but that should 
 > give 
 > you a clue. Adding that code may well change the behaviour too.

I'll play with that.  I have an external interrupt from an RF receiver
that gives me a TXVALID interrupt when I hit a button on a keyfob but
since I can control that I don't have to worry about stray interrupts. 
I have timers totally disabled at the moment as well... I'm even polling
SPIF so there's no SPI interrupt to contend with...

Everything just seems to straight forward that the indeterminacy is
clouding my judgement.  The only thing that could possibly be 
classified as 'funky' is this global:

        #define RTC_BYTES       7
        union rtc_union {
                unsigned char rtc[RTC_BYTES];           
                struct rtc_struct {
                        unsigned char sec;      // 00 - 59
                        unsigned char min;      // 00 - 59
                        unsigned char hours;    // 00 - 23
                        unsigned char day;      // 01 - 07
                        unsigned char date;     // 01 - 31 
                        unsigned char month;    // 01 - 12
                        unsigned char year;     // 00 - 99
                } rtc_s; 
        } rtc_u;        

...but even that is fairly straight forward.  I'm not passing around
a pointer to it or anything and it should live in .bss anyway.

I'll play with a spare I/O line after xmas when I can sit down in
front of the thing in peace...

 > HTH, Merry Christmas.


reply via email to

[Prev in Thread] Current Thread [Next in Thread]