Good Grief!

Go To Last Post
2 posts / 0 new
Author
Message
#1
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Hello,

I'm very frustrated with AVR Studio (4.02 Build 135) right now. I just started using it yesterday with a COF built from the Imagecraft compiler. My target is an ATMega128L. I'm just trying to do basic "Simulation 101" stuff and the simulator is not behaving consistently, and sometimes things just flat out don't work. My OS is a simple round-robin scheduler.

1) Eternal Interrupts behave inconsistently:

While stepping through my main scheduler loop, I manually assert an external interrupt on PortD (clear both PIND and PORTD). When I resume stepping, the simulator does not always vector to the ISR. Sometimes I have to reset the simulator 2 or 3 times before this works. I've tried every combination of asserting the pin in PIND and/or PORTD and the behavior is never consistent.

2) Breakpoints behave inconsistently:

I sent this to the forum yesterday, half-embarassed to be stuck on such a trivial issue. Breakpoints don't work in the simulator. Here's a simplified scenario of mine that doesn't work. I've tried it with interrupts both enabled and disabled.

void main(void)
{
static int8 serviceCall = 0x00;

// Some initialization calls.
initCall1();
initCall2();
initCall3();

while(1)
{
switch (serviceCall)
{
case TASK1:
serviceTask1();
break;

case TASK2:
serviceTask2();
break;

case TASK3:
serviceTask3();
break;

}

// Some other stuff.
if (cond1)
otherCall1();

var1++;

if (cond2)
var2++;

serviceCall = ((serviceCall == 3) ? 0 : serviceCall + 1);
}

} // end of main()

2a) Reset the simulator. Insert breakpoint at one of the following places:
- any initCall
- @ switch (serviceCall)
- @ serviceTask3()

F5 to run. Doesn't break. Manual break stops code somewhere in the while(1).

2b) Reset the simulator. Insert breakpoint @ if (cond1). Go a few times. Breakpoint works.
Insert breakpoint @ var1++. Go a few times. Both breakpoints work.
Insert breakpoint @ if (cond2). Go and only the first two breakpoints work.

2c) Breakpoints dont seem to work at all when placed in an ISR.

I'm finding the task of characterizing this issue to be impossible. Too many scenarios don't work, or work one time and not the next. I've also seen the "Remove Breakpoints" option greyed out while I have breakpoint icons enabled in the source.
I can't afford to spend any more time on this issue. It is severely hampering my progress.

3) Expanding arrays in the watch window only displays the zero'th element of the array. I'm in a function that allocates an 7-byte array locally (stack). Enough said.

4) I know that structures are not yet expandable in ICCAVR V6.25 COF output. Does this mean that I also cannot watch structure members specifically? Trying to watch struct.member or pStruct->member displays "Not in scope".

All of these issues combined make it virtually impossible to perform any useful simulation and debugging. Any help on any of these issues would be greatly appreciated.

-Chris

admin's test signature
 

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

You have me concerned. First, I see "Good Grief!," much the way I feel at present, but then I see what you said got 150+ reads and ZERO replies. This does not look good to a person who is about to dive into Studio 4 with only the (infamous) "Help" and some past experience with assembly languages as guides.

But, as bad as my situation is, I take some consolation in the fact that yours is worse, as I haven't actually asked a question yet.

admin's test signature