How to move the MC9S12DP512 interrupt vector

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

How to move the MC9S12DP512 interrupt vector

Jump to solution
831 Views
peijinwang
Contributor II

Hi,I now use MC9S12DP512 do BootLoader encountered a problem, MC9S12DP512 has no IVBR register, so, how to move the interrupt vector?

Labels (1)
0 Kudos
1 Solution
617 Views
ZhangJennie
NXP TechSupport
NXP TechSupport

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!
-----------------------------------------------------------------------------------------------------------------------

View solution in original post

0 Kudos
3 Replies
618 Views
ZhangJennie
NXP TechSupport
NXP TechSupport

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!
-----------------------------------------------------------------------------------------------------------------------

0 Kudos
617 Views
peijinwang
Contributor II

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

0 Kudos
617 Views
ZhangJennie
NXP TechSupport
NXP TechSupport

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!
-----------------------------------------------------------------------------------------------------------------------

0 Kudos