Hi Kang,
1) The difference is in memory address format.
The 0xEFFE is Local(Banked) address. Since the page 0xFF is directly allocated in the 64kB memory map (as 0xC000~0xFFFF), we use just the short non-banked address.
The 0x7FEFF8 is Global(Linear) address. This address is used by Flash controller.
In fact, the addresses 0xEFF8 and 0x7FEFF8 point to the same memory byte.
See attached memory map in excel file. Some more details may be found also in AN3784 Understanding the Memory Scheme (targeted rather to older S12XD family).
The RESET_VEC_SRC points to 0x7FFFE0 (0xFFE0 in local address format) because S-Rec file after conversion is formatted to fix 32byte length.
So, when the address in S-Rec line contains this address, we know that the last word (0x7FFFFE~0x7FFFFF) from S-Rec line is Application reset vector.
The RESET_VEC_DST points to 0x7FEFF8 because of the Flash Controller program the P-Flash by 4 words (= 8 bytes = one phrase).
So, the value from address 0x7FFFFE~0x7FFFFF will be placed at 0x7FEFFE~0x7FEFFF.
2) There is no direct technical relationship between reset vector source and destiny addresses.
The reset vector source address is clearly defined by S12(X) hardware. This is default value we do not need to change it in Application project with AN4258 bootloader solution.
The reset vector destiny address may be any address in memory map exclude area occupied by the bootloader. The author AN4258 logically selected the highest address in P-Flash area allocated for Application code (area 0xFF00~0xFFFF is occupied by bootloader). If you want to change this address, please just update RESET_VEC_DST definition and AppResetVect value in StartS12X.s file. This is typically necessary when your bootloader version overgrow default 4kB and you need to allocate more space for it in P-Flash.
I understood your confusion since this great feature is not very well described in the AN4258 text.
You simply do not need to take care of Application reset vector (contains the address where Application starts) until bootloader size is below 4kB. The Application reset vector is automatically moved to the different location by bootloader code.
Note: There is a just small known issue in the bootloader EraseFlash() code when you will use S12XE_256 or S12XE_128 derivatives (case MASK_0M53J and MASK_1M53J_2M53J). The lines
if(Error = PFlash_EraseBlock(0x7A0000UL))
return(Error);
should be commented/deleted because these derivatives do not contain such Flash block.
I hope it helps you.
Best regards
Radek