J-Link Disconnects Randomly When Uploading & Debugging


(Jesse) #1

I have a HiFive1 Rev B
I am using Freedom Studio on Windows 10 with the hello and welcome examples.

I am experiences several issues where the device will randomly disconnect when uploading and debugging.

I have wiggled the usb cable on both ends and that does not cause this issue.
I have tried multiple USB cables.
I have tried multiple USB ports.
This is running on my desktop via USB 3.
The CPU is not reset when this disconnect and reconnect happens

Uploading:
It appears at least when uploading it should disconnect and reconnect once but sometimes when it does it gives a j-link error:


------Target related settings------
Target device: FE310
Target interface: JTAG
Target interface speed: 1000kHz
Target endian: little

Connecting to J-Link…
WARNING: Out of sync , resynchronizing…
WARNING: Out of sync , resynchronizing…
WARNING: Out of sync , resynchronizing…
Connecting to J-Link failed. Connected correctly?
GDBServer will be closed…
Shutting down…
Could not connect to J-Link.
Please check power, connection and settings.

Debugging:
One issue I am experiencing an issue where when I try to debug it, it says it reached a breakpoint at 0x0 and the option to continue debugging is greyed out but I can see the LEDs changing so the CPU is running.
It will also just randomly disconnect and reconnect when debugging meaning that I have to restart the gdb session

Finally:
Sometimes with everything closed but just having it plugged into my desktop it randomly disconnects and reconnects.

I have not found a way to reliably reproduce these errors but waiting long enough and re-running enough times does reproduce them.
Any help would be appreciated, thanks.