PDA

View Full Version : LOADER_USED question



nirvdrum
- 9th January 2007, 18:41
From what I gather, #defining LOADER_USED will cause PBP to offset where it starts putting code by 4 words. I can't really verify that because I'm not sure where it's defined for the 16f series of MCUs (pbppic16.lib doesn't exist). So, empirically that seems to be the case anyway.

If the point of LOADER_USED is to leave the first four words available for the bootloader, why then does it insert a "GOTO 0x04" at location 0x0000? Am I misunderstanding something? That seems like it would clobber whatever GOTO the bootloader will have put into 0x0000.

Thanks,
Kevin

Bruce
- 9th January 2007, 19:34
pbppic16.lib doesn't exist
There is no pbppic16.lib. For the 14-bit core the library is pbppic14.lib

Scroll down below the utility macros and look in the "Startup Code" section.


why then does it insert a "GOTO 0x04" at location 0x0000?
Because it needs to vector the the INIT location to process startup code
that didn't fit between 0x00h and 0x03h.

Scroll way down to the bottom of your pbppic14.lib, and look in the INIT
section.

The PC boot-loader software normally just re-maps whatever user code it
finds after its own jump vectors, so this normally isn't a problem.

nirvdrum
- 9th January 2007, 19:55
Thanks for that info. I actually had discovered that pbppic14.lib was being used when looking at the resultant ASM, but your explanation clarifies why.

So, now I guess I need to decide whether I want to GOTO my bootloader immediately after all the PBP init code or whether I want to modify the .lib file to remap as appropriate. I'm thinking the latter might make more sense as I develop other programs relying on my bootloader. Either way, I have enough info to really get this done now, I think.