devbisme / skidl

SKiDL is a module that extends Python with the ability to design electronic circuits.
https://devbisme.github.io/skidl/
MIT License
1.02k stars 118 forks source link

ERROR: No footprint for ATMEGA16U2-MU/U4. #55

Closed RCoeurjoly closed 5 years ago

RCoeurjoly commented 5 years ago

When executing this SKiDL program, I get the following errors:

ERROR: No footprint for RESET_SWITCH/SW1. ERROR: No footprint for LD1117S50TR/U1. ERROR: No footprint for LM358/U2. ERROR: No footprint for ATMEGA16U2-MU/U4.

0 warnings found during netlist generation. 4 errors found during netlist generation.

Then, I do a search for ATMEGA16U2-MU and the final lines tell me this.

MCU_Microchip_ATmega.lib: ATmega8U2-MU (16MHz, 8kB Flash, 512B SRAM, 512B EEPROM, QFN-32)

So I suppose the component is included in the libraries, including footprint.

What would be the correct way to troubleshoot problems like that, of missing components or footprints?

xesscorp commented 5 years ago

I generated the .net file for the Arduino project and the devices shown above have no "footprint" fields. So when netlist_to_skidl generated the SKiDL file, these parts had no footprints and caused the errors.

All the other parts in the .net file had footprint fields populated with "~", so they didn't have real footprints, either. But all SKiDL cares about is that there is something in the footprint field, even if it's not a valid footprint. The invalid footprint will be detected when the netlist is imported into PCBNEW.

You'll have to instantiate real footprints into the SKiDL code. There used to be a separate program called CVPCB that could be used to assign footprints to parts in a netlist file. But that program was integrated into EESCHEMA when KiCad 5.0 came out. At this time, you'll have to manually assign footprints in the SKiDL code by picking them out of the KiCad .pretty folders. (Alternatively, you could use EESCHEMA to assign footprints on the original schematic, generate the netlist, and then run netlist_to_skidl on that.)

Missing components (i.e., schematic symbols) typically occur with SKiDL code that was developed using the old KiCad 4.0 part libraries but is then compiled using the new KiCad 5.0 libraries. The only thing you can do here is replace the old part names with the new names in the 5.0 libraries. (An alternative might be to use the "-cache.lib" file for a project which stores the parts for a schematic.)