Hi Lan,
Double check your question again.
Do you mean, the code already download to the board, then when the debugger is connect, the code can run, if you remove the debug, the code can't run?
Or, do you mean, when in debug mode, the app can works, when you exit debug mode, just download the code to the board, it can work?
Please confirm it.
Besides, please check you are using RAM or FLASH? And your hardware, RESET pin need to have external pull up and 0.1uf capacitor to ground.
Please try the debug code instead of release code.
Have a great day,
Kerry
-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------