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?
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()
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.
-------------------------------------------------------------------------------
Thank you very much for your answer. I'll try it later. Thank you.
you are welcome.