AVR Studio stack warnings
2006-06-18 by Pat Villani
OK, lurker here. After a year of on again, off again AVR projects, I'm finally doing an ATMega32 based project. Tools are AVR Studio v4.12 SP3, WinAVR 20060421 and <http://www.atmel.com/dyn/products/tools_card.asp?tool_id=3353>AVR JTAGICE mkII. The board comes in this week, so I decided to put together a "Hello world" program using GCC and avr-libc (polled USART I/O) to test it. I figured I'd test the program first in order to be able to start with a known reference, so I ran it on the simulator. First, it complained of an uninitialized stack pointer at the first function call. The disassembly shows that the stack is initialized, but I stuck a "SP = RAMEND;" statement in, and it seemed to pass. Now I get stack overflow and stack underflow errors on function returns. I'm watching the Stack Pointer in the I/O View and it seems to be what I expected it to be. It runs to completion as expected, but maybe I'm missing something. Google and Yahoo Group searches didn't seem to yield any meaningful results. Any advice? Pat