Hello, I am working on a custom board that has Kinetis K28F (MK28FN2M0AVMI15) on it. The platform that we are developing software is MCUXpresso IDE V11.0.1.We are at the beginning of the software development process; therefore, we are still trying to use SDK examples provided for the FRDM-K28F development board as a template. It was working fine that we could successfully verify our boards by using PEMicro Multilink but we could not program the flash by using GUI Flash Tool. I thought it is because the oscillator frequencies of our board and the FRDM board are different and I modified the clock settings of the SDK 2.6 Led Blinky example. I changed the oscillator frequency to 24Mhz and the mode to HighGainMode inside the clock_config.c file. I also added an oscillator feedback resistor to my board. Then I could program my board and observe the oscillator output by scope. It was good until here but then I can no longer connect to the board. When I try to debug them in MCUXpresso I get the messsage "An error occured while connecting to the interface hardware or target specified in the Launch Configuration Dialog. For this launch, you may retry/re-specify the connection with the following parameters:" I can still successfully connect and debug my other boards whose flash is not programmed yet. Do you have any suggestions about this issue?
Please refer: How To Sucessfully Program a Custom made Kinetis Microcontroller Board.(If this doesn't work, then please try to use the P&E recovery utility mentioned in Bricking and Recovering FRDM-KL25Z Boards: Reset, SWD Clock and Low Power.)
Check the hardware circuit of your custom board.
Since you are using the MCUXpresso IDE, step8 be replaced by resurrect locked Kinetis device in GUI Flash Tool.
Thank you for your detailed answer. I couldn't use the Recovery Tool but I found my solution in the comments of Erich's post. I pulled NMI pin to low before boot up and I could successfully erase the flash by using GUI Flash Tool. Then, I could debug it with our test code.