Reply
Posts: 26
Registered: ‎04-27-2012
Accepted Solution

Connection with 8051 device lost while debugging

[ Edited ]

I'm having problems connecting to my c8051f860 project.  I can connect using the Connect to Si Labs 8051 part and it goes into the debugger with the disassembly window showing and I can step through (although it only steps through the disassembly window, not the source code) and if I put a breakpoint in the source code and hit "resume", then I get a dialog that says "connection with device lost, this is likely due to loss of power or unplugged adapter" although this is not the case.  I can fire up the SiLabs Programming utility program and connect and successfully download my hex file from there, so I know the connection is good. 

 

If I just select the debug speed button, it won't even go into debug mode, I get the message right away with the additional message "read timeout error".  Any clues?  I'm using the SiLabs USB Debug Adapter.  Also I seem to be able to debug another board with an 8051f310 chip on it and step through the source code so it seems to be specific to the c8051f860.

Posts: 8,020
Registered: ‎08-13-2003

Re: Connection with 8051 device lost while debugging

 I can connect using the Connect to Si Labs 8051 part and it goes into the debugger with the disassembly window showing and I can step through (although it only steps through the disassembly window, not the source code)

are you using Simplicity studio, the 'classic' IDE or something else

 

 

 if I put a breakpoint in the source code and hit "resume", then I get a dialog that says "connection with device lost, this is likely due to loss of power or unplugged adapter"

 

do you have something that uses power such as a high intensity LED or a relay, then it could be that when that was activated the power supply is insufficient

erik
Posts: 439
Registered: ‎02-21-2014

Re: Connection with 8051 device lost while debugging

Are you putting the device in suspend mode, or changing the system clock to be extremely slow?

The debugger will lose connection in suspend mode, or if the system clock gets below 30kHz.

 

-Brian

Posts: 26
Registered: ‎04-27-2012

Re: Connection with 8051 device lost while debugging

Thanks for the replies everyone.  Actually, what I did was a very simple experiment to just be able to test the compiler/debugger, so I simply started a new project, didn't configure anything in the chip at all, and put in 3 lines of code that I could just step through.  Perhaps the micro is defaulting to the suspend mode so I'll try and configure the chip to see if that helps.  Could this be the problem?

Posts: 26
Registered: ‎04-27-2012

Re: Connection with 8051 device lost while debugging

Oh, and I am using Simplicity studio.  The board does not have any excessive current draw and I amp actually self powering the board. Also as I mentioned, I can download and run real code onto this board using the SiLabs Flash programmer program.

Posts: 26
Registered: ‎04-27-2012

Re: Connection with 8051 device lost while debugging

OK, i tried a new project and configured the chip for hi speed internal osc and also turned off the watchdog timer, but when I compile and then enter debug mode after about 1 second of the debugger lights coming on (red and yellow) the dialog opens with the same message and then powers down the debugger when I hit ok.

Posts: 8,020
Registered: ‎08-13-2003

Re: Connection with 8051 device lost while debugging

didn't configure anything in the chip at all, and put in 3 lines of code that I could just step through. 

......

OK, i tried a new project and configured the chip for hi speed internal osc and also turned off the watchdog timer,

 

show the code you have

erik
Posts: 26
Registered: ‎04-27-2012

Re: Connection with 8051 device lost while debugging

I found the problem!  The solution was presented by a poster in another thread about the debug adapter.  It turns out that pin 7 of the adapter needs to be pulled up to the micro supply voltage with a 1k resistor.  I've used this adapter with other SiLab micros (8051f310 and 8051f581) without the resistor so never suspected the wiring for the interface was at fault.  This seems to be unique to the 8051f860. 

 

I'm very happy to now have a working debugger, but feel extremely lucky that I stumbled across the problem and urge SiLabs to make this fact more clear in their debug adapter literature.

Posts: 8,020
Registered: ‎08-13-2003

Re: Connection with 8051 device lost while debugging

 It turns out that pin 7 of the adapter needs to be pulled up to the micro supply voltage with a 1k resistor.  I've used this adapter with other SiLab micros (8051f310 and 8051f581) without the resistor so never suspected the wiring for the interface was at fault.  This seems to be unique to the 8051f860. 

 

no it is not. What you see is the difference in leakage between different dies.  You will, most likely, see it happen with the devices that "worked" when you get new devices of the same type from a different fab run.

 

another case of the difference between "works" and works

erik
Posts: 439
Registered: ‎02-21-2014

Re: Connection with 8051 device lost while debugging


Buckethead wrote:

 It turns out that pin 7 of the adapter needs to be pulled up to the micro supply voltage with a 1k resistor.


 

Pin 7 is C2CK, also known as the device's reset pin. This should always have a pull-up resistor on it. Have you left this pin floating on previous devices?

 

-Brian

Highlighted
Posts: 8,020
Registered: ‎08-13-2003

Re: Connection with 8051 device lost while debugging

Pin 7 is C2CK, also known as the device's reset pin

 

didn't even remember this detail.  The OPs luck (in my book not a design criteria) has been even more than I realized.

 

a pullup on reset is mandatory for the released product, if missing on debug it only hurts the developer

erik
Posts: 12
Registered: ‎04-30-2015

Re: Connection with 8051 device lost while debugging

I am having a similar issue. This is my first time programming these MCU's

 

I have a new PCB with 12 x LEDs. It is using the EFM8BB10F8G-QFN20. 

I have 2 connection points on the PCB that connect to the C2D (P6) and C2CK (P5) pins on the MCU.

 

I am using a USB DEBUG ADAPTER. Yesterday I connected and loaded programs without issue. I connected the USB adapter ribbon cable P2 -> GND on the PCB and P4 -> C2D (P6) and P7-> C2CK (P5).

 

I am powering the PCB with a small battery 3.2V. I have tried to program again today and keep getting the same error above. The only thing I can think if is the battery was disconnected and the voltage was low. I changed battery to brand new one and still I have this issue.

 

I use the example Blinky program but when I debug (F11) it compiles and then stops showing the error

"Connection with device lost. This is likely due to a loss of power or unplugged debug adapter"

 

I really appreciate any advice on this issue. I have also swapped the PCB to a new one (I have 10pcs of prototype to work with). But I do not know what else to do? Is my adaptor broken?

 

I have read something about a pullup resistor? But I don't know why it worked yesterday and now not working.

Posts: 8,020
Registered: ‎08-13-2003

Re: Connection with 8051 device lost while debugging

I have a new PCB with 12 x LEDs.

 ...

I am powering the PCB with a small battery 3.2V.

 

Guess 1) you load the battery too much when 12 LEDs are on.  are the LEDs connected Vdd- resistor-pin ot

Gnd - resistor - pin?

 

I have read something about a pullup resistor? But I don't know why it worked yesterday and now not working.

you need a pull-up C2CK and RST.  That it works without is luck, and luck is not a design criteria

erik
Posts: 12
Registered: ‎04-30-2015

Re: Connection with 8051 device lost while debugging

Thanks for your speedy reply.

 

I just checked and I can load the program using the F11 debug command. Robot Happy 

But am still getting the error during this process.

""Connection with device lost. This is likely due to a loss of power or unplugged debug adapter"

 

The LEDs are not connected directly to MCU, the pin from MCU is connected to 5V and are powered separately. I have attached an image.

Posts: 8,020
Registered: ‎08-13-2003

Re: Connection with 8051 device lost while debugging

get those pullups added, and come back with what that did

erik
Posts: 12
Registered: ‎04-30-2015

Re: Connection with 8051 device lost while debugging

Thanks Erik,

 

I have added a 1kOhm resistor to the adaptor pin10 (5VDD) and connected to the C2CK pin10 .

 

I am no longer getting the error , thank you very much.

 

Simplicity Studio is now stopping in debug on the first line after main i.e.

 

   enter_DefaultMode_from_RESET();

 

i can manually step over each line, but how to make it run autocratically?

 

 

Posts: 12
Registered: ‎04-30-2015

Re: Connection with 8051 device lost while debugging

Erik,

 

I am continuing to get this error.  I tried the 1kOhm resistor. Is this correct?

 

1kOhm Resistor

 

 

If the above is correct, I am thinking that i have corrupted somehow the SB Debug Adapter. Is is possible?If yes, is there any software I can use to reset the USB debug adapter?

Posts: 8,020
Registered: ‎08-13-2003

Re: Connection with 8051 device lost while debugging

I can't decipher the plug, both need 1k to VDD

erik
Posts: 439
Registered: ‎02-21-2014

Re: Connection with 8051 device lost while debugging

1k pull-up to 5V? That's generally a bad idea. What MCU are you using? Reset/C2CK should be pulled to VDD instead.

 

-Brian

Posts: 12
Registered: ‎04-30-2015

Re: Connection with 8051 device lost while debugging

The plug is shown in the silicon labs adapter pdf on page 2.

 

http://www.silabs.com/Support%20Documents/TechnicalDocs/8-bit-USB-Debug-Adapter.pdf

 

The pdf only says 1kOhm connected to C2CK. pin 7. and VDD

 

 

adapter cable plug

Posts: 12
Registered: ‎04-30-2015

Re: Connection with 8051 device lost while debugging

I am using EFM8BB10F8G-QFN20

 

Trying to follow the instructions as they are explained in documentation.

 

This USB Debug adaptor is giving me no end of troubles.

 

I have a BusyBee Dev Kit, is it better to use that instead of this troublesome adapter?

Posts: 12
Registered: ‎04-30-2015

Re: Connection with 8051 device lost while debugging

Brian,

 

I just read a couple other posts. (by jrh on ‎11-11-2014 11:12 PM)

http://community.silabs.com/t5/8-bit-MCU-Knowledge-Base/Debug-Header-Connections/tac-p/133907#M8

 

"Adding a 10k pull-down on C2D solved the problem"

Why isn't this "gotcha" mentioned in any of the documentation that I've looked through?

 Why isn't the bias resistor part of the debug adapter in the first place?"

 

So confusing, I just wanted to flash a simple program to this MCU and have spent 2 days on this USB DEBUG adapter. Simplicity Studio it isn't.

Posts: 8,020
Registered: ‎08-13-2003

Re: Connection with 8051 device lost while debugging

there are a number of things, seemingly not related, that will kill your interface

 

1) you MUST have decoupling no more than 10mm from every Vdd pin

2) reset must have pullup and no cap

3) if you have an external crystal, it and the burden caps may not have more than 10mm traces

erik
Posts: 12
Registered: ‎04-30-2015

Re: Connection with 8051 device lost while debugging

Thanks Erik,

 

None of these apply.

 

I think this must relate to a software issue. I am using Simplicity Studio, I can use the FLASH icon to load the hex file, but cannot build/debug in the IDE without the error that it cannot connect.

 

"Connection with device is lost.This is likely to due to loss of power or disconnected debug cable"

 

I am giving up. My first foray into Silicon Labs MCU's and related software and not enjoying it at all.

 

I have PM you. Let me know if you have read.

 

 

 

Posts: 8,020
Registered: ‎08-13-2003

Re: Connection with 8051 device lost while debugging

[ Edited ]

post a link to schematic and COMPLETE layout

 

what you are doing works for "everybody else'

 

are you using a C2 adapter or an EFM8 board or a toolstick?

 

Windows, Mac or Linux?

 

how do you power the board?

erik
Posts: 8,020
Registered: ‎08-13-2003

Re: Connection with 8051 device lost while debugging

[ Edited ]

I have added a 1kOhm resistor to the adaptor pin10 (5VDD) and connected to the C2CK pin10 .

 

this is a recollection, not certain but

I tend to recall that not all adapters supply the VDD to pin10

also, do not connect 3V3 device port pins to 5V without making certain they are 5V tolerant (see datasheet)

 

move the pullup to your Vdd.and come back with the result and answers to the above post

 

another faint recall is that the adapter monitor the Vdd on that pin

erik
Posts: 12
Registered: ‎04-30-2015

Re: Connection with 8051 device lost while debugging

I am using Windows 8 on a laptop. My PCB is being powered by a battery 3.2V battery (also I have used desktop power supply for 3.2V)

 

I am using the following:

 

Simplicity Studio

Silicon Labs USB Debug Adapter (C2 adapter)

My PCB with C2D-P2.0 (pin 6)/C2CK (pin 5)

 

 

I am connecting with 10pin header from USB Debug Adapter and connect the pins to the PCB as shown above.

Posts: 8,020
Registered: ‎08-13-2003

Re: Connection with 8051 device lost while debugging

you do not mention ground

erik
Posts: 12
Registered: ‎04-30-2015

Re: Connection with 8051 device lost while debugging

Hello Erik,

 

yes i did show GND. look at image above.

 

Pin2 is connected to GND on my PCB (BATT-)

Posts: 8,020
Registered: ‎08-13-2003

Re: Connection with 8051 device lost while debugging

yes i did show GND. look at image above.

 

I work with many things and do not, usually remember the contents of previous posts, You, however (should) have it all in your head.

 

NOW, before anything else get that 1k0 moved to your Vdd and verify in the datasheet  that the pin was 5V tolerant

erik
<a href="http://community.silabs.com/t5/Welcome-and-Announcements/Community-Ranking-System-and-Recognition-Program/m-p/140490#U140490"><font color="#000000"><font size="2">Hero</font></font> </a> jmg
Posts: 1,123
Registered: ‎04-27-2004

Re: Connection with 8051 device lost while debugging


Leeman wrote:

Simplicity Studio is now stopping in debug on the first line after main i.e.

   enter_DefaultMode_from_RESET();

i can manually step over each line, but how to make it run autocratically?



I'm not sure what you mean by run autocratically, but any Debug system can set break points, and has a GO or RUN button.

In SS that is a large green icon arrow, called (a little cryptically) Resume, that is active after you do a Reset Target.

 


Leeman wrote:

I am using EFM8BB10F8G-QFN20

Trying to follow the instructions as they are explained in documentation.

This USB Debug adaptor is giving me no end of troubles.

I have a BusyBee Dev Kit, is it better to use that instead of this troublesome adapter?


Above you mentioned different parts, but yes, if you are using EFM8BB10F8G then by all means use

Busy Bee Dev Kit, as that puts you on a proven / much traveled pathway.

 

That has on, and off-board, debug modes, and you can always flip to on-board to confirm you have a "working connection".

 

 

 

Posts: 14
Registered: ‎11-29-2016

Re: Connection with 8051 device lost while debugging

Hi guys,

 

I want to add my experience with this issue at the debugging process. I was working with an EFM8BB custom board when I got the same error message several times.

 

In my case, I had a capacitor in the pull-up (with the 1Kohm resistor) to C2CK which resets the debugger everytime. This line must never have a capacitor!!

 

This post was useful for me so I want to share how I solved my issue.

 

Best regards,

 

Manuel