• AVR Freaks

Helpful ReplyHot!The target device is not ready for debugging.

Page: 12 > Showing page 1 of 2
Author
mark_dubo
Starting Member
  • Total Posts : 35
  • Reward points : 0
  • Joined: 2013/07/24 04:52:55
  • Location: 0
  • Status: offline
2013/08/08 01:39:56 (permalink)
0

The target device is not ready for debugging.

Hi,
I'm working on a small project using a PIC32MX250F128D, XC32 compiler, MPLAB X v1.85 and an ICD3. I have a lot of experience with PIC18 series devices with MPLAB 8 and Hi-Tech PICC18 compiler but this is my first time with the PIC32 and MPLAB X.
 
At the moment all I am trying to do is wiggle an IO line. I have a very simple project and it compiles and builds fine. However when I try to debug I get the following messages:
Programming...
Programming/Verify complete
The target device is not ready for debugging. Please check your configuration bit settings and program the device before proceeding.

 
I have checked over my configuration code but I cannot see anything wrong. The configuration code is as follows:
 

// DEVCFG2
#pragma config FPLLIDIV = DIV_2         // PLL Input Divider (2x Divider)
#pragma config FPLLMUL = MUL_20         // PLL Multiplier (20x Multiplier)
#pragma config FPLLODIV = DIV_1         // System PLL Output Clock Divider (PLL Divide by 1)
// DEVCFG1
#pragma config FNOSC = PRIPLL           // Oscillator Selection Bits (Primary Osc w/PLL (XT+,HS+,EC+PLL))
#pragma config FSOSCEN = OFF            // Secondary Oscillator Enable (Disabled)
#pragma config IESO = OFF               // Internal/External Switch Over (Disabled)
#pragma config POSCMOD = HS             // Primary Oscillator Configuration (HS osc mode)
#pragma config OSCIOFNC = ON            // CLKO Output Signal Active on the OSCO Pin (Enabled)
#pragma config FPBDIV = DIV_8           // Peripheral Clock Divisor (Pb_Clk is Sys_Clk/8)
#pragma config FCKSM = CSDCMD           // Clock Switching and Monitor Selection (Clock Switch Disable, FSCM Disabled)
#pragma config WDTPS = PS1048576        // Watchdog Timer Postscaler (1:1048576)
#pragma config FWDTEN = OFF             // Watchdog Timer Enable (WDT Disabled (SWDTEN Bit Controls))
// DEVCFG0
//#pragma config DEBUG = OFF              // Background Debugger Enable (Debugger is disabled)
#pragma config ICESEL = ICS_PGx1        // ICE/ICD Comm Channel Select (ICE EMUC1/EMUD1 pins shared with PGC1/PGD1)
#pragma config PWP = OFF                // Program Flash Write Protect (Disable)
#pragma config BWP = OFF                // Boot Flash Write Protect bit (Protection Disabled)
#pragma config CP = OFF                 // Code Protect (Protection Disabled)
//ICE/ICD Comm Channel Select:
#pragma ICESEL = ICS_PGx1       //Communicate on PGEC1/PGED1
//Watchdog Timer Enable:
#pragma FWDTEN = OFF            //WDT Disabled (SWDTEN Bit Controls)
//Background Debugger Enable:
#pragma DEBUG = ON              //Debugger is Enabled
//USB USID Selection:
#pragma FUSBIDIO = ON           //Controlled by the USB Module
//USB VBUS ON Selection:
#pragma FVBUSONIO = ON          //Controlled by USB Module

 
Can anyone see anything doing wrong? Or anything I am omitting?
Thanks,
Mark
#1
DEKTRON
Super Member
  • Total Posts : 1183
  • Reward points : 0
  • Joined: 2003/11/07 12:35:05
  • Location: Calne, Wiltshire, England
  • Status: offline
Re:The target device is not ready for debugging. 2013/08/08 20:12:45 (permalink)
+2 (2)
You do have the ICD3 connected to the physical pins for PGEC1 and PGED1? There are other pin pairs that can be used for programming, check the pinout on the data sheet and confirm the ICD3 is connected to the correct pins. Check the oscillator is running and has Xtal connected to the pins?
#2
mark_dubo
Starting Member
  • Total Posts : 35
  • Reward points : 0
  • Joined: 2013/07/24 04:52:55
  • Location: 0
  • Status: offline
Re:The target device is not ready for debugging. 2013/08/09 01:03:19 (permalink)
0
Hi Dektron, thanks for your reply.
The ICD3 is connected to the correct pins and the oscillator is running (8MHz). The part appears to program as I get the message "Programming/Verify complete" but this is followed by the not ready for debugging message. Even though the part appears to program, it does not seem to run (the pin does not 'wiggle'). I have programmed the exact same code onto a PIC32 starter kit and it runs fine - though this does not use the ICD3.
 
I'm really at a loss now and cannot proceed with the project any further. [8D]
#3
JorgeF
Super Member
  • Total Posts : 3345
  • Reward points : 0
  • Joined: 2011/07/09 11:56:58
  • Location: PT/EU @ Third rock from the Sun
  • Status: offline
Re:The target device is not ready for debugging. 2013/08/09 03:13:52 (permalink)
0
Hi
 
I never used a PIC32 device, but this kind of behaviour points to settings that are incompatible with in circuit debugging.
Check out the ICD3 documentation for limitations / conditions needed for debugging.  
Search for things like Watchdog timers, power up delays, MCLR pin and so on.
 
EDIT:
On a second review of your settings I noticed that you have "DEBUG = ON".
I'm not sure for PIC32, but for PIC16/18 this fuse must be left allways OFF, the debugger tools (Pickit3, ICD3,...) will handle it as required.
 
 
 
Best regards
Jorge
 
 
post edited by JorgeF - 2013/08/09 03:15:42
#4
DEKTRON
Super Member
  • Total Posts : 1183
  • Reward points : 0
  • Joined: 2003/11/07 12:35:05
  • Location: Calne, Wiltshire, England
  • Status: offline
Re:The target device is not ready for debugging. 2013/08/09 21:03:47 (permalink) ☄ Helpfulby charlestrep91 2015/04/07 14:28:35
+2 (2)
I agree with Jorge the DEBUG bit does not have to be set in code as it is controlled by MPLAB depending if you click the debug or the run button... but then you have it commented out so that's OK.
Try build, then window>Pic Memory View, Config Bits, confirm the bits are set as intended...

Re "The ICD3 is connected to the correct pins" there is more than one pair of "correct pins", did you specifically make sure the physical pins match those selected in the config bit setting for the debug pins pair as PGEC 1? If not you may need to change the programming of the config bits to debug.

The pin won't wiggle if you get the "not ready to debug" message, because the chip is not running.
For another test, try click program/run button instead of the debug button and see if the OP pin wiggles then, if so your code is OK.
#5
mark_dubo
Starting Member
  • Total Posts : 35
  • Reward points : 0
  • Joined: 2013/07/24 04:52:55
  • Location: 0
  • Status: offline
Re:The target device is not ready for debugging. 2013/08/13 04:07:08 (permalink) ☄ Helpfulby apoorva 2016/01/19 06:57:20
0
Hi guys, thanks for your replies and sorry for taking so long to respond.
I have looked through the documentation for the ICD3 and cannot find anything wrong in my configuration set up. I changed the debug config to "DEBUG = OFF" but that didn't help. The only thing I see that may be a problem is that I am powering the device from the ICD3. The documentation states that "The target device must have power and a functional, running oscillator." However it does not state whether this power can be supplied by the ICD3. I cannot try powering externally until I get a new PCB.

There is no program/run button in MPLAB X. The only options are "Make and program device Main project", Program device for Debugging Main project" and "Debug Main project".  I have tried just programming the device but it does not appear to run (although the crystal runs). I compiled the same project for the PIC32 started kit and it programs and runs fine so I know the code is fine. >_<
#6
JMH08
Super Member
  • Total Posts : 440
  • Reward points : 0
  • Joined: 2008/02/11 14:19:16
  • Location: 0
  • Status: offline
Re:The target device is not ready for debugging. 2013/08/23 13:58:52 (permalink)
0
There is no problem with powering the target from the ICD3 as long as the circuit does not require more power than can be supplied through USB. I doubt that is your problem, but if you can externally power the circuit, you might try it.
 
The debug setting doesn't have anything to do with you problem either. Regardless of what you set it to, the firmware on the ICD3 will take control of it and set it appropriately depending on whether you Make and Program the device or Debug the project.
 
The three most common reasons for this error are:
1. The oscillator setting. I would suggest changing your oscillator setting to use the internal oscillator and see if you can get into debug mode that way. If you can then there is something wrong with your oscillator.
 
2. The PGC/PGD pins. I know that this has been addresses by others in the forum, but please make sure that your PGC/PGD configuration selections match the pins that the ICD3 is physically connected to.
 
3. There is a load on the PGC and/or PGD pin(s) that interferes with controlling those lines. If you have any loads at all on either of those two lines, it may interfere with communication between the ICD3 and the target.
#7
mark_dubo
Starting Member
  • Total Posts : 35
  • Reward points : 0
  • Joined: 2013/07/24 04:52:55
  • Location: 0
  • Status: offline
Re:The target device is not ready for debugging. 2013/08/23 14:14:22 (permalink)
0
Hi JMH08 thanks for your reply.
I have redesigned the board for the client as it was very poorly laid out, so at the moment I am waiting on the new pcbs getting fabricated and populated.
 
  1. Good suggestion, I will try that when I have the hardware.
  2. I checked this and they did match. Also, MPLAB was reporting that programming was successful. I think this proves the pins match.
  3. As far as I recall (I don't have the hardware in front of me now), the programming header was very close and I could see the tracks going directly from the header to the pins and nowhere else.
Thanks
 
Mark
#8
narender64
New Member
  • Total Posts : 2
  • Reward points : 0
  • Joined: 2013/09/14 01:27:43
  • Location: 0
  • Status: offline
Re:The target device is not ready for debugging. 2013/09/14 01:38:29 (permalink)
+2 (2)
 I am facing the same problem with my setup,  running in program mode not running in debug mode
My setup
MPLAB X IDE v1.85, xc16 compiler, device 28 pin PDIP  33FJ16GS502. debugger Pik Kit 3. no special h/w like debug header
using internal fast RC oscillator, able to run my simple port toggle program in program mode, but unable to run in debug mode.
getting the error message 
Programming/Verify complete
The target device is not ready for debugging. Please check your configuration bit settings and program the device before proceeding.
My problem is resolved.
Solved.
I did a mistake of using PGD3,PGC3 in the hardware and by mistake configured PGC1,PGD1 in the program.
once corrected in the configuration bits , I am able to debug now.
Thanks to excel point engineer , for making me realize my mistake.
Narender Rao S, 
 
post edited by narender64 - 2013/09/19 04:45:46
#9
CCP1CON
Super Member
  • Total Posts : 469
  • Reward points : 0
  • Joined: 2007/04/15 12:49:28
  • Location: good old Germany
  • Status: offline
Re:The target device is not ready for debugging. 2013/09/15 19:31:37 (permalink)
+1 (1)
I think to remember the same problem.
Try to increase the supply voltage slightly (within the allowed range).
If I'm not mistaken, it helped here.

#10
XTi
New Member
  • Total Posts : 5
  • Reward points : 0
  • Joined: 2013/09/27 00:06:10
  • Location: 0
  • Status: offline
Re:The target device is not ready for debugging. 2013/09/27 00:27:07 (permalink)
0
 
I had the same kind of problem this week.
I've found that change the firmware of the ICD3 solve my problem.
MPLABX 1.9 with PIC16LF1938.
 
This version doesn't works for me: 01.29.08
This one solve my problem: 01.28.02
 
#11
Ian.M
Super Member
  • Total Posts : 13268
  • Reward points : 0
  • Joined: 2009/07/23 07:02:40
  • Location: UK
  • Status: offline
Re:The target device is not ready for debugging. 2013/09/27 01:19:05 (permalink)
+2 (2)
N.B. Don't try to use different text colours in the forum editor here - the feature is totally BORKED! sad It is possible to get coloured text if you manually type the BBCODE color tags ..... wink
post edited by Ian.M - 2013/09/27 01:22:34
#12
mark_dubo
Starting Member
  • Total Posts : 35
  • Reward points : 0
  • Joined: 2013/07/24 04:52:55
  • Location: 0
  • Status: offline
Re:The target device is not ready for debugging. 2013/10/09 06:44:38 (permalink)
0
Hi Guys,
So I'm finally back to work on this project. I have found what the problem was. My PLL settings were not correct. I am using an 8MHz crystal and I had the PLL divider set to 2 and the multiplier set to 20 - to give me a system clock of 80MHz. I think the max clock frequency allowed on this chip is 72MHz so when I changed the multiplier to 18 it worked.
 
But is it working correctly??? This I am not sure about. I had a very simple program that only toggles a pin continuously. Here is the code:

while(1)
{
         mPORTAToggleBits(BIT_7);
}

 
The pin is toggling every 70ns. I expected it to to toggle faster with a system clock of 72MHz. Does this sound correct?
 
Mark
#13
UFAnders
New Member
  • Total Posts : 11
  • Reward points : 0
  • Joined: 2010/05/28 10:28:11
  • Location: San Francisco
  • Status: offline
Re:The target device is not ready for debugging. 2015/08/30 12:45:32 (permalink)
+1 (1)
Hey all, I have been fuming over this issue myself! I finally got my debugger to run by changing the following CONFIG bit:
 
#pragma config ICESEL  = ICS_PGx4
 
There is no PGED4 on this chip but this setting works. I'm using MPLABX v3.05 and XC32 1.32.

--
Anders Nelson
Microchip FAE 2008-2011
#14
NorthGuy
Super Member
  • Total Posts : 6223
  • Reward points : 0
  • Joined: 2014/02/23 14:23:23
  • Location: Northern Canada
  • Status: online
Re:The target device is not ready for debugging. 2015/08/30 15:26:18 (permalink)
+1 (1)
UFAnders
There is no PGED4 on this chip but this setting works.




There is, on pins 12 and 13.
#15
dynaco
New Member
  • Total Posts : 7
  • Reward points : 0
  • Joined: 2004/06/16 06:40:05
  • Location: Israel
  • Status: offline
Re:The target device is not ready for debugging. 2015/10/28 09:15:51 (permalink)
+1 (1)
got this error. 
spent 30 minutes for understanding
found that my cable from ICD3 to target was very long (1m - not original)
it was sufficient to programm but causes problems during debug. 
 
#16
GeorgePauley
Moderator
  • Total Posts : 1261
  • Reward points : 0
  • Joined: 2009/12/01 13:59:30
  • Location: Chandler AZ
  • Status: offline
Re:The target device is not ready for debugging. 2015/10/28 12:18:48 (permalink)
+2 (2)
Yep, the clock and data lines in the cable can cross-talk with each other, especially in noisy environments like high voltage EMF, high clock speeds, or even dirty ground.  (This goes all the way back to a decision made by a third party contractor over 15 years ago, <sigh>).  I think there are some vendors who offer very nice, but pricey, replacement cables.  (But my Google searches failed to find them.)  Or you can just use a shorter cable.  I used to have a custom made 3" cable back when I was working on ICD2.  LoL: LoL
#17
brownt
Super Member
  • Total Posts : 296
  • Reward points : 0
  • Joined: 2015/11/21 14:58:09
  • Location: 0
  • Status: offline
Re: The target device is not ready for debugging. 2016/05/24 13:55:28 (permalink)
0
I get this problem  when the "debugging variables window" is floating rather than docked to the main MPLAB X IDE. I close the windows and reopen it and the problem is gone for one session.
#18
Lawrence.Miller
New Member
  • Total Posts : 8
  • Reward points : 0
  • Joined: 2014/08/03 17:15:08
  • Location: 0
  • Status: offline
Re: The target device is not ready for debugging. 2016/11/21 18:57:35 (permalink)
0
I have the issue with a “PIC32 MZ with FPU Embedded Connectivity Starter Kit”, PIC32MZ2048EFH144
 
I select “Clean and Build for Debugging Main Project”. Build completes without errors.
 
I select “Program Device for Debugging Main Project”. Here is the error message at the end, which is in red text.
 
Programming/Verify complete
The target device is not ready for debugging. Please check your configuration bit settings and program the device before proceeding. The most common causes for this failure are oscillator and/or PGC/PGD settings.
 
Here are the versions of the software development tools.
 
MPLAB X IDE v3.45
XC32 v1.42
Harmony v1.09
 
Any ideas?
#19
qhb
Superb Member
  • Total Posts : 9999
  • Reward points : 0
  • Joined: 2016/06/05 14:55:32
  • Location: One step ahead...
  • Status: offline
Re: The target device is not ready for debugging. 2016/11/21 19:11:55 (permalink)
+1 (1)
Lawrence, have you read the earlier responses in this topic?
If it is programming ok, but not debugging, then it's most likely one of:
[1] Your CONFIG words specify a different set of PGEC/PGED pins than what you are physically connected to
[2] Your clock settings are bad, so the PIC cannot run
 
#1 will only affect debugging. #2 would prevent your PIC running at all, even in Release mode.
 
#20
Page: 12 > Showing page 1 of 2
Jump to:
© 2020 APG vNext Commercial Version 4.5