Repository navigation
Conversation
…xx#783) Two bundled templates could not be applied at all on KiCad 10, and four mapped pins that their symbols do not have: - usb_c_5v_sink placed Connector:USB_C_Receptacle_USB2.0 and stm32_minimal placed Connector:Conn_ARM_SWD_10; neither exists, so apply_template refused both templates. - ldo_3v3 mapped U.VIN/U.VOUT on AMS1117-3.3 (pins VI/VO), stm32_minimal mapped OSC_IN/OSC_OUT/SWDIO/SWCLK (pins PH0/PH1/PA13/PA14), and buck_converter mapped FB/BOOT on TPS563200 (pins VFB/VBST). ldo_3v3 now uses AP2112K-3.3 with 1uF ceramic capacitors, which its datasheet states is stable, ties EN to VIN (EN has a 3M pull-down), and maps both capacitors. stm32_minimal gets VCAP1 4.7uF, BOOT0 and PB2 pull-downs, VBAT/VSSA/VCAP1 mapped, a connection for every capacitor, four 100nF for the three VDD pins plus VDDA, and ST's 10pF Cstray estimate. A test resolves every component of every bundled template against the installed KiCad library and checks every mapped pin against the symbol's pin names, numbers and alternates. It skips without KiCad and runs in the E2E workflow, which installs it.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Two bundled templates could not be applied on KiCad 10 at all, and four templates sent the agent to pins their symbols do not have. This fixes every template's symbol and pin names, gives
ldo_3v3andstm32_minimalthe content #783 asks for, and adds a test that checks the templates against the installed KiCad library.Closes #783
Measured on
main@9488e5f, applying each bundled template to a fresh copy oftests/fixtures/derived_lib_name.kicad_sch(KiCad 10.0.6, Windows 11):usb_c_5v_sinkConnector:USB_C_Receptacle_USB2.0not foundstm32_minimalConnector:Conn_ARM_SWD_10not foundldo_3v3,i2c_pullups,led_indicator,buck_converterkicad-cli sch export netlistloads every result; thestm32_minimalnetlist lists all 15 template parts with their pins.The new test, run against the unchanged templates, reports:
Three of these were not listed in #783: the USB-C symbol name and the TPS563200
FB/BOOTpins (VFB/VBST).Approach
Symbol and pin names.
USB_C_Receptacle_USB2.0→USB_C_Receptacle_USB2.0_16P;Conn_ARM_SWD_10→Conn_ARM_JTAG_SWD_10; STM32 pins by name (PH0,PH1,PA13,PA14);U.FB/U.BOOT→U.VFB/U.VBST.ldo_3v3. AMS1117 with a 10 µF ceramic output contradicted the template's own note. It now usesAP2112K-3.3, as #783 suggests. The values below come from the Diodes datasheet (DS39724 Rev. 2-2):stm32_minimal. Every item in #783's acceptance list:The SWD header's
~{RESET},VTref,GNDandGNDDetectare mapped too. The VCAP and Cstray values follow the datasheet references in #783. st.com refused automated downloads, so I could not re-read DS10314 myself.Capacitor and resistor endpoints use the template-local convention that
i2c_pullupsandled_indicatoralready use (C8.1= the eighth capacitor in component-list order). The design notes say so, becauseapply_templatenumbers parts from the schematic's next free reference.Test.
builtin_templates_name_symbols_and_pins_that_exist_in_kicadchecks every bundled template:lib_idmust resolve throughKiCadSymbolSourceandresolve_lib_symbol_flattened_node.from/toendpoint of the formPREFIX[N].PINmust match a pin name, number oralternateof that part's symbol. A symbol that resolves with no pins also fails, so the check cannot pass vacuously.When no KiCad library is installed the test skips, unless
KICAD_CLIis set. In that case it fails, so the E2E job cannot skip it silently. A step ine2e-kicad.ymlruns it there.Architectural fit
This uses the existing symbol resolution that
apply_templateitself places parts with. No new mechanism or workaround is added.Exclusions:
apply_templatedoes not wire; passives of other templates have no connections) is untouched.usb_c_5v_sink'sDevice:D_TVSwith valuePRTR5V0U2Xis a two-pin symbol for a four-pin part. That is a content question, not a naming one, and is left as is.Branch and dependencies
Base branch:
main@9488e5f. No dependencies. Not part of a series. This PR owns all of #783's acceptance criteria.Compatibility and safety
ldo_3v3places AP2112K-3.3 and two capacitors instead of AMS1117-3.3 and four. A caller that hard-coded the old part list forldo_3v3sees different parts.Validation
Changed tool behavior
usb_c_5v_sinkandstm32_minimalhit the existing "not found in library" error.kicad-cliloads each result.Windows 11, KiCad 10.0.6 installed:
cargo fmt --all -- --check: cleancargo clippy -p konnect-core --all-targets --locked -- -D warnings: cleancargo test -p konnect-core --locked --lib: 1657 passed, 23 failed, 21 ignored. The same 23 tests fail on unchangedmain@9488e5fon this machine (pcb_components,sch_components,schematic_placement_tests,library::symbol_source_tests). The list was compared line by line and is identical, so the failures are environmental. The new test is the one extra pass.cargo test -p konnect-core --locked --test integration_test --test conformance_test: 16 passedcargo test -p konnect-core --locked --doc: ok