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

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

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

Jump to solution
980 Views
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 Kudos
1 Solution
896 Views
cody1
Contributor III
  1. Change from SDM to LDM
  2. After separating all the spaces of BOOT and APP, everything will operate normally.

View solution in original post

0 Kudos
2 Replies
897 Views
cody1
Contributor III
  1. Change from SDM to LDM
  2. After separating all the spaces of BOOT and APP, everything will operate normally.
0 Kudos
949 Views
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.

Tags (1)
0 Kudos