I was asked to work on bootloader program for embedded system. Main function of bootloader is to execute application.
Normally, without bootloader, memory organization for application was rather simple:
0x00 Reset
0x00000004 intrreupt vector
0x00000400 application.
Now, once bootloader apper, i have to shift memory region, so bootloader code will start from bottom:
0x00 Reset
0x00000004 bootloader interrupt vector
0x00000200 bootloader code
0x00001000 application code.
Now lets go to the question:
If bootloader do proper jump and application will be executed, what will happen once reset comes? Does application requires to have own reset handler, which, eg will be only jump to 0x00
address?
Im bit confused with this reset handling, what shall be the proper way to handle that.
thanks, J.
There will only be one reset vector. After all resets the bootloader will be restarted. If the application wants to reset and end up with execution control the bootloader must transfer control to the application.
A reset is not a jump to the reset vector but the core registers are reinitialized by hardware with the program counter pointing to reset address.
Architectures may differ in the precise details, but even when your application and your bootloader have independent vector tables the effect of a reset includes resetting the vector table address to the default address, so there is only one reset vector.
Refer to the reference manual for your specific processor or architecture of the exact details. It will include the reset state of all registers and peripherals.
User contributions licensed under CC BY-SA 3.0