• 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.
 

ericgibbs

Well-Known Member
Most Helpful Member
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.
 

Papabravo

Well-Known Member
Two things
  1. Make sure every function(subroutine) ends with a return
  2. Don't have more levels than the stack can handle
 

Nigel Goodwin

Super Moderator
Most Helpful Member
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.
 

Angy

New Member
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:

Papabravo

Well-Known Member
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.
 

Angy

New Member
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.
 

ericgibbs

Well-Known Member
Most Helpful Member
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.
 

Angy

New Member
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.
 

be80be

Well-Known Member
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
 

Pommie

Well-Known Member
Most Helpful Member
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:

3v0

Coop Build Coordinator
Forum Supporter
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.
 

Papabravo

Well-Known Member
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).
 

be80be

Well-Known Member
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.
 

Papabravo

Well-Known Member
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

EE World Online Articles

Loading
Top