Hello Ganesh,
I think you still have not know the bootlaoder clearly.
In the main() function , you should writhe when re-flash the application code ,
and when jump to the application, for example , when press one button .
These all refer to your demand , i still strongly recommend you refer to this DOC:
Kinetis Bootloader to Update Multiple Devices in a Network - for Cortex-M0+
especially the bootloader flowchart, this flowchart is consider overall, of course you
can not consider so much , for example , you can only check whether the SW1 button
pressed .

YOu can also refer to the bootlaoder project of KE02 i have send to you .
Hope it hleps
Have a great day,
Alice
-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------