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

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

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

Jump to solution
1,864 Views
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

Labels (1)
0 Kudos
Reply
1 Solution
1,830 Views
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

View solution in original post

0 Kudos
Reply
2 Replies
1,850 Views
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 Kudos
Reply
1,831 Views
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 Kudos
Reply