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.
static int8 serviceCall = 0x00;
// Some initialization calls.
// Some other stuff.
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.