Good day!
I'm using PIC18F47K42, XC8, MPLABX
What I'm intending to do is have a simple bootloader coded in either assembly or fully self-contained simple C at the top of main() (or in a function called first thing from main()) which I wish to reside reside in, let's say, 0x0000-0x03FF (boot block.)
Then all the rest of everything else I want at or above 0x0400.
Is there a pragma or something I can put before and after my bootloader code to plant it in 0-3ff and everything else above 3ff?
Yes, I do know that the reset vector is in the boot block, and so will be the default interrupt vectors, and will need forwarder GOTOs at those, or perhaps on this model I can change IVTBASE to a new vector above 3ff on the fly.
And yes, I do know that this is not normally how bootloaders are done, and I have done them the normal way but I would really enjoy trying it this way this time if I might be able.
It is a multi-file project with a handful of .h and .c files and a fair number of functions.
Thank you very much,
Jesse
UPDATE: I'm thinking this may not work. I tried void bootloader(void) __at(0) and it complains that it overlaps segment "reset vec." I'll probably have to do it the old fashioned way, but if any of you have ideas I'm still certainly happy to hear them!