benoitstjean
Joined: 30 Oct 2007 Posts: 596 Location: Ottawa, Ontario, Canada
|
| PIC24EP512GP806 - Bootloader no longer working |
Posted: Thu Feb 12, 2026 2:50 pm |
|
|
Device: PIC24EP512GP806
Compiler 1: 5.116
Compiler 2: IDS 5.071, PCB/D/H/M: 5.026
Hi guys,
Years ago, I had bootloader code that worked fine but I haven't used it in 6-7 years.
Back then, I only needed it when shipping devices to partners for testing which, in the event of a required change, all they had to do was to upload new firmware via TeraTerm without needing a programmer.
The process was simple for me:
1. Uncomment bootloader.h in my main code and recompile;
2. Compile and burn the bootloader to the PIC;
3. Reboot the device in bootloader mode;
4. Drag the main hex file into TeraTerm to upload;
5. Reboot the device and after so many seconds waiting for the bootloader, it would timeout and jump to the main code;
I stopped using it years ago and never touched it again for other reasons.
Today, I'm trying to use it again but when I upload the main program, the device just keeps reloading the bootloader instead of running my code.
I think it might be a memory issue. Over the years my code has grown a lot:
- Compiler 2 (IDE 5.071 / PCD 5.026): Compiles at 95% ROM normally, 96% with bootloader.h;
- Compiler 1 (5.116): Won't compile at all—gives "Out of ROM" error on a function with #separate;
Back when the bootloader last worked, ROM usage was around 92-93% when compiled on Compiler 2.
My theory: Since Compiler 2 is older and compiles at 96% without ERRORS, maybe it's silently overwriting memory that the bootloader needs? Compiler 1 fails with an OUT OF ROM ERROR but not Compiler 2.
Tomorrow I'll try commenting out code to get it compiling on Compiler 1 with the bootloader and see if that fixes it.
But does this make any sense? Could compiling at 96% with Compiler 2 be corrupting bootloader memory?
Thanks,
Ben |
|