T
tscircuit•4w ago
Arduano

Arduano - Just came back from lunch, still figh...

Just came back from lunch, still fighting the rp2040 stuff. The footprint on the tscircuit repo seems off, the spacings are a bit wrong. So I went to look for a kicad footprint online. Found these: https://github.com/crides/kleeb/blob/master/mcu.pretty/rp2040-zero-tht.kicad_mod https://docs.tscircuit.com/guides/importing-modules-and-chips/importing-from-kicad Following the docs on kicad imports, I ran this command:
bun kicad-mod-converter convert-kicad-directory --input-dir ./footprints/kleeb/mcu.pretty --output-dir ./my-tscircuit-footprints
bun kicad-mod-converter convert-kicad-directory --input-dir ./footprints/kleeb/mcu.pretty --output-dir ./my-tscircuit-footprints
It seemed to ignore input dir compleetely and asked for the repo name. I entered crides/kleeb and it generated the folder correctly. The generated code looks something like this (under ./examples):
export const rp2040_zero_thtExample = () => {
return (
<group>
<component footprint={rp2040_zero_tht} />
</group>
)
}
export const rp2040_zero_thtExample = () => {
return (
<group>
<component footprint={rp2040_zero_tht} />
</group>
)
}
But it seems like <component> isn't a real tag anymore and I can't figure out how to embed this footprint into my circuit board. Other tags don't seem to work with this footprint config
6 Replies
Arduano
ArduanoOP•4w ago
When I do something like <breakout footprint={rp2040_zero_tht} /> or <chip footprint={rp2040_zero_tht} />, I get the following error in the UI:
Execution Error:Invalid props for silkscreentext (unnamed): text (Required)
at new Te (blob:http://localhost:3020/30b67c2f-978b-45a6-be4c-41ad580f6261:249:6947)
at new QS (blob:http://localhost:3020/30b67c2f-978b-45a6-be4c-41ad580f6261:249:44973)
at G_ (blob:http://localhost:3020/30b67c2f-978b-45a6-be4c-41ad580f6261:249:53069)
at YOt (blob:http://localhost:3020/30b67c2f-978b-45a6-be4c-41ad580f6261:249:122598)
at Pnt.doInitialPcbFootprintStringRender (blob:http://localhost:3020/30b67c2f-978b-45a6-be4c-41ad580f6261:249:137812)
at Pnt.runRenderPhase (blob:http://localhost:3020/30b67c2f-978b-45a6-be4c-41ad580f6261:249:1995)
at rnt.runRenderPhaseForChildren (blob:http://localhost:3020/30b67c2f-978b-45a6-be4c-41ad580f6261:249:2144)
at rnt.runRenderCycle (blob:http://localhost:3020/30b67c2f-978b-45a6-be4c-41ad580f6261:249:1206)
at q_.render (blob:http://localhost:3020/30b67c2f-978b-45a6-be4c-41ad580f6261:251:77146)
at q_.getCircuitJson (blob:http://localhost:3020/30b67c2f-978b-45a6-be4c-41ad580f6261:251:77763)
@tscircuit/eval@0.0.475 • @tscircuit/core@0.0.867
Execution Error:Invalid props for silkscreentext (unnamed): text (Required)
at new Te (blob:http://localhost:3020/30b67c2f-978b-45a6-be4c-41ad580f6261:249:6947)
at new QS (blob:http://localhost:3020/30b67c2f-978b-45a6-be4c-41ad580f6261:249:44973)
at G_ (blob:http://localhost:3020/30b67c2f-978b-45a6-be4c-41ad580f6261:249:53069)
at YOt (blob:http://localhost:3020/30b67c2f-978b-45a6-be4c-41ad580f6261:249:122598)
at Pnt.doInitialPcbFootprintStringRender (blob:http://localhost:3020/30b67c2f-978b-45a6-be4c-41ad580f6261:249:137812)
at Pnt.runRenderPhase (blob:http://localhost:3020/30b67c2f-978b-45a6-be4c-41ad580f6261:249:1995)
at rnt.runRenderPhaseForChildren (blob:http://localhost:3020/30b67c2f-978b-45a6-be4c-41ad580f6261:249:2144)
at rnt.runRenderCycle (blob:http://localhost:3020/30b67c2f-978b-45a6-be4c-41ad580f6261:249:1206)
at q_.render (blob:http://localhost:3020/30b67c2f-978b-45a6-be4c-41ad580f6261:251:77146)
at q_.getCircuitJson (blob:http://localhost:3020/30b67c2f-978b-45a6-be4c-41ad580f6261:251:77763)
@tscircuit/eval@0.0.475 • @tscircuit/core@0.0.867
I don't have any mention of silkscreentext anywhere in my repo including the codegen so I'm not sure nvm figured it out: I needed to include a "name" prop on the component itself, e.g. <chip footprint={rp2040_zero_tht} name="RPZ" />. Typescript wasn't being helpful. Bug: codgen doesn't properly do type definitions so I get an error like this:
Type '({ type: string; source_component_id: string; supplier_part_numbers: {}; schematic_component_id?: undefined; center?: undefined; rotation?: undefined; size?: undefined; source_port_id?: undefined; ... 21 more ...; text?: undefined; } | ... 6 more ... | { ...; })[]' is not assignable to type 'FootprintProp | undefined'.
Type '({ type: string; source_component_id: string; supplier_part_numbers: {}; schematic_component_id?: undefined; center?: undefined; rotation?: undefined; size?: undefined; source_port_id?: undefined; ... 21 more ...; text?: undefined; } | ... 6 more ... | { ...; })[]' is not assignable to type 'FootprintSoupElements[]'.
Type '{ type: string; source_component_id: string; supplier_part_numbers: {}; schematic_component_id?: undefined; center?: undefined; rotation?: undefined; size?: undefined; source_port_id?: undefined; ... 21 more ...; text?: undefined; } | ... 6 more ... | { ...; }' is not assignable to type 'FootprintSoupElements'.
Type '{ type: string; source_component_id: string; supplier_part_numbers: {}; schematic_component_id?: undefined; center?: undefined; rotation?: undefined; size?: undefined; source_port_id?: undefined; ... 21 more ...; text?: undefined; }' is not assignable to type 'FootprintSoupElements'.
Types of property 'type' are incompatible.
Type 'string' is not assignable to type '"pcb_plated_hole" | "pcb_smtpad"'.ts(2322)
index.d.ts(1431, 5): The expected type comes from property 'footprint' which is declared here on type 'ChipProps'
Type '({ type: string; source_component_id: string; supplier_part_numbers: {}; schematic_component_id?: undefined; center?: undefined; rotation?: undefined; size?: undefined; source_port_id?: undefined; ... 21 more ...; text?: undefined; } | ... 6 more ... | { ...; })[]' is not assignable to type 'FootprintProp | undefined'.
Type '({ type: string; source_component_id: string; supplier_part_numbers: {}; schematic_component_id?: undefined; center?: undefined; rotation?: undefined; size?: undefined; source_port_id?: undefined; ... 21 more ...; text?: undefined; } | ... 6 more ... | { ...; })[]' is not assignable to type 'FootprintSoupElements[]'.
Type '{ type: string; source_component_id: string; supplier_part_numbers: {}; schematic_component_id?: undefined; center?: undefined; rotation?: undefined; size?: undefined; source_port_id?: undefined; ... 21 more ...; text?: undefined; } | ... 6 more ... | { ...; }' is not assignable to type 'FootprintSoupElements'.
Type '{ type: string; source_component_id: string; supplier_part_numbers: {}; schematic_component_id?: undefined; center?: undefined; rotation?: undefined; size?: undefined; source_port_id?: undefined; ... 21 more ...; text?: undefined; }' is not assignable to type 'FootprintSoupElements'.
Types of property 'type' are incompatible.
Type 'string' is not assignable to type '"pcb_plated_hole" | "pcb_smtpad"'.ts(2322)
index.d.ts(1431, 5): The expected type comes from property 'footprint' which is declared here on type 'ChipProps'
suggested solution: either use as FootprintProp on the export or an as const after every string
Seve
Seve•4w ago
yea you're using an old library there, kicad-mod-converter is deprecated
Arduano
ArduanoOP•4w ago
ah, probably good to adjust the docs then
Seve
Seve•4w ago
that's in the docs!?
Seve
Seve•4w ago
omg it is šŸ¤¦ā€ā™‚ļø you can directly import kicad_mod files
import kicadMod from "./footprint.kicad_mod"

export default () => {
return (
<board>
<chip footprint={kicadMod} name="U1" />
</board>
)
}
import kicadMod from "./footprint.kicad_mod"

export default () => {
return (
<board>
<chip footprint={kicadMod} name="U1" />
</board>
)
}

Did you find this page helpful?