I need to develop bootloader project on MC9S08DZ60 mcu (separated project).
I have few questions:
1. If my bootloader is not using interrupts, do I need to redirect the vector table?
2. What is the reason of redirecting the vector table? I understand that vector table redirection reason is in
case a user app (not bootloader) wishes to modify interrupt vector information without unprotecting bootloader
and reset vector space. How does user app can modify it? What does it mean?
The only way I can think of modifying this is by flashing new firmware which is done by the bootloader.
3. If my bootloader size is 512 bytes, do I need to protect flash address 0xFDFF through 0xFFFF?
4. If redirection of vector table is needed, is it enough to modify the registers NVOPT.FNORED? Will this
automatically redirect the vector table to 0xFDFF?
5. Do I need to modify NVOPT.FNORED in the common area so it takes effect on bootloader and user app?
6. In the .PRM file do I need to define new ROM segment for my user app which starts from 0xFDFF and use #pragma
0xFDFF in all .c files of the application?
7. When the mcu reset, it will invoke _EntryPoint which will init clock and other common stuff and it will then read the
flash (in a known location) to see if to run user app or go to bootloader. Do I need two main() one for bootloader and
one for user app which will be in 0xFDFF segment?
Thank you for the help and I hope my questions were clear...