Yahoo Groups archive

AVR-Chat

Index last updated: 2026-04-28 22:41 UTC

Message

Still having problems debugging with AVR sudio

2005-04-12 by wbounce

I have a weird problem. 
Same code as last night
	if (strcmp("GPVTG",gcBuffer) == 0 )
		{
		gpFieldPtr = (PGM_P) VTG;
		} 

When I look at the disembler and I have
+000019AE:   E461        LDI     R22,0x41         Load immediate
---- No Source
------------------------------------------------------------------------
------------
+000019AF:   E073        LDI     R23,0x03         Load immediate
+000019B0:   ED8C        LDI     R24,0xDC         Load immediate
+000019B1:   E091        LDI     R25,0x01         Load immediate
+000019B2:   940E2119    CALL    0x00002119       Call subroutine
+000019B4:   9700        SBIW    R24,0x00         Subtract immediate
from word
+000019B5:   F431        BRNE    PC+0x07          Branch if not equal

0x0341 is the address of gcBuffer and if I look in the memory view it
has GPVTG
0x01DC should be the address of the compare string. It should be GPVTG
but it has a bunch of unicode strings that read 
Atmega128 configured 0 KT  ETTINGS / Extended Fuse. If you leave out the
0 bytes between each letter.

I looks to be like AVR Studio overwrote some of my data memory. Any
anyone seen this before?

Do I have some kind of incorrect flag on my compiles or do I need to add
one to move the data somewhere?
-------- begin --------
avr-gcc (GCC) 3.4.1

avr-gcc -c -mmcu=atmega128 -I. -gdwarf-2   -O0 -funsigned-char
-funsigned-bitfields -fpack-struct -fshort-enums -Wall
-Wstrict-prototypes -Wa,-adhlns=ParseGPSData.lst  -std=gnu99
-Wp,-M,-MP,-MT,ParseGPSData.o,-MF,.dep/ParseGPSData.o.d ParseGPSData.c
-o ParseGPSData.o 

Linking: Robot.elf
avr-gcc -mmcu=atmega128 -I. -gdwarf-2   -O0 -funsigned-char
-funsigned-bitfields -fpack-struct -fshort-enums -Wall
-Wstrict-prototypes -Wa,-adhlns=Robot.o  -std=gnu99
-Wp,-M,-MP,-MT,Robot.o,-MF,.dep/Robot.elf.d Robot.o i2c.o motor.o
ringbuf.o sonar.o uart.o logeeprom.o ParseGPSData.o compass.o
--output Robot.elf -Wl,-Map=Robot.map,--cref  -Wl,-u,vfprintf
-lprintf_min -Wl,-u,vfscanf -lscanf_min -lm

Or is there something I am supposed to do in AVR Studio 4.1

Attachments

Move to quarantaine

This moves the raw source file on disk only. The archive index is not changed automatically, so you still need to run a manual refresh afterward.