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