>From the help of AVR studio
-- quote
Sometimes you may experience problems when loading AVR Studio 4
projects. Close AVR Studio and remove the project file (.aps). Then
startup AVR Studio and try again by creating a new project.
Usually the initialized EEPROM data or SRAM is automatically uploaded to
the EEPROM memory of the debug platform after a user confirmation. If
this does not happen, you can do this manually by selecting 'Up/Download
memories' after loading the project.
-- end of quote.
This last part sort of sound like what is happening. This should be
initialized SRAM and the data is just not there. However using the menu
selection listed in the help does not yield any better results. The
options on the menu item are memory type which default to data with a
size of 4096 and a start address of 0x100. then it asks for a file
accepting either a .hex or a .eep
Has anyone had any experience with this?
-----Original Message-----
From: wbounce [mailto:wbounce@safeplace.net]
Sent: Monday, February 07, 2005 7:58 PM
To: AVR-Chat@yahoogroups.com
Subject: RE: [AVR-Chat] Having trouble debugging a piece of code.
First,
volatile const uint8_t * TargetPointer; is declared that way because
unless I added the const gcc complains
I think what I am supposed to be doing there is declaring TargetPointer
to be a pointer to a constant unsigned byte (ie uint8_t) The array Room1
is an array of constant uint8_t
Second switch (Room1[0]) would always to the same thing. Since Room1[0]
would never change. Where as TargetPointer is supposed to be assigned
the address of the 1st byte of the array Room1 later in the code
TargetPointer is incremented and basically walks the array.
The problem is not with the code but the debugger. I can see that
TargetPointer get assigned the address of Room1 like it should but the
array Room1 does not contain the byte sequence that it should.
-----Original Message-----
From: Jose Fuentes [mailto:josecarlosfuentes@yahoo.com.ar]
Sent: Monday, February 07, 2005 10:06 AM
To: AVR-Chat@yahoogroups.com
Subject: Re: [AVR-Chat] Having trouble debugging a piece of code.
Some comments:
//why do you declare TargetPointer as const?
volatile const uint8_t * TargetPointer;
//try this instead of using TempPointer, TargetPointer
switch (Room1[0])
//also, don't forget the 'break' sentence after
//every case block
Regards
Jose
--- wbounce <wbounce@safeplace.net> escribió:
>
> I am having trouble debugging a piece of code that
> used to work. I using
> avr-gcc (GCC) 3.4.1 with AVR Studio 4.10.356 as my
> debugging tool
> dwarf-2. I have the following code which is not
> working. The listing
> shows Room1 as it should but in AVR Sutdio it does
> not show up correctly
> and hence my switch code fails. What actually shows
> in the Room1 array
> varies greatly. Something it looks like all 0s
> sometimes it looks like
> wide characters ie a letter followed by a 0. what am
> I doing wrong. I
> know I had this code working fine a couple of weeks
> ago before my
> Hbridge problems. I had single stepped through all
> of it and then
> pointer was working fine.
>
> volatile const uint8_t * TargetPointer;
>
> #define TARGET_FLFLB 25
> #define TARGET_LFLB 24
> #define ACTION_STRAIGHT 70
> #define ACTION_TURNRIGHT 65
> #define ACTION_STOP 68
>
> const uint8_t Room1[] ={
> ACTION_STRAIGHT,
> TARGET_FLFLB,
> ACTION_TURNRIGHT,
> TARGET_LFLB,
> ACTION_STOP,
> };
>
> uint8_t TempPointer;
>
> TargetPointer = &Room1[0];
> TempPointer = *TargetPointer;
> switch (TempPointer)
> do code based on action
>
>
> --listing
> 17 .Ltext0:
> 18 .global Room1
> 19 .data
> 22 Room1:
> 23 0000 46 .byte 70
> 24 0001 19 .byte 25
> 25 0002 41 .byte 65
> 26 0003 18 .byte 24
> 27 0004 4A .byte 68
>
>
>
>
> Yahoo! Groups Links
>
>
> AVR-Chat-unsubscribe@yahoogroups.com
>
>
>
>
>
>
___________________________________________________________
250MB gratis, Antivirus y Antispam
Correo Yahoo!, el mejor correo web del mundo
http://correo.yahoo.com.ar
Yahoo! Groups Links
Yahoo! Groups LinksMessage
RE: [AVR-Chat] Having trouble debugging a piece of code.
2005-02-08 by wbounce
Attachments
- No local attachments were found for this message.