LPC55(s)26 use of SCB->VTOR and interrupt

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

LPC55(s)26 use of SCB->VTOR and interrupt

跳至解决方案
1,862 次查看
YodaC
Contributor III

Hi,

I try to load a program in ram and run it.

Evrything work unless the interrupt.

Running  the program directly from project with MCUX is OK.

After downloading the .bin in ram I start it with this code:

 asm ("CPSID f"); //Disable interrupts and all fault handlers (set FAULTMASK)
static void (*go_to_app)(void) = 0;
go_to_app = (void (*)())(ptPC); //ptPC =0x20008181
SCB->VTOR = (uint32_t)Relocated;//Relocated=0x20008000
__set_MSP(ptSP);
__set_PSP(Relocated);
__asm volatile ("cpsie i");
go_to_app(); 

have I miss something ?

Regards

Christian

标签 (1)
0 项奖励
回复
1 解答
1,828 次查看
YodaC
Contributor III

Thank you for replie.

The problem was in this line:

__asm volatile ("cpsie i");

I had to replace with __asm volatile ("cpsie f"); to make it work.
regards

Christian

在原帖中查看解决方案

0 项奖励
回复
2 回复数
1,848 次查看
ZhangJennie
NXP TechSupport
NXP TechSupport
Hi YodaC I would suggest you referring this AN for how to relocate vector, especially function JumpToImage() https://www.nxp.com/docs/en/application-note/AN12327.pdf https://www.nxp.com/docs/en/application-note-software/AN12327SW.zip Have a nice day, Jun Zhang
0 项奖励
回复
1,829 次查看
YodaC
Contributor III

Thank you for replie.

The problem was in this line:

__asm volatile ("cpsie i");

I had to replace with __asm volatile ("cpsie f"); to make it work.
regards

Christian

0 项奖励
回复