Continue to Site

Welcome to our site!

Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

  • Welcome to our site! Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

Stack over flow error

Status
Not open for further replies.

Angy

New Member
Can someone please explain how I fix this on MPLAB IDE?
CORE-E0001: Stack over flow error occurred from instruction at 0x00000d
Thanks.
 
Can someone please explain how I fix this on MPLAB IDE?
CORE-E0001: Stack over flow error occurred from instruction at 0x00000d
Thanks.

hi,
You are over filling the stack, this can happen when you have too many PUSH's to the stack... that is more gosubs than returns, or using a return at the end a routine thats been jumped to by a goto.
 
Two things
  1. Make sure every function(subroutine) ends with a return
  2. Don't have more levels than the stack can handle
 
I think you're all looking at this the wrong way?, it's not very clear, but I suspect he's talking about a problem actually getting MPLAB to run, and not a PIC programming problem.
 
I'm simulating the program and if i set a breakpoint it does not stop there it breaks elsewhere. The output on the simulator throws the error below.
CORE-E0001: Stack over flow error occurred from instruction at 0x00000d
Eitherways,i will check the program.
 
Last edited:
I think you're all looking at this the wrong way?, it's not very clear, but I suspect he's talking about a problem actually getting MPLAB to run, and not a PIC programming problem.
I think he assumes there is something he can do to fix the problem. If MPLAB has the problem then there is proabably nothing he can do to fix it.
 
This error does not happen all the time but only when I run a particular program which is really lengthy.So I know for a fact that its something I'm doing on the program causes the error.
 
This error does not happen all the time but only when I run a particular program which is really lengthy.So I know for a fact that its something I'm doing on the program causes the error.

hi,
You can use the 'manage attachments' button to upload your FULL asm file to the forum.

The button is lower down on the REPLY window, do that I'll try to assemble it.
 
I know that is the only way to solve the problem unfortunately I'm not authorized to do that.Thanks for the help, I will update as I break my head and find the solution.
 
Are you using 8.20 and 18fxxx if you are they say you can set breaks on the 18fxxx
A programming problem has been found when Software Breakpoints are enabled and the device is programmed. This happens on 18F products
may not be the
case for you
 
It may not be the case but it dose say there was a bug with breakpoints I didn't read all of it I think they fixed it in 8.20 but any way it's right here only with 18fxxx chips **broken link removed**
 
Last edited:
I'm simulating the program and if i set a breakpoint it does not stop there it breaks elsewhere. The output on the simulator throws the error below.
CORE-E0001: Stack over flow error occurred from instruction at 0x00000d
Eitherways,i will check the program.

The instruction at location 13 (0x0d) will be a call or push instruction (view the disassembly listing). This is somehow being executed lots of times without a corresponding return of pop instruction. Trace where the code goes to see how it is getting back there. It is probably running through memory and going back to location zero.

Mike.
 
Last edited:
The MPLAB problem caused programming to fail. It was not an execution problem.

Here is my take. Angry says the program is not hitting his breakpoints and that the stack overflow is at location 0x0d. What is it doing there?

Whitout seeing the code ny first guess would be that he has interrupts enabled but no ISR to handle them.
 
If true, he should hope his boss doesn't read the forums or he could be looking for a new programmer. All of my bugs are way more subtle than that(ROFL).
 
You all are bad that's why a said "it may not be the case" I done it with with nested sub's and not returning thanks to Mike I don't do that no more.
 
Forgetting to clear the flag is an easy mistake. Enabling interrupts without an ISR is well....just tragic.
 
Status
Not open for further replies.

Latest threads

New Articles From Microcontroller Tips

Back
Top