Skip to content
Snippets Groups Projects
Commit bc532849 authored by Benjamin Koch's avatar Benjamin Koch
Browse files

fix Kicad crash under KiBot

parent 767a43b9
No related branches found
No related tags found
No related merge requests found
......@@ -465,9 +465,27 @@
- https://github.com/Bouni/kicad-jlcpcb-tools
- https://github.com/matthewlai/JLCKicadTools
- evtl Kibot und so
- KiBot ist genau was ich will und nachdem ich es selbst halbwegs packetiert hatte, habe ich heute gelernt, dass thelegy das auch schon getan hatte:
https://github.com/thelegy/kicad-tools-nix/blob/master/kibot.nix
- Der Grund, warum eeschema_do nicht funktioniert, ist leider ein recht "einfacher": eeschema stürzt auch bei mir ab, wenn ich den Save Button drücke.
- (Ich hatte erst gedacht, es könnte an Wayland liegen und `unset WAYLAND_DISPLAY` gemacht. Das hilft nicht, aber ist evtl nötig, damit er soweit kommt.
Vielleicht hilft es aber dagegen, dass die Dialog zu den Step-Exports auf meinem Desktop aufploppen.)
- Ah, der relevante Teil, um bis zu dem anderen Crash zu kommen ist `-I` am `eeschema_do`, um den Interposer zu deaktivieren.
- Der Crash ist in gtk_file_chooser_dialog_new.
- https://nixos.wiki/wiki/Debug_Symbols
- `nix-build -E 'with import <nixpkgs> {}; enableDebugging kicad.base'`
- Der Stacktrace kommt mir sehr bekannt vor: https://github.com/NixOS/nixpkgs/issues/149812
- https://github.com/NixOS/nixpkgs/issues/149812#issuecomment-1004387735
- Da der ERC jetzt geht, sollte ich mal "Warnungen als Fehler" anschalten und die Warnung zu dem VCC=3.3V beheben. Anscheinend ist der korrekte Weg, das
Package zu bearbeiten. Ok:
https://forum.kicad.info/t/multiple-power-supplies-when-using-a-logic-symbol-from-the-library-causes-a-power-net-conflict/24524/4
TODO und weitere Gedanken:
- LDO für 3.3V ist nicht mehr verfügbar.
- KiBot tut erstmal nur die Bauteile mit LCSC Code in den BOM, aber ich habe bei einigen mich einfach darauf verlassen, dass JLC schon das Basic Part dazu selbst finden wird:
https://github.com/INTI-CMNB/KiBot/blob/master/kibot/resources/config_templates/JLCPCB.kibot.yaml#L103
- Gerber vom Main Board noch mal. Ich hab Polygons noch geändert.
- Subraum-Logos?
......
......@@ -209,7 +209,7 @@
(net 118 "Net-(BZ1-Pad1)")
(net 119 "Net-(BZ1-Pad2)")
(net 120 "/BUZZER")
(net 121 "Net-(U14-Pad1)")
(net 121 "Net-(C5-Pad1)")
(net 122 "Net-(C5-Pad2)")
(net 123 "/Power/VCC")
(net 124 "ADC_AVDD")
......@@ -2964,7 +2964,7 @@
(effects (font (size 1 1) (thickness 0.15)))
(tstamp f746055e-e1b7-4a28-b976-b00ac6db5720)
)
(fp_arc (start -3.9 1.499999) (mid -4.073431 -0.000001) (end -3.9 -1.5) (layer "Dwgs.User") (width 0.12) (tstamp 14c6bb29-f5af-4b2b-94b5-d62fb327663f))
(fp_arc (start -3.9 1.499999) (mid -4.073431 0) (end -3.9 -1.5) (layer "Dwgs.User") (width 0.12) (tstamp 14c6bb29-f5af-4b2b-94b5-d62fb327663f))
(fp_circle (center 2.5 0) (end 8.85 0) (layer "Dwgs.User") (width 0.05) (fill none) (tstamp 53b17e59-2d32-4b40-bf88-a4250cd6d508))
(fp_circle (center 2.5 0) (end 8.73 0) (layer "Dwgs.User") (width 0.12) (fill none) (tstamp a3fa85db-fb3d-4b9e-812b-2367dac57544))
(fp_line (start -1.3 -1) (end -1.3 1) (layer "F.Fab") (width 0.1) (tstamp 1ba6da77-8d48-4675-88ff-f2cd64f3a606))
......@@ -3536,7 +3536,7 @@
(property "LCSC" "C7377")
(property "Sheetfile" "heaters.kicad_sch")
(property "Sheetname" "Heaters")
(path "/54f5266d-1777-4e02-bd31-ebf852aa6849/471ae91f-f60b-4049-ade6-d2a00c28089e")
(path "/54f5266d-1777-4e02-bd31-ebf852aa6849/ce16762f-dc97-4e7a-91ef-c53f6254a44c")
(attr smd)
(fp_text reference "U12" (at -2.413 -3.181) (layer "F.SilkS")
(effects (font (size 0.6 0.6) (thickness 0.15)))
......@@ -3996,7 +3996,7 @@
(fp_line (start 0.5 0.25) (end -0.5 0.25) (layer "F.Fab") (width 0.1) (tstamp 4d7d7f1c-3dde-4746-8cfb-6adb0e7bfde6))
(fp_line (start 0.5 -0.25) (end 0.5 0.25) (layer "F.Fab") (width 0.1) (tstamp 760d6a39-bb30-43ac-b9a8-4dc7b08e89d4))
(pad "1" smd roundrect (at -0.48 0) (size 0.56 0.62) (layers "F.Cu" "F.Paste" "F.Mask") (roundrect_rratio 0.25)
(net 121 "Net-(U14-Pad1)") (pintype "passive") (tstamp 973e5dc3-c49a-4663-af88-d62945659bf4))
(net 121 "Net-(C5-Pad1)") (pintype "passive") (tstamp 973e5dc3-c49a-4663-af88-d62945659bf4))
(pad "2" smd roundrect (at 0.48 0) (size 0.56 0.62) (layers "F.Cu" "F.Paste" "F.Mask") (roundrect_rratio 0.25)
(net 122 "Net-(C5-Pad2)") (pintype "passive") (tstamp 86e7f0bb-836c-4933-bda5-5cd59cfaf91d))
(model "${KICAD6_3DMODEL_DIR}/Capacitor_SMD.3dshapes/C_0402_1005Metric.wrl"
......@@ -4692,13 +4692,13 @@
(fp_line (start -0.175 -1.1) (end -0.675 -0.6) (layer "F.Fab") (width 0.1) (tstamp a0f4bb21-0f1d-4b9d-ac2f-28cd4c78f02d))
(fp_line (start 0.675 -1.1) (end -0.175 -1.1) (layer "F.Fab") (width 0.1) (tstamp d70502cb-db72-4502-ae74-4d4460d9c3b8))
(pad "1" smd rect (at -0.95 -0.65) (size 0.65 0.4) (layers "F.Cu" "F.Paste" "F.Mask")
(net 121 "Net-(U14-Pad1)") (pintype "input") (tstamp 24dc145f-f530-4f1d-b431-4bdae4af6f0b))
(net 121 "Net-(C5-Pad1)") (pintype "input") (tstamp 24dc145f-f530-4f1d-b431-4bdae4af6f0b))
(pad "2" smd rect (at -0.95 0) (size 0.65 0.4) (layers "F.Cu" "F.Paste" "F.Mask")
(net 4 "GND") (pinfunction "GND") (pintype "power_in") (tstamp bc564f62-3952-4fe4-a8fb-02b89bbc85db))
(pad "3" smd rect (at -0.95 0.65) (size 0.65 0.4) (layers "F.Cu" "F.Paste" "F.Mask")
(net 120 "/BUZZER") (pintype "input") (tstamp bf7c4c01-45f7-4f6e-9391-a0baf117c1e3))
(pad "4" smd rect (at 0.95 0.65) (size 0.65 0.4) (layers "F.Cu" "F.Paste" "F.Mask")
(net 121 "Net-(U14-Pad1)") (pintype "output") (tstamp 99fdcba7-ce75-443c-910b-10cfcbd41734))
(net 121 "Net-(C5-Pad1)") (pintype "output") (tstamp 99fdcba7-ce75-443c-910b-10cfcbd41734))
(pad "5" smd rect (at 0.95 0) (size 0.65 0.4) (layers "F.Cu" "F.Paste" "F.Mask")
(net 25 "+3.3V") (pinfunction "VCC") (pintype "power_in") (tstamp 5e3f1016-c928-4c08-bfcb-57b41e8b147c))
(pad "6" smd rect (at 0.95 -0.65) (size 0.65 0.4) (layers "F.Cu" "F.Paste" "F.Mask")
......@@ -6688,7 +6688,7 @@
(net 10 "+5V") (pinfunction "VIN/EN") (pintype "input") (tstamp 13cfb5d2-0498-45e0-b53e-823eac145ebf))
(pad "4" smd roundrect (at 1.1375 0.95 90) (size 1.325 0.6) (layers "F.Cu" "F.Paste" "F.Mask") (roundrect_rratio 0.25) (tstamp 6baabc67-6ff9-485b-9dea-922ad29eaac5))
(pad "5" smd roundrect (at 1.1375 -0.95 90) (size 1.325 0.6) (layers "F.Cu" "F.Paste" "F.Mask") (roundrect_rratio 0.25)
(net 25 "+3.3V") (pinfunction "VOUT") (pintype "power_out") (tstamp cee1da60-6f42-4501-aebf-fc2592e0834c))
(net 25 "+3.3V") (pinfunction "VOUT") (pintype "passive") (tstamp cee1da60-6f42-4501-aebf-fc2592e0834c))
(model "${KICAD6_3DMODEL_DIR}/Package_TO_SOT_SMD.3dshapes/SOT-23-5.wrl"
(offset (xyz 0 0 0))
(scale (xyz 1 1 1))
......@@ -8025,11 +8025,11 @@
(fp_line (start -0.8 -1.05) (end -0.4 -1.45) (layer "F.Fab") (width 0.1) (tstamp d62c0b7a-ad99-42b6-b26d-078b83a8903b))
(fp_line (start 0.8 -1.45) (end 0.8 1.45) (layer "F.Fab") (width 0.1) (tstamp dbe1c3db-e982-4edf-a5af-1b967e7f66a8))
(pad "1" smd roundrect (at -1.1375 -0.95 180) (size 1.325 0.6) (layers "F.Cu" "F.Paste" "F.Mask") (roundrect_rratio 0.25)
(net 101 "unconnected-(U13-Pad1)") (pintype "passive") (tstamp 5b75a9a0-f3ba-4bf4-b8e8-5e0b0b9c9b4b))
(net 101 "unconnected-(U13-Pad1)") (pintype "passive+no_connect") (tstamp 5b75a9a0-f3ba-4bf4-b8e8-5e0b0b9c9b4b))
(pad "2" smd roundrect (at -1.1375 0 180) (size 1.325 0.6) (layers "F.Cu" "F.Paste" "F.Mask") (roundrect_rratio 0.25)
(net 4 "GND") (pinfunction "VSS") (pintype "power_in") (tstamp 362b2431-4648-44dc-b84e-b0185818b2b9))
(pad "3" smd roundrect (at -1.1375 0.95 180) (size 1.325 0.6) (layers "F.Cu" "F.Paste" "F.Mask") (roundrect_rratio 0.25)
(net 102 "unconnected-(U13-Pad3)") (pintype "passive") (tstamp 1e59b398-3611-42d5-990c-57e6fa9baeed))
(net 102 "unconnected-(U13-Pad3)") (pintype "passive+no_connect") (tstamp 1e59b398-3611-42d5-990c-57e6fa9baeed))
(pad "4" smd roundrect (at 1.1375 0.95 180) (size 1.325 0.6) (layers "F.Cu" "F.Paste" "F.Mask") (roundrect_rratio 0.25)
(net 55 "/SBU2") (pintype "passive") (tstamp 725cae0a-e017-4302-aa54-44fec2aa1381))
(pad "5" smd roundrect (at 1.1375 0 180) (size 1.325 0.6) (layers "F.Cu" "F.Paste" "F.Mask") (roundrect_rratio 0.25)
......@@ -82,7 +82,9 @@
"courtyards_overlap|179515001|81042001|7bba0f35-9b1a-483b-ac2f-471ab5152f13|a69df760-5a4b-43e4-9539-4e2b41f3b03b",
"silk_over_copper|125514000|108422000|28abfba1-19ac-4dbc-8984-5cd78196883b|6ecd7e43-e0d0-4bfc-bf9b-8d8909d7bdb0",
"silk_over_copper|140704857|108602428|74873cc3-21a9-42ec-96de-f93e92b9166e|bdfbe82f-f822-416c-8812-a96f51217e40",
"silk_over_copper|140754534|108486515|74873cc3-21a9-42ec-96de-f93e92b9166e|bdfbe82f-f822-416c-8812-a96f51217e40",
"silk_over_copper|144051428|108527000|0e3a422c-5dab-469c-bdb0-e12f3c0095d8|49737725-d375-4e5b-aa7d-b1f2fec2f40c",
"silk_over_copper|144051428|108602428|0e3a422c-5dab-469c-bdb0-e12f3c0095d8|49737725-d375-4e5b-aa7d-b1f2fec2f40c",
"silk_over_copper|187960000|74675000|99e410dd-67d0-4e47-95f5-63b9c5ef7060|60406cec-b0f2-478a-9470-7af9fc85ce91",
"silk_over_copper|187960000|84075000|99e410dd-67d0-4e47-95f5-63b9c5ef7060|5ca2b379-0afa-49a8-8cc5-d872b72eff8a",
"silk_overlap|123731428|112701428|6f8ccc17-248d-404f-a9ab-d546a984ee0f|c6baf704-c221-494b-9c9f-19ec1689b27e",
......
......@@ -27,6 +27,22 @@
kiauto = python3Packages.callPackage nix/kiauto.nix { inherit recordmydesktop; };
kidiff = python3Packages.callPackage nix/kidiff.nix { inherit kiauto; };
kicad-vars = pkgs.stdenv.mkDerivation {
name = "kicad-vars";
src = null;
nativeBuildInputs = [ pkgs.makeWrapper ];
makeWrapperArgs = pkgs.kicad.makeWrapperArgs;
unpackPhase = "true";
buildPhase = "";
# make a dummy wrapper and remove the `exec ...` line from it so it can be sourced in a Nix shell
installPhase = ''
dummy=`mktemp tmp.XXXXXXXXXXX`
chmod +x $dummy
makeWrapper $dummy $out $makeWrapperArgs
sed -i "/$dummy/ d" $out
'';
};
kibot = python3Packages.buildPythonApplication {
pname = "KiBot";
version = "2";
......@@ -61,6 +77,7 @@
ghostscript
pandoc
#helvetica-neue-lt-std
tetex
]) ++ [
kikit
kiauto
......@@ -95,8 +112,24 @@
packages = [
(python3.withPackages (p: [ kibot ]))
kibot
pkgs.hello
];
shellHook = ''
# KiAuto wants to run stuff inside xvfb so let's make sure that we don't leak windows to our Wayland desktop.
unset WAYLAND_DISPLAY
# The Kicad package puts several paths into environment variables but only in the wrapper script.
# KiAuto needs some of them, e.g. to find footprint that are available locally.
source ${kicad-vars}
# Fix crash in Gtk save dialog, e.g. start eeschema, open ERC window, click save.
# https://github.com/NixOS/nixpkgs/issues/149812#issuecomment-1004387735
export XDG_DATA_DIRS="${pkgs.gtk3}/share/gsettings-schemas/${pkgs.gtk3.name}:$XDG_DATA_DIRS"
# The interposer causes a crash and KiBot doesn't seem to have any way to disable it or pass extra parameters to
# eeschema_do but we can disable it with an environment variable.
export KIAUTO_INTERPOSER_DISABLE=1
'';
};
}
);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment