Where is your RETURN statement in the routine "sub_error"?
Where is your RETURN statement in the routine "sub_error"?
Dave Purola,
N8NTA
EN82fn
For the purpose of testing I just had it go into an endless loop in the subroutine.
I've just added one in after "GOTO $" to rule that out but it's still resetting.
Are you sure, that you set up correct offset?
Try to add hard coded address instead label.
As I assume that flash adr 0 is not PC adr 0. Or I missed something?
I'm also interested in your HW setup.
I've spent a bit of time trying to get the debugger to work. I'm using an ICD3 but the dsPIC33E/PIC24E firmware seems to be quite buggy when using it as a debugger.
It turns out that there was a bug in my custom compiler that was setting __SP_init and __SPLIM_init to 0. The PIC was correctly erroring because of a stack overflow.
I've fixed the bug and it's all working now!
@pedja089
The main flash and auxiliary flash are both in the same flash space with the auxiliary section starting at 0x7FC000.
The PC accesses both areas as if they are just 1 big area of flash so PC 0 would always be the start of the main flash.
For the hardware, I'm using a custom PCB with the PIC24EP512GP806, an ENC28J60 with an RJ45 socket and a bunch of headers.
It's currently plugged into a breadboard which gives me 2 LEDs that I've been using to "debug" the code
I've uploaded a picture of the board if you're interested
![]()
Last edited by The Master; - 13th February 2021 at 16:12.
I assume that you had PIC18 connected with external flash.
I totally missed your first sentence in first post. Sorry about that.
Bookmarks