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

キャンセル
次の結果を表示 
表示  限定  | 次の代わりに検索 
もしかして: 

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

ソリューションへジャンプ
1,859件の閲覧回数
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,825件の閲覧回数
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,845件の閲覧回数
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,826件の閲覧回数
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 件の賞賛
返信