[Top][All Lists]

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

[avr-gcc-list] Re: global variables - Solved

From: Stein Haaland
Subject: [avr-gcc-list] Re: global variables - Solved
Date: Wed, 29 Sep 2004 14:04:45 +0200
User-agent: KMail/1.6.1

Eureka !

Thanks. The 'avr-objcopy -j .data ...' solved the problem.

> Do you include all needed sections when creating your binary?
> example :
> avr-objcopy -j .text -j .data -O ihex input_file output_file.hex 
> ...
> /Mikael Krus

> I think the problem is that  '  char text[] = "This is a test";  ' 
> should be initialised in a function, such as main(). 
> Alternatively, if you really want it outside a function, try something 
> like: char text[] = {"This is a test"};
> ...
> Eric Fu

It works also without the { }, and it works inside a function - I think
local variables are placed on stack, global variables in SRAM. I guess
the '... -j. data ...' took care of the latter. 

>>My problem ... definition of global variables, thus the subject.


reply via email to

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