NRF52DK cannot connect with "idcode not detected"

I am playing with the nrf52dk with saadc using the example code from github "nRF52-ADC-examples/main.c at master · NordicPlayground/nRF52-ADC-examples · GitHub"

Since at first the log didn't print through UART, I've modified some config file to set log level to 4 and enabled the log.

After that the program runs well and I'm able to read the output of SAADC. However I cannot connect to the onboard Jlink anymore. The segger studio shows "idcode not detected"

Here's what I have tried since then:

Reboot the system, change socket and cable, use "nrfjprog -recover", use nrf connect to erase the chip.

All of these failed and I still cannot connect to the board. The program is still running and I can receive readings through UART but I can never connect to it anymore