How to jump to other program work // LPC51U68

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

How to jump to other program work // LPC51U68

1,085 Views
陈欣
Contributor III

At present, I want to put FLASH of LPC51U68 into two pieces of code, A and B, respectively.

Section A code is put in 0~0x7FFF address, and section B code is put in 0x8000~0x40000.

When the power is on, it will run A code, then jump to B code, but when it jumps to B code, it can not run B code properly.

What do I need to do with Section B code to ensure that I can execute Section B code normally when I jump from A to B?

Labels (1)
0 Kudos
3 Replies

927 Views
ZhangJennie
NXP TechSupport
NXP TechSupport

Hi chen xin 

In order to jump from A code to B, you need

1. deinitialize the used module

2. set stack.

3. set B code entry address. then jump.

As a reference. I recommend you check AN12037. inside, there is bootloader demo code. We can think A as bootloader and B as app.

Below is what MCU does before jump from bootloader to app.see function doCleanBoot()

pastedImage_1.png

For more, please see AN12037, you can search it from NXP site easily.


Have a great day,
Jun Zhang

-------------------------------------------------------------------------------
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.
-------------------------------------------------------------------------------

927 Views
陈欣
Contributor III

Thank you very much for your answer. I'll try it later. Thank you.

0 Kudos

927 Views
ZhangJennie
NXP TechSupport
NXP TechSupport

you are welcome.

0 Kudos