EmbeddedRelated.com
Forums
The 2024 Embedded Online Conference

Bug found in GCC-AVR/ AVRStudio

Started by Unknown January 16, 2005
Hi,

I am using WinAVR-20040720 and AVRStudio 4.10. I have global variable
definitions in main.c. One of which is

char version[10]="1.0";

However, the version becomes "", i.e., version[0]=0 when the program is
debugged and the variable is watched.
Do anyone encounter similar problem? Thanks!

>char version[10]="1.0"; >However, the version becomes ""
This sounds more like an issue with the startup code. What happens if you declare it as const char instead?
Same problem exists. Actually I tried const char firstly, but GCC
seemed to regard it as ram data.

> I am using WinAVR-20040720 and AVRStudio 4.10. I have global variable > definitions in main.c. One of which is > > char version[10]="1.0"; > > However, the version becomes "", i.e., version[0]=0 when the program is > debugged and the variable is watched. > Do anyone encounter similar problem? Thanks! >
AVR Studio 4.11 is now released and avaialble at www.avrfreaks.net Don't know if thias will improve things though... -- Best Regards, Ulf Samuelsson. Ulf at atmel dot com These comments are intended to be my own opinion and they may, or may not be shared by my employer, Atmel Nordic AB.
Has also tried avrstudio 4.11 beta and the problem still exists.

<dereklai2k@yahoo.com.hk> wrote in message
news:1105885415.339941.41040@c13g2000cwb.googlegroups.com...
> Hi, > > I am using WinAVR-20040720 and AVRStudio 4.10. I have global variable > definitions in main.c. One of which is > > char version[10]="1.0"; > > However, the version becomes "", i.e., version[0]=0 when the program is > debugged and the variable is watched. > Do anyone encounter similar problem? Thanks!
I take it you want this variable to exist in program memory (ROM)? -- Nicholas O. Lindan, Cleveland, Ohio Consulting Engineer: Electronics; Informatics; Photonics. Remove spaces etc. to reply: n o lindan at net com dot com psst.. want to buy an f-stop timer? nolindan.com/da/fstop/
larwe@larwe.com wrote:
> > >char version[10]="1.0"; > >However, the version becomes "" > > This sounds more like an issue with the startup code. What happens > if you declare it as const char instead?
>From another thread we find that dereklai2k refuses to quote, and
also does not bother to reveal a solution when found. Thus I recommend ignoring him. -- "If you want to post a followup via groups.google.com, don't use the broken "Reply" link at the bottom of the article. Click on "show options" at the top of the article, then click on the "Reply" at the bottom of the article headers." - Keith Thompson
CBFalconer wrote:
> larwe@larwe.com wrote: > >>>char version[10]="1.0"; >>>However, the version becomes "" >> >>This sounds more like an issue with the startup code. What happens >>if you declare it as const char instead? > > >>From another thread we find that dereklai2k refuses to quote, and > also does not bother to reveal a solution when found. Thus I > recommend ignoring him. >
My vote, too for a PLONK. Let's give him an opportunity: Please post a minimal example which does not behave. Compile the code and run avr-objdump -D testfile.elf >testfile.dis and post the output. My feel is that this is an erroneous diagnosis of some other problem. ---- Please post the solution with the original header line added with '(solved)'. After pondering with a problem, we deserve to hear what was the culprit to be able to avoid it later. -- Tauno Voipio tauno voipio (at) iki fi
what if you change your code to
	char *version="1.0"
  - jim

dereklai2k@yahoo.com.hk wrote:
> Hi, > > I am using WinAVR-20040720 and AVRStudio 4.10. I have global variable > definitions in main.c. One of which is > > char version[10]="1.0"; > > However, the version becomes "", i.e., version[0]=0 when the program is > debugged and the variable is watched. > Do anyone encounter similar problem? Thanks! >
Sorry, actually I do not intend to not reveal the solution of this
thread, as the solution is my very careless mistake and does not have a
greal learning value.


The 2024 Embedded Online Conference