Switch the program conter to SRAM for MPC5674F

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

Switch the program conter to SRAM for MPC5674F

388 Views
Harry_Yao
Contributor I

I have  OS running in the flash, but there is some case in which I will download a user application case to the SRAM with eSCI and run the user application in the SRAM. I want to know how to switch the PC to the code in SRAM for MPC5674F. Thanks!

0 Kudos
Reply
5 Replies

363 Views
lukaszadrapa
NXP TechSupport
NXP TechSupport

Hi @Harry_Yao 

You can use pointer to function to jump anywhere within the memory map.

Here is something similar:

https://community.nxp.com/t5/Other-NXP-Products/Boot-Assist-Module-BAM-with-FlexCAN-MPC5604P/m-p/263...

I described there how to create RAM image which can be downloaded by BAM.

Regards,

Lukas

0 Kudos
Reply

361 Views
Harry_Yao
Contributor I

Hi Lukas,

    Thanks for your reply.

    I have already created a RAM image. My question is how to jump to the code in the SRAM. In other words, I have an OS running in the flash which is also used to receive the code for the SRAM. After the code receive done, I need to jump to the code in the SRAM from the flash. My understanding is that it is needed to change the value in the register PC. But I don't know how to udpate the value in the PC. Thanks!

0 Kudos
Reply

349 Views
lukaszadrapa
NXP TechSupport
NXP TechSupport
0 Kudos
Reply

245 Views
Harry_Yao
Contributor I

Hi Lukas,

    Sorry for my late response. Your solution works well. But another question comes. Will the interrupt that is setup in the flash code still take affect if the interrupt instance occur?

0 Kudos
Reply

220 Views
lukaszadrapa
NXP TechSupport
NXP TechSupport

Sure, it will. It's highly recommended to disable all interrupts and de-initialize everything before the jump.

0 Kudos
Reply