How to jump from current main function to other main function in the different section?

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

How to jump from current main function to other main function in the different section?

跳至解决方案
991 次查看
cody1
Contributor III

I use MC56F83783 now. I created two projects A and B.

Project A is my application.

Project B is a boot code for checking all status in flash before jump to Project A.

I split flash into two parts. The section of Project A is from 0x6000 to 0x18000.

The section of Project B is from 0x0000 to 0x6000.

I would use the debug tool to write Project A into Flash. And then I use the flash programmer of CodeWarrior to write Project B into Flash and skip the section of Project A.

The end of the line of the main function has placed the assembly code "asm(JMP 0x6000;);" in Project B.

I saw the status after running Project B but don't saw any status when jumping to Project A.

All above are for updating the section of Project A in the future and no modify the section of Project B.

Thanks.

Cody

 

 

0 项奖励
1 解答
907 次查看
cody1
Contributor III
  1. Change from SDM to LDM
  2. After separating all the spaces of BOOT and APP, everything will operate normally.

在原帖中查看解决方案

0 项奖励
2 回复数
908 次查看
cody1
Contributor III
  1. Change from SDM to LDM
  2. After separating all the spaces of BOOT and APP, everything will operate normally.
0 项奖励
960 次查看
cody1
Contributor III

I do some modifies. I can let Project B jump to Project A now, but I meet a problem that needs help.

First I put a GPIO in while(1), then I can saw the toggle status of GPIO after jumping from Project B to Project A.

And then I modified my code to insert the pointer of the function array for creating more tasks.

There is no toggle status of GPIO after jumping from Project B to Project A.

And then I place a keyword __pmem, then it works.

If I use the function pointer of the array and no place __pmem, then the program would be restarted again and again after resetting the power.

Is there anyone who can help me and tell me what kind of thing I did wrong?

Thanks a lot.

Cody

DS0010.PNG

CH2(Blue) is the working status of Project B.

CH4(Green) is the jumping status after jump from Project B to Project A.

CH1(Yellow) is the working status of Project A.

My operation sequence:

1. I use debug tool erase and program Project A into Flash.

2. I use the flash programmer tool to erase and program the section of Project B.

3. Reset the power.

标记 (1)
0 项奖励