Hello,I have some problems when i studying bootloader.
MCU:MC9S12ZVL64
1:AN4723,4.3 Memory erase. "the bootloader must be placed on the last sectors of the P-FLASH array(right before the last sector)". Is this advice or a rule? what will happen if there is a sector between last sector(0xFFFE00 TO 0xFFFFFF) and bootloader?
2:P-Flash Erase and P-Flash write functions must be executed from RAM. In AN4723,these functions on SHADOW_ROM_S are copied to RAM to execute. Can i use the following method instead?
#pragma CODE_SEG DEFAULT_RAM
void PFLASH_Erase_Verify_Section(void) { ... }
3:In main application,how to configurate the linker file if i move the interrupt table from its default position?
which one is right?
ROM = READ_ONLY 0xFF0000 TO 0xFFE5FF;
or ROM = READ_ONLY 0xFF0200 TO 0xFFE5FF;
In this case, how to decide the main application entry address? 0xFF0000 or 0xFF0200?
In this case,There are two vector tables in the current program ,one for bootloader one for main application,is that right?
4: I know bootloader ROM address and the main application addresses must not overlap. Following is wrong.
ROM = READ_ONLY 0xFF0000 TO 0xFFFDFF;//bootloader prm
------------------------------------------------------------------------------------------------------
ROM = READ_ONLY 0xFF0000 TO 0xFFFDFF;//the main application prm
But i am not sure that is it wrong for RAM configuration.
RAM = READ_WRITE 0x001000 TO 0x001FFF;//bootloader prm
--------------------------------------------------------------------------------------------------
RAM = READ_WRITE 0x001000 TO 0x001FFF;//the main application prm