Changes in schematic destroy layout

help, help!
I had a complete schematic and all components positioned in the layout. Then I made some simple changes in the schematic because of ERC errors. After that I clicked “Update layout from schematic” and my layout is totally destroyed!!!

Well, KiCad saves updates from time to time which I hope will enable me to go back to a “good” version.
What is a safe method to do so?

KiCad 7.0.9 on Win10 64bit

What did you change in the schematic, and what were the results? You are being very vague about both.

Update PCB from Schematic does not change anything about the PCB layout. It just updates (and can both remove and add) footprints. The most common cause of problems is making some simple mistakes due to inexperience with KiCad. And that is why it is important to better describe what “simple” changes you made to the schematic.

KiCad creates a [Project]-backup directory, and in that directory it stores zipped versions of your project. The safest way is to:

  1. Copy such a zip file to a safe location (Automatic backups will get overwritten after some time).
  2. Extract the backup (which is a complete KiCad project) and open it with KiCad just like any other project.

KiCad’s project manager does have some direct functions to archive or unarchive a project, but I don’t know how that behaves in relation to the currently open project. I always prefer to use an external program to work with zipped files, because there is much less ambiguity on how such a program behaves.

And as said before. It’s not just about restoring your project. You have to learn what went wrong and why, or else you are likely to repeat it.

Changes in schematic because of many ERC errors:

  1. I replaced all power inputs (+5V, -5V, +3.3V, GND, GNDA) by deleting them in the schematic and adding new ones from power library (ERC error was that the symbol has changed in library - I don’t know why).
  2. I excluded some errors “input power pin not supported by output power pin” (the connection were ok)
  3. for all ICs, pin headers and diodes I selected in properties “exclude from simulation” because ERC could not open a simulation file.
  4. I deleted a symbol for an IC and replaced it by the same type from another library (ERC reported that it cannot find it in the standard library)
  5. I added a lot of NC crosses
  6. I added two resistors
  7. I deleted a net mark on one pin of an 8 pin header (I started my design with a shield for a Mega2560, and all pins of the pin headers had net marks; my design requires to connect two such pins resulting in an ERC error because the two pins had different net names)

The layout before updating it:

and after updating:

You only needed to Update From Library. Reason is those symbols were updated in the standard library.

You shouldn’t try to do both simulation and a PCB from the same schematic. Sorry, but that’s how it is.

That breaks the connection between the schematic and the PCB. It’s possible to do this if you isolate a set of this kind of replacements from other kind of changes and use the alternative re-linking method in the Update PCB dialog (after making sure the reference designators are the same), but usually it’s better to use “Change Symbol” function from the context menu or from the symbol Properties. The latter method keeps the connection and therefore the already placed footprint will keep its location.

The first and good news is that you managed to revive an older version to make your “before” screenshot.

After that, lots of things go wrong. One of the problems is that you took on a project that is too complex compared to your experience level. It is easy to make small mistakes, and for a more complex project, a small mistake can lead to a lot of extra, repetitive and boring work.

When comparing your screenshots, I see that “U3” is still in the place of “U3”, but is now another footprint. (it was the footprint of U1) Similar with J13 and J12. The cause of this is that you probably re-annotated the schematic (or PCB) at some point, and then during the Update PCB from Schematic [F8] process, had the checkbox: Re-link footprints to schematic symbols based on their reference designators on. This checkbox is normally “off” and should only be used for “special cases”. (Put in some time in learning what it exactly does). This is not mentioned in your description, but it’s easy to miss such things as a beginner.

For the other things:

  1. Already answered by retiredfeline. Updating would have been sufficient.
  2. The message likely was: Error: Input Power pin not driven by any Output Power pins. Cause is the lack of PWR_FLAG symbols. Their use is a separate topic.
  3. KiCad ERC starts to complain a lot lately. If you do not run simulations you can just turn off this check completely.
  4. At the moment you delete a symbol from the schematic, the link between schematic symbol and the footprint on the PCB gets broken, and you will have to repair it later in some way. You can prevent this by using the Change Symbol in the symbol properties to maintain the link between the schematic and the PCB.
  5. Adding NC crosses is good. But always verify you are not placing too many of them. Some pins should not be left open.
  6. Adding some new footprints to the PCB is a normal part of the design process. From your second screenshot it looks like you added 4 resistors, C11, U7 and two SMT parts.
  7. You can have more then one label on a net. KiCad issues a warning for this (not an error!) because it does not (and can not) know whether this is intentional or a mistake. You do not have to delete the extra labels, but you can suppress the (individual) warnings, or you can (temporarily) suppress the ERC check for this.

So it turns out those changes were not so simple after all. And the combination with your inexperience got you into this situation. Try to take smaller steps, or at least make regular backups so it’s easier to revert to a previous situation if you make a mistake again. Give some thought about KiCad’s own backup settings. How many backups do you want to keep, and how long do you want to keep them? These automatic backups have saved a lot of projects, but it is no substitute to a real backup strategy.

If you do not run simulations you can just turn off this check completely.

I tried this but could not find where to turn it off generally. Where can I do that?

When comparing your screenshots, I see that “U3” is still in the place of “U3”, but is now another footprint. (it was the footprint of U1) Similar with J13 and J12. The cause of this is that you probably re-annotated the schematic (or PCB) at some point, and then during the Update PCB from Schematic [F8] process, had the checkbox: Re-link footprints to schematic symbols based on their reference designators on.

This exactly was the reason for my probem.
During design components are deleted, added or moved to another location. At the end of the design when everthing was finished I believed beeing a good idea to have reference IDs running up from 1 to maximum without gaps. Therefore I selected Re-link footprints to schematic symbols based on their reference designators… But now I know that this “good” idea was the worst idea.

I guess there are some more less experienced users like me having such an idea. Therefore it really would be a good idea to insert a warning text at the selection Re-link footprints to schematic symbols based on their reference designators that this may destroy the layout, is’nt it?

Thank you for your hints. Now I know what to do to save my layout and what to avoid in future .

Schematic Editor / File / Schematic Setup / Electrical Rules / Violation Severity, or when the ERC dialog is open, you can right click on a message and then choose one of the choices (Exclude a single violation, or disable a violation class altogether).

About the: Re-link footprints …. Normally KiCad uses UUID’s to match schematic symbols with footprints on the PCB, and you can do a re-annotation without anything else changing. The parts both in the schematic and on the PCB will get updated. When you do the Re-link thing however, then KiCad uses the current RefDes of the schematic symbols to match with the current RefDes of the footprints on the PCB. This option is only used if synchronization is somehow lost, and it must be manually repaired.

Also, if you accidentally do this and you see the mess on your PCB, the easiest way to fix it is to just exit the PCB editor without saving. Especially when you saved the PCB layout before you started this operation it is an easy choice. Another easy choice is to use [Ctrl + Z] to undo the changes on the PCB. There are plenty of ways to fix it, and it is also a typical beginners mistake. Adding a nag screen for this would be a hindrance for more experienced KiCad users. The longer tooltip description is also quite clear:

A lot of KiCad’s tooltips are quite good. They give extra explanations and usage hints instead of just rephrasing the abstract meaning of some function.

On the other hand the default linkage, i.e. the option unchecked, can also destroy the layout (when you delete and re-add symbols). It wouldn’t make much sense to add a warning to this dialog that it can destroy the layout regardless of how it is used, would it?

I don’t know if there could be some kind of sanity check when running this dialog. KiCad can’t read the user’s mind to find out what they meant, but does there exist a logical case which users most probably don’t intend and which is created accidentally?