Hi,I now use MC9S12DP512 do BootLoader encountered a problem, MC9S12DP512 has no IVBR register, so, how to move the interrupt vector?
Solved! Go to Solution.
 
					
				
		
 ZhangJennie
		
			ZhangJennie
		
		
		
		
		
		
		
		
	
			
		
		
			
					
		Hi Peijing,
For MC9S12DP, One solution is to use secondary vector jump table for bootloader.
See
https://www.nxp.com/docs/en/application-note/AN2153.pdf
demo code
https://www.nxp.com/webapp/Download?colCode=AN2153SW&appType=license
Have a great day,
Jennie Zhang
-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------
 
					
				
		
 ZhangJennie
		
			ZhangJennie
		
		
		
		
		
		
		
		
	
			
		
		
			
					
		Hi Peijing,
For MC9S12DP, One solution is to use secondary vector jump table for bootloader.
See
https://www.nxp.com/docs/en/application-note/AN2153.pdf
demo code
https://www.nxp.com/webapp/Download?colCode=AN2153SW&appType=license
Have a great day,
Jennie Zhang
-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------
Hello, thank you for your reply! After reading AN2153 ,I have a few questions puzzled.
1.how to use C language to write the second interrupt vector jump table?
2.My Bootloader only lack the second interrupt vector jump table, how to add the the second interrupt vector jump table use assembly language ? The following is my assembly boot code:
xref main ;
xdef _BootStart ;
AppResetVect: equ $effe ; here is stored reset vector of user application
StackTop: equ $3000 ;
_BootStart: ;
 nop ;wait a few cycles for stabilization of the signal
 nop
 nop
 nop
 nop
ldd AppResetVect ;
 cpd #$ffff ;
 beq GoBoot ; if the application reset vector is not available
 ; then start the bootloader
 ldx AppResetVect ;
 jmp 0,x ; jump to the application
 
 
GoBoot: 
lds #StackTop ; 
 jmp main
 
					
				
		
 ZhangJennie
		
			ZhangJennie
		
		
		
		
		
		
		
		
	
			
		
		
			
					
		Hi Peijin
In C, I suggest you use inline assembly to implement jump table
asm jmp ...
here is an example to implement jump table in assembly
MyCode: SECTION
entry1: NOP
        NOP
entry2: NOP
        NOP
entry3: NOP
        NOP
main:
     JMP [goto2,pcr]
goto1: DC.W entry1
goto2: DC.W entry2
goto3: DC.W entry3
Have a great day,
Jennie Zhang
-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------
