By boot code consists of two projects. Both are written in C using small memory model. One I call fixed boot which is contained in FLASH memory. The other I call flex boot and it is downloaded from a PC to internal RAM if a software update is required. Flex boot contains FLASH erase and programming algorithms for several devices. Fixed boot calls functions in flex boot via a function table located at a fixed address. My fixed boot project reserves memory 0xC000 - 0xD7FF for flex boot. For this scheme to work correctly I beleive that I need to insure that both projects setup the following items the same way: 1. The system stack 2. The main registers 3. The users stack 4. DPP registers The first three I can handle but I am unsure how to handle the DPP registers. I posed this question to Keil support and they suggested to initialize them in the startup.a66 file. I am confused at how this would work and so far have not been successful in getting an explaination from them. The compiler uses the DPP registers to calculate addresses. If I change the contents of these registers in the startup code, won't the compiled code calculate the wrong address??? Would someone please explain this too me. Also I would appriciate any comments on things I might be missing or need to be careful of in the fixed/flex boot scheme I described. Thanks in advance, Walt
Jon and Scott: Ah yes, I am now seeing the light. Thank you both for your help. I am going to try to eliminate the nconst class in flex-boot as Scott suggested. -Walt