Peripheral resets when MCU runs from bootloader to application.

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

Peripheral resets when MCU runs from bootloader to application.

1,032 Views
eunseokjung
Contributor II

Hi, all!

I'm using K10 series MCU. I made bootloader system which is based on AN2295 and its S/W.

Flash write, erase, and read function is working well, but when i start application code it makes error.

I noticed that before jump to application, i must deinitialize all peripherals that are used in bootload code.

I tihnk it is probably related with vector table. Some bootload interrupts(or vectors) are not used in application code.

My application program hasn't vectors which used in bootload code. How to deinitialize all peripherals?

And my hypothesis is right?

Now i deinitialize all peripherals one by one. But i can't find right registers that can deinitialize peripherals.

This picture is my DeInitialize function. I'm not sure it function is right or wrong.

Could you give me some advise? Thx.

Labels (1)
0 Kudos
6 Replies

809 Views
jeremyzhou
NXP Employee
NXP Employee

Hi Eunseok Jung,

Did you mean the bootload code can program the application code to Flash normally, however the application failed after jump to it?

In my practical testing, I've encountered this issue before.

So would you like to share the procedure of implement the AN2295 demo on your board like code modify, application code transfer?

I'm looking forward to your reply.
Have a great day,
Ping

-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------

0 Kudos

809 Views
eunseokjung
Contributor II

Yes, you are right.

AN2295 program deinitialize these two.

//deinitialization of SysTick

SYST_CSR = 0;

 

//  deinitialization of UART

UART_Deinitialization();

I already include this two functions.

But my code is not working.

I think, i need more deinitialize functions.

0 Kudos

809 Views
jeremyzhou
NXP Employee
NXP Employee

Hi Eunseok Jung,

Did it work after you deinitialized more peripherals function besides the Systick and UART?
Have a great day,
Ping

-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------

0 Kudos

809 Views
eunseokjung
Contributor II

Hi, jeremyzhou.

I disabled all of interrupts which are used in bootloader program.

The system works after deinitialized all interrupts.

0 Kudos

809 Views
jeremyzhou
NXP Employee
NXP Employee

Hi Eunseok Jung,

I'm glad to hear that your application demo can work well now.

Thanks for sharing the way to fix this issue
Have a great day,
Ping

-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------

0 Kudos

808 Views
jscott
Contributor II

Hello Eunseok,

Having undergone the exact same exercise with the K10 and AN2295, my advice to you is to use the new Kinetis bootloader instead.  It's much more straightforward, and although I don't think it's been released yet for the K10, it's very easy to port from one of the available versions. 

Kinetis Bootloader|Freescale

Good Luck,

Jonathan

0 Kudos