Switch the program conter to SRAM for MPC5674F

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

Switch the program conter to SRAM for MPC5674F

482 次查看
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 项奖励
回复
5 回复数

457 次查看
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 项奖励
回复

455 次查看
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 项奖励
回复

443 次查看
lukaszadrapa
NXP TechSupport
NXP TechSupport
0 项奖励
回复

339 次查看
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 项奖励
回复

314 次查看
lukaszadrapa
NXP TechSupport
NXP TechSupport

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

0 项奖励
回复