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

How can I get the reset vector to jump straight to main

I have created a image relocation scheme where my boot loader can load an image into one of several positions in the flash and execute them individually. This involves remapping the IVT from that created by the compiler/linker so that the processor jumps into the correct relocated isr positions. Now, here is the problem I have come up against. I need the boot loader to jump into the new located code. I initially thought it would be okay to just take the reset vector (with the location offset added) out the IVT and jump to that. The only problem I found is that this jumps to a load of scatter file initialisation code that does not appear to use relative addressing and jumps back to the boot loader code. I have managed to get the boot loader to jump directly to main (using hard coding) and this works beautifully, all the routines appear to be using the correct relative branches and jumps. But the main address moves around depending on the image content and needs to be obtained and passed in to the boot loader for it to work, which could be done by getting it placed into an image header but is a little clumbsy, requiring use of FROMELF and some other post linker scripting as well as the header decoding at the other end.
So my question is.. how can I get the Keil compiler to set the main address into the reset part of the vector table? Or how can I program the reset isr to jump direct to main with out it calling all this initilisation stuff? Or can I just take out the initialisation, if so how?
Hope there is enough but not too much detail there for me to make sense.

Parents
  • I did understand you and as I said, you are violating one of the foundations on which an ARM processor (not an M3 - don't know that one yet) is based. you cannot setup the different modes stacks when in user mode - in user mode, only the condition flags of the CPSR (CPSR_f) can be changed. In other modes, the entire CPSR can be changed.
    I suggest you read a little bit about an ARM processor and then apply what I have written above. You don't have to, but it is advisable to do the remapping from within the target application itself.

Reply
  • I did understand you and as I said, you are violating one of the foundations on which an ARM processor (not an M3 - don't know that one yet) is based. you cannot setup the different modes stacks when in user mode - in user mode, only the condition flags of the CPSR (CPSR_f) can be changed. In other modes, the entire CPSR can be changed.
    I suggest you read a little bit about an ARM processor and then apply what I have written above. You don't have to, but it is advisable to do the remapping from within the target application itself.

Children