View previous topic :: View next topic |
Author |
Message |
blak3r
Joined: 11 Jan 2004 Posts: 45
|
WORKAROUND INCLUDED: ICD Verification Fails On CONFIG Fuses |
Posted: Sat Mar 25, 2006 9:39 pm |
|
|
I'm recently bought Microchips PICDEM Explorer board which has a 18F8722 on it.
After i program the chip i get a Verification Error which indicates that the configuration fuses don't match the Expected Data (hex).
Through searching the forums i found several threads with similiar behavior but were able to workaround the issue by setting the configuration bits in two passes and then it would magically go away. This hasn't worked for me.
The test code which simply writes does:
TRISD = 0x00;
PORTD = 0xF0;
(Note: i'm not using CCS Compiler for this project)
The code does in fact work though after i click the "Run Program" button.
Below i included links to practically everything... to see my configuration bits see init.c
Thanks in advance!
http://www.glue.umd.edu/~blaker/PICDEM.hex
http://www.glue.umd.edu/~blaker/init.c
http://www.glue.umd.edu/~blaker/main.c _________________ "Everything should be made as simple as possible, but not one bit simpler" -- Albert Einstein
http://www.blakerobertson.com
Last edited by blak3r on Mon Jun 19, 2006 12:36 pm; edited 1 time in total |
|
|
blak3r
Joined: 11 Jan 2004 Posts: 45
|
|
Posted: Mon Mar 27, 2006 1:40 am |
|
|
Today i did some further testing...
I borrowed a buddies Microchip ICD2 and when i program the chip using exactly the same .HEX file that i get the configuration fuse errors with when using the CCS U40, the chip programs with no errors at all.
Also - please note that i'm using the U40 with the latest version of the software on a WinXP system. The firmware that is loaded on the U40 is the latest version that comes with the software.
~blake _________________ "Everything should be made as simple as possible, but not one bit simpler" -- Albert Einstein
http://www.blakerobertson.com |
|
|
blak3r
Joined: 11 Jan 2004 Posts: 45
|
|
Posted: Mon Apr 10, 2006 7:19 pm |
|
|
I am also having the same problem now when i compile code using the CCS PIC18 compiler with my target chip 18F6527.
I get the verification error but the code runs on the target without any problems. _________________ "Everything should be made as simple as possible, but not one bit simpler" -- Albert Einstein
http://www.blakerobertson.com |
|
|
blak3r
Joined: 11 Jan 2004 Posts: 45
|
|
Posted: Thu May 11, 2006 9:02 am |
|
|
bump _________________ "Everything should be made as simple as possible, but not one bit simpler" -- Albert Einstein
http://www.blakerobertson.com |
|
|
PCM programmer
Joined: 06 Sep 2003 Posts: 21708
|
|
Posted: Thu May 11, 2006 4:02 pm |
|
|
If there's a firmware problem, we can't fix it on this board. Only support
can fix it. My advice is, if one toolset doesn't work and you can't get
prompt action out of support, then use the other toolset. |
|
|
blak3r
Joined: 11 Jan 2004 Posts: 45
|
|
Posted: Mon Jun 12, 2006 6:39 pm |
|
|
I've been borrowing an ICD2 for a couple weeks and Mplab and the lack of a command line interface to do something like program has been really irritating.
I'm going to submit this to support... one of the best things i've noticed about CCS is how large the community is on the forums... so i've never really tried emailing support! _________________ "Everything should be made as simple as possible, but not one bit simpler" -- Albert Einstein
http://www.blakerobertson.com |
|
|
dgi
Joined: 07 Jan 2004 Posts: 11 Location: Philadelphia, USA
|
|
Posted: Tue Jun 13, 2006 3:00 pm |
|
|
I'm having a similar problem - with the PIC18F6527.
When I program the chip using the ICD-U40, my program works correctly, but the ICD.exe program reports that verification failed, and nothing that I have tried allows the verification to pass.
I have tried changing several configuration bits, and changing my supply voltage and wiring, using the standalone ICD.exe to manually erase and verify the chip.
An added confusion: the screen shot shows red and black and blank lines that don't makes any sense! |
|
|
PCM programmer
Joined: 06 Sep 2003 Posts: 21708
|
|
Posted: Wed Jun 14, 2006 1:04 am |
|
|
In your case, the following may apply:
Code protect bits can only be erased by a "Bulk Erase" command.
But a Bulk Erase can only be done at 5 volts. It won't work at +3.3v. |
|
|
blak3r
Joined: 11 Jan 2004 Posts: 45
|
Support Response |
Posted: Mon Jun 19, 2006 12:34 pm |
|
|
The following are the details from the response from support:
Why the Verification Error appears:
Quote: |
The config fuses in the hex file has 1s for unimplemented config bits, while they read as 0 on pic18s. Hence the verification issue on the unimplemented ones. But the needed fuses are programmed and so the program runs.
|
How to prevent such a verification error:
Quote: |
I would just change this record
:0E000000FFF6F8FEEFFF3AFFFFFFFFFFFFFFE6 in hex file to :0E00000000C6181EE387B000FFC0FFE0FF40FF
The first byte is the number of data bytes (oE), the offset, record type, data values (C6181EE387B000FFC0FFE0FF40) and the checksum (FF). |
Procedure to fix a single hex file:
1) open the hex file in a text editor
2) search for the following string ":0E000000" (i believe this prefix indicates to program the configuration fuses). The reason i say to search is that depending on the compiler used, the configuration fuse may or may not be the first line. When compiled using CCS i think it is, when compiled using HiTech's compiler it was the 2nd to last line for me. Also, verify that :020000040030CA preceeds the line you found (this sets the high offset as 0x30).
3) delete everything after the ":0E000000"
4) copy and paste what is in the field Actual Data (Hex) when you get the verification error
5) remove the extra spaces
6) compute the checksum for that line and appended it to that line.
How to compute the checksum for a line in the hex file
Quote: | You add all the bytes from length to the last data byte and subtract the sum from 0. So the sum of all the bytes from length to checksum is 0.
|
Example Checksum Calculation #1
I took a line from my hexfile to make sure i did it write and it was :0200A00012004C
The checksum in this example is 4C.
02 + 00 + A0 + 00 + 12 + 00 = B4
0-B4 = FFFFFFFFFFFFFF4C & 0xFF = 0x4C
Example #2:
Used the following line- :060F5800E1C003F0000CF3 (F3 is the known checksum)
06 0F 58 00 E1 C0 03 F0 00 0C = 30D
(0 - 30D) & 0xFF = F3
Comprehensive Example:
Following procedure steps 1 & 2 i located the following:
Code: |
:020000040030CA
:0E000000FFF2FEFEFFFFBAFFFFFFFFFFFFFF54
|
I got a Verification error saying that the configuration fused were actually: 00 C2 1E 1E F3 87 B0 00 0F C0 0F E0 0F 40
So, i computed the checksum to be 0xBD and then replaced FFF2FEFEFFFFBAFFFFFFFFFFFFFF54 in my hex file
with 00C21E1EF387B0000FC00FE00F40BD and it programs and verifies with no errors. If you calculate the checksum wrong you will get a checksum error.
I'd be great if CCS could add a checkbox to disable this type of warning so this process doesn't have to be done at all. The only time i see someone actually doing this is if they wanted to use the U-40 to program a number of PICs semi-automatically. _________________ "Everything should be made as simple as possible, but not one bit simpler" -- Albert Einstein
http://www.blakerobertson.com |
|
|
akokyaw
Joined: 11 Feb 2005 Posts: 24
|
ICD Verification Fails On CONFIG Fuses |
Posted: Fri Jul 28, 2006 11:01 am |
|
|
Hi,
I used ICD-U40 with my own prototype board and found ICD verification fail problem. I used 18F452. After some experiment, I found that grounding caused the problem because of USB power. So I suggest, check the grounding of power supply.
Hope it will help,
Regards,
ako |
|
|
blak3r
Joined: 11 Jan 2004 Posts: 45
|
__CONFIG replacement for HTSOFT Users |
Posted: Mon Nov 13, 2006 12:24 pm |
|
|
I ended up making my own config macro which masked the bits to set.
Code: |
#define FUSE1_MASK 0xCF00
#define FUSE2_MASK 0x1F1F
#define FUSE3_MASK 0x87F3
#define FUSE4_MASK 0x00F5
#define FUSE5_MASK 0xC0FF
#define FUSE6_MASK 0xE0FF
#define FUSE7_MASK 0x40FF
#define U40ABLE_CONFIG_1(fuseData) __CONFIG(1, (fuseData) & FUSE1_MASK)
#define U40ABLE_CONFIG_2(fuseData) __CONFIG(2, (fuseData) & FUSE2_MASK)
#define U40ABLE_CONFIG_3(fuseData) __CONFIG(3, (fuseData) & FUSE3_MASK)
#define U40ABLE_CONFIG_4(fuseData) __CONFIG(4, (fuseData) & FUSE4_MASK)
#define U40ABLE_CONFIG_5(fuseData) __CONFIG(5, (fuseData) & FUSE5_MASK)
#define U40ABLE_CONFIG_6(fuseData) __CONFIG(6, (fuseData) & FUSE6_MASK)
#define U40ABLE_CONFIG_7(fuseData) __CONFIG(7, (fuseData) & FUSE7_MASK)
/*** Device configuration registers ***/
/*
* Fail-Safe Clock Monitor Enable = Disabled
* Internal External Switch Over Mode = Disabled
* Oscillator = HSPLL
*/
//__CONFIG(1, FCMDIS & IESODIS & HSPLL);
U40ABLE_CONFIG_1( FCMDIS & IESODIS & HSPLL );
|
Note: The FUSE_MASK defines are customized for a PIC18F6722. If you use a different PIC, look at the datasheet in section 25.1. Then make the masks such that the shaded blocks will equal zero after the mask is applied. |
|
|
|