hi, m attaching my code below. The problem with the code is
Did you use the C8051F350 DK board or the board built by yourself ? If this issue just be reproduced with your own board, upload the schematic will helpful to find out some clue.
And the C2CK will share with the external reset signal pin, you can try to monitor the C2CK/RST pin under case 2.
For the serial communication issue, I think it should has no relation with the debugger, you can reference the example under the folder as below.
After the device resets, could you use Simplicity Studio to connect to the device without resetting it, then pause code execution and look at the RSTSRC register?
This should, at least, tell you what's causing the device to reset.
If it's a pin reset, and you have Simplicity Studio V3 running, it might be that Studio is occasionally pinging the debug adapter for any connected devices. You can disable this device detection in the Studio Preferences: http://community.silabs.com/t5/tkb/articleprintpage/tkb-id/1@tkb/article-id/784
- When the debugger is not physically connected, the controller doesn't resets but serial communication does not work.
Did you maybe forget to connect GND for the serial connection?