SOLVED - KiCAD templates


#1

I’ve read the rather anemic documentation on using Templates in KiCAD (http://docs.kicad-pcb.org/en/kicad.html#_using_templates) and used that to create what I thought should be a workable template but alas, its not doing what I would expect, based on those documents.

I’m hoping someone with experience using them can point out what I’m doing wrong or explain why what I’m trying to do isn’t work or that it shouldn’t work the way I think it does.

I want to create a template incorporating fab design rules so I don’t have to keep entering them in. So, I created a new folder under the kicad/share/kicad/template folder - lets call it “Fab” for argument - and in that folder created a “meta” folder within which I created an info.html and a icon.png file. I also saved a PCB file I’d created that has the preference set within it I need to that directory and called it “Fab.kicad_pcb”.

My expectation is that upon opening KiCAD and selecting create project from template, once I choose that template, it should create a new project file with a new .sch file and a copy of the Fab.kicad_pcb file which has the name of the new project instead of “Fab”.

I see my template in the template selection screen, including the icon and the info.html content, but what I get in the new project is a Eescheme and Kicad_pcb file right next to one called “Fab.kicad_pcb”. When I open the new pcb file, none of my settings are there.

I’m assuming that I’ve missed something but I don’t know what. Can anyone help?


#2

i have done this with the steps from the tutorial and it is working.
all files that have not the absolute same name like the template folder and are not in the meta folder (be careful with special characters and case sensitivity) will be copied to your new project.

your idea of a partial template is the source of the confusion:
i have build a ‘template_TEST1’ and only copied a board-file there.
and i see the same behaviour - it generates a new project but dont use the template file.
fix:
add a project file ‘template_TEST1.pro’ (change to your template name’)
for this just create a new empty project and copy it from there or copy it from ‘/usr/share/kicad/template/kicad.pro’

that worked for me.

sunny greetings
stefan


#3

You hit the nail on the head - by including a project file in the template folder, it now works as expected. I’m going to have to re-read the template documentation carefully because if that’s in the list of required files, I totally missed it.


#4

anyone looking the link in the question changed
from
http://docs.kicad-pcb.org/en/kicad.html#usingtemplates
to
http://docs.kicad-pcb.org/stable/en/kicad.html


#5

I’ve just created a new template and made a Pull request to add it to the default templates. This includes the EEPROM plus the power components for if you need to power the Pi from the HAT. I’ve left out the camera and display cutouts in this version. I need to sort out how to add them but have them removable in a clean way.
HAT Template with Power Protection