Trying to fix KLC issues?

I’ve created a library for a part I wish to submit and am using the KLC tools to validate. (checklib.py)

My symbol has errors on 4.6, 5.1, 6.2, 6.3 which is confusing me.

4.6 - hidden pins. I’ve double checked everything and don’t have any hidden pins.
5.1 - For generic symbolsthe Footprint field must be left blank. Mine is blank

6.2 and 6.3 is confusing me.
6.2 Component fields must be filled appropriately. I’m sure they are, see above
6.3. Documentation File Name field contains URL to part documentation if applicable. I can’t find this field anywhere.

Any pointers on how to fix these issues, or is there a obvious issue I"m missing.

#
# 6502
#
DEF 6502 U 0 20 Y Y 1 F N
F0 "U" -300 1250 50 H V C CNN
F1 "6502" 0 200 50 V V C CNN
F2 "" 1350 -1400 50 H V C CNN
F3 "" -550 350 50 H V C CNN
$FPLIST
 DIP*W15.24mm*
$ENDFPLIST
DRAW
S -400 1200 400 -1200 0 1 10 f
X Vss 1 -200 -1500 300 U 50 50 1 1 W
X A1 10 700 1000 300 L 50 50 1 1 B
X A2 11 700 900 300 L 50 50 1 1 B
X A3 12 700 800 300 L 50 50 1 1 B
X A4 13 700 700 300 L 50 50 1 1 B
X A5 14 700 600 300 L 50 50 1 1 B
X A6 15 700 500 300 L 50 50 1 1 B
X A7 16 700 400 300 L 50 50 1 1 B
X A8 17 700 300 300 L 50 50 1 1 B
X A9 18 700 200 300 L 50 50 1 1 B
X A10 19 700 100 300 L 50 50 1 1 B
X RDY 2 -700 -100 300 R 50 50 1 1 B
X A11 20 700 0 300 L 50 50 1 1 B
X Vss 21 200 -1500 300 U 50 50 1 1 W
X A12 22 700 -100 300 L 50 50 1 1 B
X A13 23 700 -200 300 L 50 50 1 1 B
X A14 24 700 -300 300 L 50 50 1 1 B
X A15 25 700 -400 300 L 50 50 1 1 B
X D7 26 -700 400 300 R 50 50 1 1 B
X D6 27 -700 500 300 R 50 50 1 1 B
X D5 28 -700 600 300 R 50 50 1 1 B
X D4 29 -700 700 300 R 50 50 1 1 B
X PHI1out 3 -700 -600 300 R 50 50 1 1 O
X D3 30 -700 800 300 R 50 50 1 1 B
X D2 31 -700 900 300 R 50 50 1 1 B
X D1 32 -700 1000 300 R 50 50 1 1 B
X D0 33 -700 1100 300 R 50 50 1 1 B
X R/~W 34 700 -600 300 L 50 50 1 1 B
X NC 35 -700 -300 300 R 50 50 1 1 N
X NC 36 -700 -400 300 R 50 50 1 1 N
X PHI2 37 -700 -700 300 R 50 50 1 1 O
X ~SO 38 -700 -200 300 R 50 50 1 1 O
X PHI2out 39 -700 -800 300 R 50 50 1 1 O
X ~IRQ 4 -700 100 300 R 50 50 1 1 I
X ~RESET 40 700 -800 300 L 50 50 1 1 I
X NC 5 -700 200 300 R 50 50 1 1 N
X ~NMI 6 -700 0 300 R 50 50 1 1 I
X SYNC 7 -700 300 300 R 50 50 1 1 O
X VCC 8 0 1500 300 D 50 50 1 1 W
X A0 9 700 1100 300 L 50 50 1 1 B
ENDDRAW
ENDDEF

Read the KLC itself, don’t just run the script. It has screenshots with fields that you are looking for in 6.2 and 6.3.

Are you running the latest version?

There is also data in the DCM file.

I’ve read the KLC.

Fixed 6.2, I had to make the datasheet and footprint invisible. With 6.3 I can’t find the field with Documentation File Name in the editor.

@bobc . I’ll have a look through the DCM file. I"m using the latest version of the scripts.

Also, run the script with “-vv” flag. Often the rule checkers are finding a different issue than is implied by the rule number.

1 Like

Look at the screenshot in 6.3. There are multiple tabs in symbol properties dialog.

I think I’m losing it, my screen looks completely different. (Running KiCad 5.1.2 on Ubuntu)

Even loaded up the same device you are looking at:

I’m running 5.0.0, it should be in 5.1.2 somewhere, I guess it’s moved or a bug.

I’ll file a bug report. Either its no longer used in which case there is an issue with KLC, or Documentation File Name is missing from 5.1.2 (Checked all over and can’t find it)

I vaguely remember some developer discussion about this, it may have been removed on purpose. In that case the bug would be in KLC if it requires it. Maybe @Rene_Poschl knows about it?

Well, checklib.py used to refer to the Datasheet field, but actually meant the Documentation File Name, so it was changed to avoid confusion.

However, it appears the GUI has now changed, so what is presented to the user as “Datasheet” is what was previously “Documentation File Name”. So now checklib.py has a dilemma…

# 74HC240
#
DEF 74HC240 U 0 40 Y Y 1 L N
F0 "U" -300 650 50 H V C CNN
F1 "74HC240" -300 -650 50 H V C CNN
F2 "" 0 0 50 H I C CNN
F3 "" 0 0 50 H I C CNN
ALIAS 74HCT240
$FPLIST
 DIP*W7.62mm*
 SOIC*7.5x12.8mm*P1.27mm*
 TSSOP*4.4x6.5mm*P0.65mm*
 SSOP*4.4x6.5mm*P0.65mm*
$ENDFPLIST
DRAW
C 55 0 10 1 0 6 N
S -300 600 300 -600 1 1 10 f
P 4 1 0 6 40 0 -60 50 -60 -50 40 0 N
X 1OE 1 -500 -400 200 R 50 50 1 0 I I
...```

I think I fixed it, I just added the datasheet URL to datesheet and set to invisible and its now passing 6.3

If this is correct then docs need to be updated to remove references to Documentation File Name as this is confusing

I fixed the other issues as well. Help reading the guide more clearly. I think I’ve been staring at this too long :slight_smile:

There are two places where the file format can accept datasheets. In the lib file or in the dcm file. There was a bug in some versions of kicad that moved the datasheet to the lib file when there where no aliases. I seem to remember this is fixed.

In essence the KLC requires the datasheet to be set in the dcm file even if there is no alias to ensure every symbol is consistent (for symbols with aliases one needs to use the dcm file anyways as this is the only way to have differing aliases point to different datasheets which is kind of the idea behind aliases.)


also run the script with -vv to get more output (number of v chars increases output)

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.