View previous topic :: View next topic |
Author |
Message |
Matt Que
Joined: 16 Nov 2009 Posts: 14
|
ICD-U64 Stopped Working as a debugger in PCW IDE |
Posted: Sun Jul 01, 2012 8:43 pm |
|
|
After opening and auditing the "Device Editor" for my MCU (PIC24HJ128GP306) I lost ICD debugging functionality. I believe I have inadvertently corrupted my device settings by saving the incorrect #fuses during the prompt. I enable debugging through the CCS IDE and the MCU loads the code, but at the bottom of the debugging window, it states "Not Ready" in red. If I disable the debugging function in the IDE, recompile, then load via ccsload app, the code loads but displays a verification error.
The verification error displayed is the following:
Configuration Fuses: 8H ACTUAL:0000 EXPECTED:00FF
The code runs but, I have lost ICD functionality and not through the IDE.
I am running a PIC24H development kit and IDE Version 4.134.
My ICD is an ICD-U64 at firmware 2.93 Rev 2
Code: | #build(stack = 256)
#device ICD=TRUE
#FUSES DEBUG //Debug mode for use with ICD
#fuses HS,NOWDT,PR
#use delay(crystal=20M, clock=40M)
#use rs232(UART2, PARITY=N, BITS=8, STOP=1, ERRORS)
#word U2BRG = 0x238
#bit U2BRGH = 0x230.3
char T;
void main()
{
U2BRGH = 0;
U2BRG = 10; // sets 115200 Baud, -1.4%
while(TRUE)
{
T = getchar(); // Puts Input BYTE from AP_IN UART Port and copies it to a variable
putc(T);
}
} |
I have read through the forum and read the Microchip guidelines but I didn't have any success for those suggestions.
Any insight is greatly appreciated! |
|
|
Matt Que
Joined: 16 Nov 2009 Posts: 14
|
|
Posted: Mon Jul 02, 2012 9:24 pm |
|
|
Just an update...
I contacted CCS today and they emailed me the device database for 4.134 IDE just in case it was corrupted. I reloaded the compiler database and still do not have ICD functionality when compiling with debugging enabled.
Any insight? Should I try uninstalling the ICD drivers and reinstalling or is this a fuse configuration issue?
Thanks |
|
|
temtronic
Joined: 01 Jul 2010 Posts: 9269 Location: Greensville,Ontario
|
|
Posted: Tue Jul 03, 2012 3:02 pm |
|
|
Have you tried another PIC or at least 'wiping out' all the fuse information (resetting to all 0xFF) on the 'problem' PIC.
I don't use the ICD as I always test in the real world..but..resetting the all PICs fuses to default _might_ bring back ICD for you??
hth
jay |
|
|
Matt Que
Joined: 16 Nov 2009 Posts: 14
|
|
Posted: Wed Jul 04, 2012 10:47 am |
|
|
Thanks temtronic for the suggestion. I am not aware of how to wipe out all the fuse information opposed to going into ccsload and selecting 'erase chip'.
I have learned a little bit more about the problem...
I backed up my PICC/PROJECT folder.
I uninstalled the IDE, CCSLOAD and CCS UPDATE. I didn't go back into the PICC installation folder and delete all the contents.
I re-installed via the CD then updated to the latest revision.
Problem still existed.
However...
If I open a PJT file that was previously compiled with an older version of the compiler (IDE 4.116, the version prior upgrading), the debugger runs and operates as expected in IDE 4.134. If I recompile that same exact code in the current version installed (IDE 4.134), the ICD shows not ready after the ICD loads to the target chip and the ICD doesn't function.
I don't know how to audit what the IDE is doing with the fuses once it compiles the code... is it buried in the .lst file? Are there any settings available in the CCS IDE that may be incorrect for the ICD?
Are there people out there successfully using an ICD-U64 with IDE 4.134? And a PIC24H? |
|
|
Matt Que
Joined: 16 Nov 2009 Posts: 14
|
|
Posted: Wed Jul 04, 2012 11:24 am |
|
|
I tried rolling back my IDE version to 4.118 (the only other version I had) and I got ICD functionality back!!!!
There have been a ton of bug fixes between 4.118 to 4.134. Does CCS have a directory you can get to that allows you to roll back to a previous version or do I need to contact them? |
|
|
temtronic
Joined: 01 Jul 2010 Posts: 9269 Location: Greensville,Ontario
|
|
Posted: Wed Jul 04, 2012 12:11 pm |
|
|
I've learned from past 'experience' to install each version of the compiler in it's own folder(PCM4100,PCM4101,PCM4102,etc) not just 'upgrade' into the default location. Yes, it can be a pain, but then it allows you to go back to what was working....Yes, you'll end up with a zillion files but heck harddrives are HUGE nowadays.
I'm pretty sure if you contact CCS and have a current account, they'll allow you to download past versions of the compiler. Heck, never hurts to ask ! They've been very nice to me over the past 15+ years.
As a general rule, I do not upgrade any software unless I really have to.If it's working for you WHY upgrade? |
|
|
Matt Que
Joined: 16 Nov 2009 Posts: 14
|
|
Posted: Thu Jul 05, 2012 3:23 pm |
|
|
Digging deeper... I found when I compile the same .c code in V4.118 versus V4.134, the fuses are different.
It appears V4.134 is compiling the ICD debug as FFFF while V4.118 is
compiling it as 0000...
NON-WORKING.... V4.134
Code: | 020C8: BRA 20C8
Configuration Fuses:
Word 1L: 00CF NOWRTB NOBSS NORBS
H: FF00
Word 2L: 00CF NOWRTSS NOSSS NORSS
H: FF00
Word 3L: 0007 NOWRT NOPROTECT
H: FF00
Word 4L: 0082 PR IESO
H: FF00
Word 5L: 00C6 HS NOOSCIO
H: FF00
Word 6L: 005F WPOSTS16 WPRES128 WINDIS NOWDT
H: FF00
Word 7L: 00E0 NOPUT
H: FF00
Word 8L: 0043 ICSP1 NOJTAG DEBUG
H: FFFF
Some fuses have been forced to be compatible with the ICD debugger. |
*************************************************************************************************************************
WORKING V4.118
Code: |
Configuration Fuses:
Word 1L: 00CF NOWRTB NORBS
H: 0000
Word 2L: 00CF NOWRTSS NORSS
H: 0000
Word 3L: 0007 NOWRT NOPROTECT
H: 0000
Word 4L: 0082 PR IESO
H: 0000
Word 5L: 00C6 HS NOOSCIO
H: 0000
Word 6L: 005F WPOSTS16 WPRES128 WINDIS NOWDT
H: 0000
Word 7L: 00E0 NOPUT
H: 0000
Word 8L: 0043 ICSP1 NOJTAG DEBUG
H: 0000
Some fuses have been forced to be compatible with the ICD debugger. |
So how do I make 4.134 compile and output the correct fuses from the c file? I am kinda concerned that none of the fuses match...
How do I decode the fuses? Are they listed in the Microchip datasheet? Sorry for the newbie questions but stuck here.
Thanks |
|
|
temtronic
Joined: 01 Jul 2010 Posts: 9269 Location: Greensville,Ontario
|
|
Posted: Thu Jul 05, 2012 5:25 pm |
|
|
yes, all the 'fuses' info is in the datasheet..I think under 'config'...been awhile since I actually had to read up on them..
If you're using MPLAB, you can configure the fuses from a menu/submenu and have _that_ configuration override the compiler's config.
Sorry for the lack of proper wording, I'm an old teletype/assembler guy
NOT a Windows IDE guru ! |
|
|
Matt Que
Joined: 16 Nov 2009 Posts: 14
|
Using ICD-64U with HS & PR_PLL fuses |
Posted: Sun Mar 24, 2013 2:23 pm |
|
|
I am still having some issues with using the ICD-64U in a debugger role still. I can get the code to run as expected on the target chip when programmed but when I recompile with DEBUG mode enabled, the code doesn't perform in the same manner.
I wrote a very basic program that flashes an LED at 1hz which it does if code loaded via the CCSLOAD Utility:
Code: |
#include <24HJ128GP306.h>
//#device ICD=TRUE
#FUSES WPRES32 //Watch Dog Timer PreScalar 1:32
#FUSES WPOSTS1 //Watch Dog Timer PostScalar 1:1
#FUSES PROTECT_HIGH //General Segment Code Protect High Security
#FUSES HS //High speed Osc (> 4mhz for PCM/PCH) (>10mhz for PCD)
#fuses PR_PLL
#FUSES CKSFSM //Clock Switching is enabled, fail Safe clock monitor is enabled
#FUSES NOWINDIS //Watch Dog Timer in Window mode
//#FUSES DEBUG //Debug mode for use with ICD
#use delay(crystal=20M,clock=80M)
void main()
{
setup_spi( FALSE );
setup_spi2( FALSE );
set_tris_B(0b1111111111001011);
setup_timer1(TMR_DISABLED|TMR_DIV_BY_1);
While(true)
{
output_high(pin_B2);
delay_ms(1000);
output_low(pin_B2);
delay_ms(1000);
}
} |
When I try to run the code via the CCS IDE in DEBUG mode, the code loads and says "Ready MCU at 7.47 MHz"... not the 80MHz as intended. When I start the code via the debugger interface, it says it is running but doesn't execute the flashing LED.
Here are the fuses as compiled with DEBUG Mode Enabled:
Code: |
Configuration Fuses:
Word 1L: 00CF NOWRTB NOBSS NORBS
H: FF00
Word 2L: 00CF NOWRTSS NOSSS NORSS
H: FF00
Word 3L: 0007 NOWRT NOPROTECT
H: FF00
Word 4L: 0080 FRC IESO
H: FF00
Word 5L: 0006 HS NOOSCIO CKSFSM
H: FF00
Word 6L: 0000 WPOSTS1 WPRES32 NOWINDIS NOWDT
H: FF00
Word 7L: 00E0 NOPUT
H: FF00
Word 8L: 0043 ICSP1 NOJTAG DEBUG
H: FF00
Some fuses have been forced to be compatible with the ICD debugger.
|
Here are the fuses as compiled with DEBUG Disabled.
Code: |
Configuration Fuses:
Word 1L: 00CF NOWRTB NOBSS NORBS
H: FF00
Word 2L: 00CF NOWRTSS NOSSS NORSS
H: FF00
Word 3L: 0003 NOWRT PROTECT_HIGH
H: FF00
Word 4L: 0080 FRC IESO
H: FF00
Word 5L: 0006 HS NOOSCIO CKSFSM
H: FF00
Word 6L: 0000 WPOSTS1 WPRES32 NOWINDIS NOWDT
H: FF00
Word 7L: 00E7 PUT128
H: FF00
Word 8L: 00C3 ICSP1 NOJTAG NODEBUG
H: FF00
|
Any insight on how to get DEBUGGER / ICD functionality would be greatly appreciated as I am losted.('')
I am using compiler:
CCS PCD C Compiler, Version 4.141, 3127
ICD-64U with software 4.040 / FW:2.95 and Hardware version 2.
The hardware is the CCS PIC24H Protoboard.
Thanks All |
|
|
dyeatman
Joined: 06 Sep 2003 Posts: 1941 Location: Norman, OK
|
|
Posted: Sun Mar 24, 2013 4:45 pm |
|
|
I have seen the same issue with mine but confirmed the oscillator was
running at full speed and I have had no outward problems. _________________ Google and Forum Search are some of your best tools!!!! |
|
|
Douglas Kennedy
Joined: 07 Sep 2003 Posts: 755 Location: Florida
|
|
Posted: Mon Mar 25, 2013 10:21 am |
|
|
I have a similar problem with the 24EP512GU810 and the ICD U64. The code will run on the target without the debugger support. I'd guess the ICD U64 debugger firmware can't start the oscillator in debug mode. These chips require careful handling to get them oscillating in the best of circumstances.
I'm hoping a CCS firmware upgrade to the ICD U64 will correct the issue. |
|
|
|