Update deletes and replaces components it shouldn't change

First, I start KiCAD 7 using the project file, to maintain the link between eeschema and the PCB. I then click on a schematic symbol and see that the corresponding footprint highlights, so I know that eeschema and the PCB are linked. I then made a change to the schematic of a board I just finished laying out. “Update PCB from schematic” ruins my layout by deleting some footprints and replacing them with unconnected footprints, changing reference designators, swapping component locations, changing library links, so I must change the PCB by hand (placing footprints, selecting the nets for the pads, etc.).

Why am I having so much trouble with update?

Hello and welcome.

What change was made?

I added two resistors and a capacitor to an op amp.

Do you still have the project files before the update? If you archive it and attach it here we could try to replicate the problem.

1 Like

sounds like the linkage between schematic and layout was broken sometimes before. kicad traces the connection internally by UIDs, if they change in schematic but not in layout or vice versa this breaks things. fast but not fixing solution:

image

deactivate these three settings before pressing Update PCB

1 Like

Here’s more information about broken symbol <-> footprint links: Update PCB from Schematic's match methods. Maybe if helps you to track down what happened and why and how to avoid or fix that situation in the future.

1 Like

After reading the article that eelik recommended, I realize that my links got broken when I cut items on one page of a hierarchical schematic and pasted them on another. I hope KiCAD fixes this.

I realize that my links got broken when I cut items on one page of a hierarchical schematic and pasted them on another. I hope KiCAD fixes this.

Such a “fix” is not trivial to do and therefore may not happen. (just one problem: you can cut items, but what happens if you paste that items to times in to different subsheets? Which of these copies gets the original UUID-numbers? What happens if you have added other symbols in the meantime? …).

But as there is demand for such an action the following workflow is recommended:

  • first be sure schematic+board are in sync
  • cut symbols from original sheet, paste into destination-sheet with RMB-click–>context-menu–>Paste special–>keep existing reference designators
  • update board from schematic with option “relink footprints based on reference designator” (see answer from Tojan) checked
  • after that run a second “update board from schematic”, this time with option “relink footprints based on reference designator” unchecked (== standard setting).
1 Like

I’m glad the article helped to understand the situation.

There have been some discussion about possibility of updating the PCB on the fly (and even updating schematic from PCB on the fly) so that symbols and footprints are tightly connected. This is related. Tight connection would require changing the whole mindset of KiCad. Many users think that the current system is good, but there certainly are problems with it. This is one of those problems. A user can’t possibly understand the situation intuitively without somehow having previous knowledge about how KiCad works internally. That’s not good at all from perspective of usability and user experience.

There could be some partial solutions to this specific problem. At least KiCad could warn when doing a paste operation which breaks links. Or maybe the first paste could keep the links, updating the footprint links, and consecutive paste operations would handle the symbols like new symbols.

At least KiCad could warn when doing a paste operation which breaks links

Than you would currently get a warning at every cut action, copy+duplicate action, paste action. This will get in the way of every user with more than 3 boards experience. And if you frequently get the warning-message this will reduce the attention for important warnings/messages.

Or maybe the first paste could keep the links, updating the footprint links, and consecutive paste operations would handle the symbols like new symbols.

This sounds like candidate for fourth option in the “paste special”-dialog: if possible paste symbols with preserving there UUIDs.
Having this in the “paste special”-command is still not very intuitive for new users, but better than the current workflow.
I’m only unsure if the needed programming effort is worth the advantage in workflow simplification (only one “copy special”-action against 3 working steps mentioned above).So if someone opens a feature request the developers can judge on such a proposal.

1 Like

After setting the ref deses on the PCB to match those of the schematic, I ran “Update PCB from schematic” with the reference designator box checked. Shouldn’t this link the symbols to the footprints using the unique IDs?

When I try to use “Update PCB from schematic” again, this time with the ref des box unchecked, it wants to replace some of my footprints with those of another library. I have a finished layout, but I need to make last minute changes.

make sure the other to options are unchecked. otherwise they can conflict with each other and don’t work properly.

Now, after testing a bit, I remember there have been discussion about the problems related to copy/cut/paste. At the moment even cut → paste to the same sheet deletes the link. The best solution would be a dedicated “move to sheet” function (which, I think, have been wished for), but even that would have one problem due to how KiCad separates PCB from schematic. All changes to the PCB are now made only when explicitly requested.

Maybe there could be “Move to Sheet…” context menu item, opening a dialog where the user would choose the destination sheet, and a checkbox option for updating the PCB footprint links. But then undo should handle the PCB undo, too. I don’t know how complicated this would get.

When I try updating the PCB from scheme with only the ref des box checked, it reconnects all of my parts from one set of nets to another. I have already laid out the board. Using the new set of nets would require laying out the board again.

At this point, I think I it should only be updating the ref deses. Why is it reconnecting everthing? Is there a workaround?

How does Altium handle it?

Probably best asked on an Altium forum. :slightly_smiling_face:

We are now in a point where it would be easier to have the project available in the state which doesn’t work. But first make sure you have understood the re-link option of the dialog properly.

The relink by reference designators links a symbol to a footprint by ref des and unchecking it does it by Unique ID. Is this what you mean?

Let me know if I missed a file that you need. Thanks for your help.

Control.kicad_sch (79.7 KB)
fp-info-cache (5.2 KB)
SLM.kicad_sym (74.6 KB)
Diode Bridge Experiment.kicad_pcb (1.5 MB)
Diode Bridge Experiment.kicad_pro (11.4 KB)
Diode Bridge Experiment.kicad_sch (63.0 KB)
Diode Bridge.kicad_sch (142.1 KB)
Input.kicad_sch (110.5 KB)
Output.kicad_sch (68.7 KB)

Let me know if I missed a file that you need.

Seems all files are there.
A better option than all individual files: Kicad main manager–>File–>Archive project, than upload the zipped project.
If you want to reduce the size of the zip-file: delete the backup-folders (either first from the project-folder, or later form inside the zip-archive, as you like).

Regarding the project:

  • update “board from schematic” introduces no new footprints
  • but DRC shows that some footprints are doubled (with same Refdes, warning: “duplicate Footprints”)

Edit: the footprint-library “SLM_footprints” is misisng, so the “update board from schematic”-pcommand is not fully working.

Edit2: You need to write exactly which footprint is replaced by a new footprint. I can imagine that happens for instance for C8 (as for C8 there is a diffrence regarding the assigned footprint in schematic <<-> board:
SLM Footprints:C_Rect_L5.0mm_W3.0mm_P2.50mm_MKS02_FKP02 <–> Capacitor_THT:C_Rect_L4.6mm_W3.0mm_P2.50mm_MKS02_FKP02)

Thank you for the explanation of Archive project.

How did I end up with double footprints? How do I get rid of the extra footprint?

Here is the missing library:
SLM Footprints.zip (47.5 KB)

I had set the schematic and PCB to only use parts from the SLM_footprint library. Every time I would try to update the PCB, some footprints would change back to the old library, even though the symbol called out a footprint from the SLM_footprints library.