I have a bootloader routine that once I call it, I'll never return (instead we'll go thru a watchdog reset once flash has been reloaded).
The problem is that I am very code space limited and want to lock down the bootloader into less space by using idata space instead of xdata for the dozen variables I need in it. But I can't waste that much valuable IDATA space on a routine that only gets called a few times in the lifetime of the product.
I've tried adding the follow to the LX51 MISC controls but I don't see that the overlay is working. Seems like it's still reserving the addresses just for this routine. OVERLAY(?PR?ApplicationPoll? ~ ?PR?bootloader?)
Is there a listing or something that shows the call tree and variable overlays?
ApplicationPoll calls Bootloader.
your bootloader should not share ANY memory with the app .. or, maybe this is the right way to express it, your bootloader should share ALL memory with the app.
Q: when your bootloader runs, what do the app need memory for? A: nothing
Erik
I stand corrected.
Yes - the bootloader does not need to share any memory with the app and thus I want to freely use whatever memory I want in the bootloader since it is not shared with the app at all.
Thus, the bootloader should have basically all 256 bytes of IDATA space all to itself since we'll go thru reset when the bootloader is finished.
But even with the overlay command the bootloaders variables are stored in a few locations in the map file and no other variable from the app is stored in the same locations. And I'm out of IDATA space. Is there another switch I need for the overlay command?
and you will never load the twain togther
PS if your (non-boot) loader does not allow this (e.g. earses all flash before any load) get another