RT1052 jump to application

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

RT1052 jump to application

2,532 次查看
brli
Contributor III

Hi,

For RT1052 boot on flexspi nor flash, I locate one user application's start address at 0x60000000, and locate another user application's start address at 0x60020000.

I want to let 1st application jump to 2nd application's reset handle directly,  Now PC pointer can jump from the 1st application to 2nd application and work continue, but it can't back to breaked point when response interrupt. my jump code as following, very appreciate for your suggestion!

typedef void (*Fun_t)(void);

/*jump follow code*/

SCB->VTOR = 0x60022000;

__set_MSP(0x20040000);

__set_PSP(0x20040000);

pFun = (Fun_t)(*((volatile uint32_t*)(0x60022004)))

(void)(pFun)();

Thanks!

Br Li

标签 (1)
0 项奖励
回复
8 回复数

2,260 次查看
Takashi_Kashiwagi
Senior Contributor I

Hi Br,

I think the following threads are useful.

non-xip example with MCUXpresso 

Best Regards,

T.Kashiwagi

0 项奖励
回复

2,260 次查看
jeremyzhou
NXP Employee
NXP Employee

Hi,

Thank you for your interest in NXP Semiconductor products and for the opportunity to serve you.
Actually, I'm not very clear with your issue, whether you mean that the interrupt is unable to be triggered when running the second the application. I hope you can clarify it in details.
Have a great day,
TIC

-------------------------------------------------------------------------------
Note:
- If this post answers your question, please click the "Mark Correct" button. Thank you!

- We are following threads for 7 weeks after the last post, later replies are ignored
Please open a new thread and refer to the closed one, if you have a related question at a later point in time.
-------------------------------------------------------------------------------

0 项奖励
回复

2,260 次查看
brli
Contributor III

Hi Jeremyzhou,

interrupt can be triggered and PC pointer also jumps to interrupt handle, but PC pointer can't back to breaked point to continue main function after end of the interrupt handle.

我用中文再描述一边,

在nor flash 0x60000000地址编译链接一软件(以后称为:bootloader), 0x60020000地址编译链接另一软件(以后称为:主程序)

每次开机先启动0x60000000地址的bootloader,在bootloader的main函数中直接跳转到主程序的Reset_Handler开始执行主程序

目前问题是,如果没有I2C中断的情况下,主程序运行没发现问题, 但当有I2C中断的情况下,主程序可以被中断触发且能进入中断函数执行,中断函数执行完成后无法返回到中断断点处继续执行主程序。

如果将主程序地址编译连接到0x60000000只执行主程序,中断响应可以正常触发,可以返回到中断断电继续执行主程序,没任何问题。

所以我想是不是程序之间互相跳转,还需为主程序准备什么环境/条件?目前没思路了,请麻烦指导一下。

Thanks!

Br Li

0 项奖励
回复

2,260 次查看
jeremyzhou
NXP Employee
NXP Employee

Hi ,

感谢分享。
请问你在跳转过程中,有配置过VTOR寄存器吗?!

初步怀疑跟VTOR寄存器有关。

Have a great day,
TIC

 

-------------------------------------------------------------------------------
Note:
- If this post answers your question, please click the "Mark Correct" button. Thank you!

 

- We are following threads for 7 weeks after the last post, later replies are ignored
Please open a new thread and refer to the closed one, if you have a related question at a later point in time.
-------------------------------------------------------------------------------

0 项奖励
回复

2,260 次查看
brli
Contributor III

/*jump follow code*/

SCB->VTOR = 0x60022000;

__set_MSP(0x20040000);

__set_PSP(0x20040000);

pFun = (Fun_t)(*((volatile uint32_t*)(0x60022004)))

(void)(pFun)();

0 项奖励
回复

2,260 次查看
jeremyzhou
NXP Employee
NXP Employee

Hi,

Thanks for your reply.
你有单独调试过主程序吗?中断机制是正常的吗?

Have a great day,
TIC

 

-------------------------------------------------------------------------------
Note:
- If this post answers your question, please click the "Mark Correct" button. Thank you!

 

- We are following threads for 7 weeks after the last post, later replies are ignored
Please open a new thread and refer to the closed one, if you have a related question at a later point in time.
-------------------------------------------------------------------------------

0 项奖励
回复

2,260 次查看
brli
Contributor III

主程序单独跑没问题。

0 项奖励
回复

1,749 次查看
qq240997293
Contributor I

您好,近期我也采用RT1052开发产品,也遇到了类似问题,想咨询一下您最后这个问题是怎么解决掉的?

怎么正常从bootloader程序跳转到app程序的?

0 项奖励
回复