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

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

Re: [avr-gcc-list] Strings getting clobbered trying to load avr-gcc out


From: E. Weddington
Subject: Re: [avr-gcc-list] Strings getting clobbered trying to load avr-gcc output .hex file into avr studio 4
Date: Fri, 17 Dec 2004 11:31:36 -0700
User-agent: Mozilla Thunderbird 0.7.3 (Windows/20040803)

James Washer wrote:

I have a line of source code:

That shows up in the .lst file as

 96                    gps_data_buffer:
 97 0000 2447 5052             .ascii  "$GPRMC,190844,A,3"
 97      4D43 2C31
 97      3930 3834
 97      342C 412C
 97      33
 98 0011 3933 302E             .string 
"930.2391,N,11947.1967,W,000.0,268.1,041204,015.6,E*6B           "
 98      3233 3931
 98      2C4E 2C31
 98      3139 3437
 98      2E31 3936
 99 0052 0000                  .skip 2,0

But after loading the .hex file into avr studio 4, I see the string has been corrupted. 
After a few bytes, it is overwritten with "P l e a s e  w a i t , L o a d i n g   p 
r o g r a m   m e m o r y" with nulls between each byte.

avr-objdump'ing the .hex files shows the string intact.

13d0 0048656c 6c6f2077 6f726c64 00244750  .Hello world.$GP
13e0 524d432c 31393038 34342c41 2c333933  RMC,190844,A,393
13f0 302e3233 39312c4e 2c313139 34372e31  0.2391,N,11947.1
1400 3936372c 572c3030 302e302c 3236382e  967,W,000.0,268.
1410 312c3034 31323034 2c303135 2e362c45  1,041204,015.6,E
1420 2a364220 20202020 20202020 20200000  *6B           ..
1430 00122000 1d020000 .. .....
So, is there something wrong with loading the hex file into avr-studio?


Below is the output from make, so that you can see just how program was compiled

set -e; avr-gcc -MM -mmcu=atmega8 -I. -g -Os -mcall-prologues -funsigned-char 
-funsigned-bitfields -fpack-struct -fshort-enums -Wall -Wstrict-prototypes 
-Wa,-adhlns=jtimers.lst  -std=gnu99 jtimers.c \
| sed 's,\(.*\)\.o[ :]*,\1.o \1.d : ,g' > jtimers.d; \
[ -s jtimers.d ] || rm -f jtimers.d
set -e; avr-gcc -MM -mmcu=atmega8 -I. -g -Os -mcall-prologues -funsigned-char 
-funsigned-bitfields -fpack-struct -fshort-enums -Wall -Wstrict-prototypes 
-Wa,-adhlns=gps.lst  -std=gnu99 gps.c \
| sed 's,\(.*\)\.o[ :]*,\1.o \1.d : ,g' > gps.d; \
[ -s gps.d ] || rm -f gps.d
set -e; avr-gcc -MM -mmcu=atmega8 -I. -g -Os -mcall-prologues -funsigned-char 
-funsigned-bitfields -fpack-struct -fshort-enums -Wall -Wstrict-prototypes 
-Wa,-adhlns=modem.lst  -std=gnu99 modem.c \
| sed 's,\(.*\)\.o[ :]*,\1.o \1.d : ,g' > modem.d; \
[ -s modem.d ] || rm -f modem.d


1. If you want to use the AVR Studio debugger, you don't load the .hex file.
2. It looks like (based on the make output snippet above) that you are using an older version of WinAVR.
3. The way to do debugging in AVR Studio is now:
- Get the latest AVR Studio 4.10, which has a new ELF/DWARF2 parser (in beta). - Get the latest WinAVR, which can create ELF files (as it normally does) with DWARF2 debugging information. Use the resulting ELF file in AVR Studio to do your debugging. See the WinAVR README file for more info on how to do this.

Also see the AVR Freaks website (www.avrfreaks.net) which has an AVR GCC Forum, where you can search for more info about debuggin with the GCC toolset. And it also has an AVR Studio 4 forum where some Atmel employees (who work on AVR Studio and this new parser) are listening.

Eric


reply via email to

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