This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

Boot code question

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

Parents
  • DPPs are used for NCODE and NDATA segments only.

    The Keil compiler automatically initializes the DPPs for your application, so there's not much you need to do there.

    The problem that comes up is what happens if DPP1 of flex-boot is different than DPP1 in fixed-boot. Or, more succintly, will fixed-boot and flex-boot share the same memory areas for NCODE and NDATA?

    If the answer is YES, you can configure BOTH programs with the same memory areas and simply RESERVE the areas in flex-boot that are used by fixed-boot.

    If the answer is NO, you may need to have an interface routine between fixed-boot and flex-boot that changes and restores the DPP registers.

    Jon

Reply
  • DPPs are used for NCODE and NDATA segments only.

    The Keil compiler automatically initializes the DPPs for your application, so there's not much you need to do there.

    The problem that comes up is what happens if DPP1 of flex-boot is different than DPP1 in fixed-boot. Or, more succintly, will fixed-boot and flex-boot share the same memory areas for NCODE and NDATA?

    If the answer is YES, you can configure BOTH programs with the same memory areas and simply RESERVE the areas in flex-boot that are used by fixed-boot.

    If the answer is NO, you may need to have an interface routine between fixed-boot and flex-boot that changes and restores the DPP registers.

    Jon

Children
No data