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
![]()
Bookmarks