Just don't forget that PIC18 devices have two stacks, one hardware (call) stack and one software (data) stack. The type of stack overflow that is caught by the simulator is the hardware call stack, which is fixed with 32 levels. Most probably enlarging the software stack won't fix this error. Best regards, Isaac Em 19/8/2010 17:27, Carl Denk escreveu: > The stack size is the last item in the linker script, and for the > 18F1320, the standard size is 0x40, and without changing anything else, > 0x7F was the biggest and would still link. I had looked other places for > the stack size, but couldn't find any other place to adjust it. With a > scaled down program, I tried several stack sizes and printf's. Making > the stack size bigger didn't seem to affect the outcome. Here's 2 printf'= s > > This one worked, now, I am able to at least add some strings, get the 2 > "/" and 2 variables. Both of these compiled with no warnings or errors. > When running in MPLAB-SIM, get the same "CORE-E0001: Stack over flow > error occurred from instruction at 0x000c10". Looking a little at the > disassembly, it looks like it hangs in putc area, maybe looking for an EO= F. > > printf ((const rom far char*) "abcdefg%2d/%2d/abcd", month, day); > > And this one crashed the micro, I have a flashing LED in the while() at > the end. > > printf ((const rom far char*) "%2d/%2d/%2d", month, day, year); > > On 8/19/2010 3:43 PM, Brendan Gillatt wrote: > > Thanks everyone for your input. :) > On 19/08/2010 20:29, Isaac Marino Bavaresco wrote: > =20 > >>> Em 19/8/2010 16:13, Brendan Gillatt escreveu: > >>> =20 > >>>> Have you tried to increase the amount of RAM allocated to the > stack? I > >>>> don't remember the specifics but I had to do so for another piece of > >>>> code. There's an option somewhere in the build configuration for the > >>>> project IIRC. > >>>> =20 > >>> It used to be in the linker script. > >>> > >>> Isaac > >>> > >>> =20 > You're probably right--it has been a while since I've used C18. > --=20 http://www.piclist.com PIC/SX FAQ & list archive View/change your membership options at http://mailman.mit.edu/mailman/listinfo/piclist .