Power rail is not connected in netlist output

Hi Sir

I have created a simple shcematic in KiCad Eschema(sorry as a new user I cannot directly insert an image to show the schematic drawing here, see my next post below)

When I export netlist(*.xml) of this schematic, it is strange that two power rails are not correctly connected in the netlist file

  • Net name “USB_1P2”
    at the right-top circle the net is connected to “R4095” and “EC4902”
    at the middle circle the net is connected to “L4904”~“L4909”

I would expect that in netlist file the above components are all connected together through net USB_1P2, however, in netlist file they are separated as two independent nets :

<net code="8" name="Net-(EC4902-Pad1)">
  <node ref="EC4902" pin="1"/>
  <node ref="R4905" pin="1"/>
</net>

<net code="2" name="Net-(L4904-Pad1)">
  <node ref="L4906" pin="1"/>
  <node ref="L4908" pin="1"/>
  <node ref="L4905" pin="1"/>
  <node ref="L4907" pin="1"/>
  <node ref="L4904" pin="1"/>
  <node ref="L4909" pin="1"/>
</net>
  • Net name “USBVCC_5PV0”
    similar to the above description, in netlist file net USBVCC_5PV0 is separated as tow independent nets

_

<net code="13" name="Net-(R4907-Pad2)">
  <node ref="R4907" pin="2"/>
</net>

<net code="9" name="Net-(C4927-Pad2)">
  <node ref="R4908" pin="1"/>
  <node ref="R4907" pin="1"/>
  <node ref="C4927" pin="2"/>
  <node ref="U4901" pin="E10"/>
</net> 

There is another net “D3V3_USB” which is also placed on two locations in the schematic, however, in netlist file KiCad correctly connected them and also named as “D3V3_USB”

<net code="44" name="D3V3_USB">
  <node ref="EC4901" pin="1"/>
  <node ref="R4910" pin="1"/>
  <node ref="L4903" pin="2"/>
  <node ref="U4901" pin="L9"/>
  <node ref="U4901" pin="B6"/>
  <node ref="U4901" pin="C11"/>
  <node ref="C4928" pin="2"/>
  <node ref="L4910" pin="1"/>
  <node ref="U4901" pin="F1"/>
  <node ref="U4901" pin="E3"/>
  <node ref="C4937" pin="2"/>
  <node ref="U4901" pin="B1"/>
  <node ref="R4908" pin="2"/>
  <node ref="U4901" pin="H11"/>
  <node ref="C4936" pin="2"/>
  <node ref="C4932" pin="2"/>
  <node ref="C4935" pin="2"/>
  <node ref="C4933" pin="2"/>
  <node ref="C4934" pin="2"/>
  <node ref="C4929" pin="2"/>
  <node ref="C4930" pin="2"/>
  <node ref="C4931" pin="2"/>
</net>

After trying to find out the root cause of the problem, I found if I delete the “USB_1P2” symbol in symbol library(*.lib) and create a new one with exactly the same name and attributes, in netlist file the total 8 components connected on USB_1P2(R4905/EC4902/L4904~L4909) are correctly connected with the name “USB_1P2”, problem solved !

<net code="7" name="USB_1P2">
  <node ref="L4909" pin="1"/>
  <node ref="EC4902" pin="1"/>
  <node ref="R4905" pin="1"/>
  <node ref="L4904" pin="1"/>
  <node ref="L4905" pin="1"/>
  <node ref="L4908" pin="1"/>
  <node ref="L4906" pin="1"/>
  <node ref="L4907" pin="1"/>
</net>

Then I compare the problematic symbol library file and the new symbol library file to find out the difference as below :


(left : problematic library file / right : new library file)

for me it is beyond my knowledge to investigate the problem further, though it is critical to me to clarify the root cause before we go for manufacturing of the board, please help, thanks in advance !

post the schematic here

“USB_1P2” and “USBVCC_5PV0” are not standard KiCad schematic symbols, and I assume you made them yourself.

I understand the confusion, had this myself once.
The visible text is not the text that is used to create the netlist.
If I open the default “+5V” power symbol in the Symbol editor it looks like:

The Blueish text is the “component name”.

The net is make from the pin name, which is also “+5V” and is shown here rotated and in grey.

I do not know how you make the .xml netlist, however the names of the nets in Eeschema are also used in Pcbnew.

Here I’ve attached R123 to the +5V power symbol:

And then, when I press [F8] to put the Netlist & components into pcbnew you see a big text “+5V” on the pin of the resistor:

On the other pad of the resistor you see the net name “Net-(R123-Pad2)”. This means that this is an un named net, and KiCad therefore generates a generic net name from one of the pins the net is attached to.

In your post I see:

net code=“8” name=“Net-(EC4902-Pad1)”>

This is also such a generic net name, generated by KiCad, and this means there is something wrong with the power symbols you made. To fix this correctly you need to change the pin name of the power symbols you made. To do this, open your power symbol in the Symbol editor, hover over the pin and press edit.
Then in the “Pin Name” field, enter the name you want for the net:
image

To avoid further confusion, make sure the name of the pin and the name of the power symbol are the same for each power symbol you make.

This is how it works at the moment, and it works reliably. It is a bit of a hackish method, and a left over from the early dark years of KiCad.

On the KiCad website itself, there is a link to a document describing KiCad’s file formats. At the moment this file seems to be broken. If you’re interested, here is a copy of this file I made some time ago:
file_formats.pdf (379.2 KB)

On a side note:

I saw you used the “earth” symbol instead of “GND” in your schematic. These are not the same, although it’s mostly a convention and not too important.
In short: “Earth” is connected to the outside world, while “GND” is a voltage reference for your schematic.

On your screenshot I also noticed “FGND” and “DFND”
image

I guess you added the dark blue text yourself.
If you look at the different GND symbols in KiCad you see that both the “Symbol Name” and the “Pin Name” are “Earth”, even though all the text is normally hidden in the schematic.

Check that you are using these symbols correctly, and that you have different, and properly named nets for your “FGND” and “DFND”.

1 Like

Hi paulvdh,

Thanks for your quick reply.

I have checked the pin name of the original “USB_1P2” symbol and the corrected symbol (renamed as “USB_1P2_new”), and can’t see any problem as below
USB_1P2
USB_1P2_new

And I just made a very simple schematic drawing as below, and expecting R1 is connected to R2 through net “USB_1P2”, and R3 is connected to R4 through net “USB_1P2_new”
sch

but after exporting netlist (click the “generate netlist” icon on toolbar) and check the content still found R1/R2 is NOT connected while R3/R4 is connected through net “USB_1P2_new”

<net code="1" name="Net-(R2-Pad1)">
  <node ref="R2" pin="1"/>
</net>
<net code="2" name="USB_1P2_new">
  <node ref="R3" pin="1"/>
  <node ref="R4" pin="1"/>
</net>
<net code="3" name="Net-(R4-Pad2)">
  <node ref="R4" pin="2"/>
</net>
<net code="4" name="Net-(R3-Pad2)">
  <node ref="R3" pin="2"/>
</net>
<net code="5" name="Net-(R2-Pad2)">
  <node ref="R2" pin="2"/>
</net>
<net code="6" name="Net-(R1-Pad2)">
  <node ref="R1" pin="2"/>
</net>
<net code="7" name="Net-(R1-Pad1)">
  <node ref="R1" pin="1"/>

I compared the library again but it’s beyond my knowledge to figure what is wrong the the library file

I also attached all the files mentioned above, it would be really appreciated if you can have a check of these files, thanks.test.zip (3.5 KB)

Something is going on here, but I don’t know yet what.
I assigned footprints to the symbols and had a look at them in Pcbnew.
R3 and R4 are connected with the net “USB_1P2” (Not the “new” variant as expected ???) while R1 and R2 are not connected at all.

I also see differences in the symbols compared to your screenshots.
I have something else to do right now and can not look further into it right now. I’ll probably be back in a few hours.
In the meantime, can you post your Full KiCad version? It is from the “Help / About” box. Copy & paste it here. It should look similar to:

Application: LibEdit
Version: 5.1.5-52549c5~84~ubuntu18.04.1, release build
Libraries:
wxWidgets 3.0.4
libcurl/7.58.0 OpenSSL/1.1.1 zlib/1.2.11 libidn2/2.0.4 libpsl/0.19.1 (+libidn2/2.0.4) nghttp2/1.30.0 librtmp/2.3
Platform: Linux 5.3.0-42-generic x86_64, 64 bit, Little endian, wxGTK
Build Info:
wxWidgets: 3.0.4 (wchar_t,wx containers,compatible with 2.8) GTK+ 3.22
Boost: 1.65.1
OpenCASCADE Community Edition: 6.9.1
Curl: 7.58.0
Compiler: GCC 7.4.0 with C++ ABI 1011

Build settings:
USE_WX_GRAPHICS_CONTEXT=OFF
USE_WX_OVERLAY=ON
KICAD_SCRIPTING=ON
KICAD_SCRIPTING_MODULES=ON
KICAD_SCRIPTING_PYTHON3=ON
KICAD_SCRIPTING_WXPYTHON=ON
KICAD_SCRIPTING_WXPYTHON_PHOENIX=ON
KICAD_SCRIPTING_ACTION_MENU=ON
BUILD_GITHUB_PLUGIN=ON
KICAD_USE_OCE=ON
KICAD_USE_OCC=OFF
KICAD_SPICE=ON

In the meantime, something you can easily do is to copy one of the default power symbols to your own lib, and then compare line for line. I suspect it has something to do with your editing of the power symbols.

Hi paulvdh,

My KiCad version as below, thanks.

Application: KiCad
Version: (5.1.5)-3, release build
Libraries:
wxWidgets 3.0.4
libcurl/7.66.0 OpenSSL/1.1.1d (Schannel) zlib/1.2.11 brotli/1.0.7 libidn2/2.2.0 libpsl/0.21.0 (+libidn2/2.1.1) nghttp2/1.39.2
Platform: Windows 8 (build 9200), 64-bit edition, 64 bit, Little endian, wxMSW
Build Info:
wxWidgets: 3.0.4 (wchar_t,wx containers,compatible with 2.8)
Boost: 1.71.0
OpenCASCADE Community Edition: 6.9.1
Curl: 7.66.0
Compiler: GCC 9.2.0 with C++ ABI 1013

Build settings:
USE_WX_GRAPHICS_CONTEXT=OFF
USE_WX_OVERLAY=OFF
KICAD_SCRIPTING=ON
KICAD_SCRIPTING_MODULES=ON
KICAD_SCRIPTING_PYTHON3=OFF
KICAD_SCRIPTING_WXPYTHON=ON
KICAD_SCRIPTING_WXPYTHON_PHOENIX=OFF
KICAD_SCRIPTING_ACTION_MENU=ON
BUILD_GITHUB_PLUGIN=ON
KICAD_USE_OCE=ON
KICAD_USE_OCC=OFF
KICAD_SPICE=ON

I seem to be unable to figure out what is happening here.
I am beginning to suspect it may be a bug in KiCad itself.
I will post my intermediate results here, and then update KiCad with the js-reynaud update that arrived yesterday, and then re-create it again.

What I did:

  1. Open KiCad, start a new project, named: “test_2020-03-27T14:37”.

  2. Copied test.lib from Nate, the OP into that project directory.

  3. Added that library to the project specific libraries.

  4. Re-created Nate’s original test schematic:

  5. In the schematic I used his power symbols, but a standard library resistor.

  6. Assigned footprints for the resistors.

  7. [F8] to Pcbnew.

  8. Moved the components a bit to better show the single! ratsnest line:

Remarkable:

  1. There is no ratsnest line from R1 to R2.
  2. Net for R3 and R4 is now called “USB_1P2_new”.
  3. In my previous post this net had the name “USB_1P2”.

Then I opened test.lib in a text editor and compared the lines of the schematic components. I also pasted the text from the +12V power symbol from /usr/share/kicad/lib/power.lib into that same text file, and added some comments.
I can see nothing that would explain this behavior.
The text file with the part of the 3 components:

---------------------------------
#
# USB_1P2
#
---------------------------------
#
# USB_1P2_new
#
---------------------------------
#
# +12V
#
---------------------------------
DEF USB_1P2     #PWR 0 0 Y Y 1 F P
DEF USB_1P2_new #PWR 0 0 Y Y 1 F P
DEF +12V        #PWR 0 0 Y Y 1 F P

F0 "#PWR" 0 -150 50 H I C CNN			# F0 = reference.
F0 "#PWR" 0 -150 50 H I C CNN
F0 "#PWR" 0 -150 50 H I C CNN

F1 "USB_1P2"     0 140 50 H V C CNN		# F1 = value.
F1 "USB_1P2_new" 0 150 50 H V C CNN
F1 "+12V"        0 140 50 H V C CNN

F2 "" 0 0 50 H I C CNN					# F2 = Pcb Footprint.
F2 "" 0 0 50 H I C CNN
F2 "" 0 0 50 H I C CNN

F3 "" 0 0 50 H I C CNN					# F3 = User doc link. Not used?
F3 "" 0 0 50 H I C CNN
F3 "" 0 0 50 H I C CNN

DRAW
DRAW
DRAW

P 2 0 1 0 -30 50 0 100 N
C 0 75 25 0 1 0 N				# Circle? Different graphics is expected.
P 2 0 1 0 -30 50 0 100 N

P 2 0 1 0 0 0 0 100 N
P 2 0 1 0 0 0 0 50 N
P 2 0 1 0 0 0 0 100 N

P 2 0 1 0 0 100 30 50 N
                                 # Less Graphics is expected for USB_1p2_new.
P 2 0 1 0 0 100 30 50 N

X USB_1P2     1 0 0 0 U 50 50 1 1 w N
X USB_1P2_new 1 0 0 0 U 50 50 1 1 W N
X +12V        1 0 0 0 U 50 50 1 1 W N

ENDDRAW
ENDDRAW
ENDDRAW

Because I re-created the project and only re-used the lib I’m quite sure that the generation of the .xml netlist (external script?) has no influence on this. I also use Linux Mint, which is not officially supported, but Nate uses Windows 8.

Back again, did update of KiCad. (Even reboot even though I know it’s not needed on Linux).

My version info is slightly diffent now, though still “Version: 5.1.5-52549c5~85~ubuntu18.04.1”. However, if I do:

paul@dualcore:~$ apt version kicad
5.1.5-202003261335+52549c5~85~ubuntu18.04.1

and 2020… is not the same as 525…

Application: KiCad
Version: 5.1.5-52549c5~85~ubuntu18.04.1, release build
Libraries:
    wxWidgets 3.0.4
    libcurl/7.58.0 OpenSSL/1.1.1 zlib/1.2.11 libidn2/2.0.4 libpsl/0.19.1 (+libidn2/2.0.4) nghttp2/1.30.0 librtmp/2.3
Platform: Linux 5.3.0-42-generic x86_64, 64 bit, Little endian, wxGTK
Build Info:
    wxWidgets: 3.0.4 (wchar_t,wx containers,compatible with 2.8) GTK+ 3.22
    Boost: 1.65.1
    OpenCASCADE Community Edition: 6.9.1
    Curl: 7.58.0
    Compiler: GCC 7.5.0 with C++ ABI 1011
Build settings:
    USE_WX_GRAPHICS_CONTEXT=OFF
    USE_WX_OVERLAY=ON
    KICAD_SCRIPTING=ON
    KICAD_SCRIPTING_MODULES=ON
    KICAD_SCRIPTING_PYTHON3=ON
    KICAD_SCRIPTING_WXPYTHON=ON
    KICAD_SCRIPTING_WXPYTHON_PHOENIX=ON
    KICAD_SCRIPTING_ACTION_MENU=ON
    BUILD_GITHUB_PLUGIN=ON
    KICAD_USE_OCE=ON
    KICAD_USE_OCC=OFF
    KICAD_SPICE=ON
  1. Restart KiCad again. Made new project: " test_2020-03-27T15:55"
  2. Exit KiCad.
  3. Copy test.lib & test.dcm from OP’s original .zip file.
  4. dcm file, how significant is that ???
  5. Opened test.dcm in a text editor:
EESchema-DOCLIB  Version 2.0
#
$CMP R
D Resistor
K R res resistor
F ~
$ENDCMP
#
$CMP USB_1P2_new
D Power symbol creates a global label with name "VCC"
K power-flag
$ENDCMP
#
#End Doc Library
  1. So the “USB_1P2_new” is in the .dcm file, but the “USB_1P2” symbol is not.
  2. This file may have more significance than I thought earlier… There is no description of the .dcm in “file_formats.pdf”, I’ll skip it for now.
  3. Re-creating the schematic again, now with capacitors from the default lib.
  4. Suddenly noticed that “USB_1P2” does not have a circle on the attachment point for the wire on “pin 1”, while "USB_1P2_new does.
  5. Screenshot of schematic with “Eeschema / View / Show hidden pins” on:
  6. Editing “USB_1P2” in the lib editor and setting the pin to visible also shows the ring on the attachment point of the pin, but this should not be needed???
  7. Exit KiCad.
  8. Edit test.dcm in a text editor, and a bit of the good old copy & paste & edit to make it look similar to the "USB_1P2_new symbol info:
EESchema-DOCLIB  Version 2.0
#
$CMP R
D Resistor
K R res resistor
F ~
$ENDCMP
#
$CMP USB_1P2
D Description of some weird symbol that does not work properly.
K power-flag
$ENDCMP#
$CMP USB_1P2_new
D Power symbol creates a global label with name "VCC"
K power-flag
$ENDCMP
#
#End Doc Library
  1. Save file, start KiCad, start Eeschema.
  2. Now it wants to rescue my project. More coffee.
  3. Canceled the rescue, deleted symbol from schematic.
  4. Add new symbol from schematic with “p” for Power symbol.
  5. I *&^%$#@! Made mistake in editing test.dcm. Exit KiCad.
  6. After text edit, restart KiCad, delete symbol and add again with “p” I have descriptions for both of the “USB_1P2” symbols:
  7. In the schematic the USB_1P2 still does not have the attachment circle.
  8. When I Grab the symbol and move it, the wire is clearly attached:
    image
  9. [F8] and put the components on the PCB.
  10. Only one ratsnest line. No connection between C1 and C2.
    image
  11. Save project, exit KiCad, remove *-bak
  12. Create .zip of 15:55u project & attach here.test_2020-03-27T15:55.zip (5.4 KB)
  13. It seems significant that the attachment circle for the pin is missing.
  14. I’m at a loss here though why it is missing.

I do not know what else I can do about this.

Thanks paulvdh, is there anyone able to help on this ?

There is (a little) chance that more current version have such bug fixed.
See my question:

If not you should report a bug.

I have changed the power symbol values and not noticed such problem.

Hi Piotr,

Thanks for reply, I installed the latest pre 5.1.6 version

filename : kicad-5.1-jenkins-595-x86_64-lite.exe

Application: KiCad
Version: (5.1.5-114-g6b2a8f54a)-1, release build
Libraries:
wxWidgets 3.0.4
libcurl/7.66.0 OpenSSL/1.1.1d (Schannel) zlib/1.2.11 brotli/1.0.7 libidn2/2.2.0 libpsl/0.21.0 (+libidn2/2.1.1) nghttp2/1.39.2
Platform: Windows 8 (build 9200), 64-bit edition, 64 bit, Little endian, wxMSW
Build Info:
wxWidgets: 3.0.4 (wchar_t,wx containers,compatible with 2.8)
Boost: 1.71.0
OpenCASCADE Community Edition: 6.9.1
Curl: 7.66.0
Compiler: GCC 9.2.0 with C++ ABI 1013

Build settings:
USE_WX_GRAPHICS_CONTEXT=OFF
USE_WX_OVERLAY=OFF
KICAD_SCRIPTING=ON
KICAD_SCRIPTING_MODULES=ON
KICAD_SCRIPTING_PYTHON3=OFF
KICAD_SCRIPTING_WXPYTHON=ON
KICAD_SCRIPTING_WXPYTHON_PHOENIX=OFF
KICAD_SCRIPTING_ACTION_MENU=ON
BUILD_GITHUB_PLUGIN=ON
KICAD_USE_OCE=ON
KICAD_USE_OCC=OFF
KICAD_SPICE=ON

then open the simple schematic in my previous post, encounter below message and click"OK"

export netlist again but the problem is still the same, R1/R2 is NOT connected and R3/R4 is connected (but net name is “USB_1P2”, not “USN_1P2_new”, same phenomenon with paulvdh).

Since this is a very simple but obvious problem, Is there a possibility that a KiCad designer go for a program line-by-line debug on this issue ?

Thanks !

You should report a bug giving with it your files.
I reported several bugs, but later the bug report system was moved to new location and I’m not sure how exactly it works now. There should be information how to do it at KiCad www.
That bug seems to be so serious that I expect someone will search a source of problem.
I am not experienced user - I have done only 3 PCBs using KiCad.

@eelik @Rene_Poschl
I have come quite far in narrowing down very weird behavior of KiCad by changing the pin of a power symbol from “Power Input” to “Power Output”.

Do you agree this is a bug, and have pointers how to go further. Shall I open an issue on gitlab? It used to be on launchpad, but considering the migration… Or, if you have doubt, who to ping?

Long version:
This evening I was able to re-create Nate’s problem without using any of his files. So I started a new project from scratch, made a project specific library etc.
When comparing Nate’s lib with the lib I re-created I discovered a discrepancy between a lower “w” and a capital “W” on line 32 of the library:

X USB_1P2 1 0 0 0 U 50 50 1 1 w N

to:

X USB_1P2 1 0 0 0 U 50 50 1 1 W N

This line describes the pin of the corresponding symbol, in this case a power symbol. It is described in the file_formats.pdf file in section 2.3.4

Lower w means power output, while capital W means power input.

The pins of the normal Power symbols in KiCad are defined as power input.
So I copied the +24V power symbol from the default lib to my custom lib, and changed the pin type from power input to power output.

Now the symbol behaves the same as Nate’s.

  • In Eeshema the attachment ring of the pin is very small when nothing is attached.
  • Connections to this pin are recognized by ERC check.
  • Connections to this pin do not get the net name assigned, and are not recognized by Pcbnew.

When I put this schematic to Pcbnew with [F8]
image

Then it adds 2 single pin nets with generic names:

Info: Processing component “R1:/5E7FE9A6:Capacitor_SMD:CP_Elec_8x6.2”.
Info: Change symbol path “R1:” to “/5E7FE9A6”.
Add R1 (footprint “Capacitor_SMD:CP_Elec_8x6.2”).
Change REF** reference to R1.
Change R1 value from CP_Elec_8x6.2 to R.
Add net Net-(R1-Pad2).
Connect R1 pin 2 to Net-(R1-Pad2).
Add net Net-(R1-Pad1).
Connect R1 pin 1 to Net-(R1-Pad1).

Total warnings: 0, errors: 0.
Netlist update successful!

A copy of my test project:
test_2020-03-28T23:45.zip (6.7 KB)

Hi paulvdh,

Just issued a bug at :

For your reference, thanks for your help.


TlDr: Invisible power input pins are special. They are global labels. Both of these must be true for this. So no other pin type or visibility combination will get you a global label and therefore also not a working power symbol.

And yes this is a hack but it can only change with the new file format to be expected with version 6

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