All, We are designing a "loader" for field firmware updates. Unfortunately we do not have the code space (P89C668) to have two sets of code in on-chip flash. Therefore we will use a scheme where we have the loader code located in sector one and all the ISRs in sector zero as the loader will use interrupts. The rest of the application will be in sectors 2 and up. The loader will erase the upper sectors and program the new code there. It will then erase sector zero and reprogram the vector table and the ISRs. Block one, the loader, will remain unchanged. Questions: I think I can locate the code in sector one and the ISRs in sector zero using user classes. I have done this with some ARM code in uVision. How can I be sure that the loader will have all the run-time modules it needs in sector zero? In other words, I cannot have the loader calling code in sectors that have been erased. It will have to be completely self contained except for the ISRs. Is this a reasonable plan? Anyone have a better way to do this? Rich
All, I know this thread is several months old, but it has recently provided me a technique for our BootLoader to use, but there is an issue to be considered. First, Bob, thank you very much, this is a cleaver techique and to the best I can invision so far, it appears to be solid. This will allow us to have ISR's in the BootLoader. We will be loading this FakeInt into sector 0 during manufacturing setup and it will never change. The extra 256 bytes in sector 0 will also store some constant board information (serial number, ...). The issue: We found that when you perform a type cast of a float, the F0 bit will get reset back to 0. I contacted Keil support on this issue and they confirmed that F0 is used by their libraries. They referred me to this support page http://www.keil.com/support/docs/2893.htm , which references using UD:F1 as a bit for users to safely use. Danny