How to move the MC9S12DP512 interrupt vector

取消
显示结果 
显示  仅  | 搜索替代 
您的意思是: 
已解决

How to move the MC9S12DP512 interrupt vector

跳至解决方案
1,637 次查看
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?

标签 (1)
0 项奖励
回复
1 解答
1,423 次查看
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 项奖励
回复
3 回复数
1,424 次查看
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 项奖励
回复
1,423 次查看
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 项奖励
回复
1,423 次查看
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 项奖励
回复