Hi,
I do a test with TWR-K22F120M board using KDS 2.0 with attached project, which just toggle a led on tower board (the EZPORT function is disabled in FOPT).
I don't meet your mentioned issue with/without debug. The led toggle normally when board power up.
I would recommend customer to check if Flash be programmed or not at first.
Then customer need to check the K22 power circuit, if the VDD rising edge is very sharp.
Customer could refer TWR-K22F120M board schematics K22 VDD related circuit.
Wish it helps.
BTW: If customer want to use attached project, customer need to comment below code at <cpu.c> file line 252 before debug/program K22.
/* MPU_CESR: SPERR=0,VLD=0 */
// MPU_CESR &= (uint32_t)~(uint32_t)((MPU_CESR_SPERR(0x1F) | MPU_CESR_VLD_MASK));
Have a great day,
best regards,
Ma Hui
-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------