Capes and Things and Makefile(s)/Stuff and Generalized Makefile Commands

First off…I am not sure how to acquire a BOM from this repo just yet.

silver2row/bumps: BeagleBone Universal Multi Pololu Steppers

I copied that repo from someone online and I am currently trying the make command in a Makefile which seems simple but there is something going on that I cannot describe just yet…

Supposedly, from what I believe, the repo builds a BOM out of the Makefile and related files.

For the life of me, I cannot get the Makefile to compile correctly…

If you see my error(s), please try to be patient with me and let me help you help me…

pcbnew is not being recognized… Kicad just or will very shortly deprecate swig_python_modules which was in charge of the source code for Python3 and Kicad scripting. I am at a loss.

Send guidance if this suits your expertise.

make
sed "s/%%gitversion%%/`git log --date=short --pretty=format:'%h@%cd' -n 1`/" < bumps.kicad_pcb > bumps-fab.kicad_pcb
python3 kicad-scripts/kicad-fab.py bumps-fab.kicad_pcb
Traceback (most recent call last):
  File "/home/lertl/bumps/kicad-scripts/kicad-fab.py", line 17, in <module>
    import pcbnew
ModuleNotFoundError: No module named 'pcbnew'
make: *** [kicad-scripts/makefile.inc:4: bumps-fab.zip] Error 1
rm bumps-fab.kicad_pc

That is the error so far and importing pcbnew seems to be an older way to handle things but is used on their files, i.e. Kicad libraries.

Heck, I do not even know where to search for the python3_kicad_scripting files to incorporate them in the build so far. sudo find is failing on WSL2 thus far with Kicad files.

Now, one thing to note. I can run kicad and the source code boots a GUI of Kicad for use cases.

Kryptonite is sed in this manner so far.

cat kicad-scripts/kicad-fab.py
#!/usr/bin/python3

'''
    Based on gen_gerber_and_drill_files_board.py in kicad/demos directory.
'''

import sys
import os

# Example path for KiCad 8 on Windows
kicad_python_path = "."

if os.path.exists(kicad_python_path):
    sys.path.append(kicad_python_path)
else:
    raise FileNotFoundError(f"KiCad Python path not found: {kicad_python_path}")
import pcbnew



filename=sys.argv[1]

board = pcbnew.LoadBoard(filename)

plotDir = "plot/"

pctl = PLOT_CONTROLLER(board)

popt = pctl.GetPlotOptions()

popt.SetOutputDirectory(plotDir)

# Set some important plot options:
popt.SetPlotFrameRef(False)
popt.SetLineWidth(FromMM(0.35))

popt.SetAutoScale(False)
popt.SetScale(1)
popt.SetMirror(False)
popt.SetUseGerberAttributes(True)
popt.SetUseGerberProtelExtensions(True)
popt.SetExcludeEdgeLayer(True);
popt.SetScale(1)
popt.SetUseAuxOrigin(True)

# This by gerbers only (also the name is truly horrid!)
popt.SetSubtractMaskFromSilk(False)

# param 0 is the layer ID
# param 1 is a string added to the file base name to identify the drawing
# param 2 is a comment
# Create filenames in a way that if they are sorted alphabetically, they
# are shown in exactly the layering the board would look like. So
#   gerbv *
# just makes sense.
plot_plan = [
    ( Edge_Cuts, "0-EdgeCuts",    "Edges" ),

    ( F_Paste,   "1-PasteTop",    "Paste top" ),
    ( F_SilkS,   "2-SilkTop",     "Silk top" ),
    ( F_Mask,    "3-MaskTop",     "Mask top" ),
    ( F_Cu,      "4-CuTop",       "Top layer" ),

    ( B_Cu,      "5-CuBottom",    "Bottom layer" ),
    ( B_Mask,    "6-MaskBottom",  "Mask bottom" ),
    ( B_SilkS,   "7-SilkBottom",  "Silk top" ),
    ( B_Paste,   "8-PasteBottom", "Paste Bottom" ),
]


for layer_info in plot_plan:
    pctl.SetLayer(layer_info[0])
    pctl.OpenPlotfile(layer_info[1], PLOT_FORMAT_GERBER, layer_info[2])
    pctl.PlotLayer()

# At the end you have to close the last plot, otherwise you don't know when
# the object will be recycled!
pctl.ClosePlot()

# Fabricators need drill files.
# sometimes a drill map file is asked (for verification purpose)
drlwriter = EXCELLON_WRITER( board )
drlwriter.SetMapFileFormat( PLOT_FORMAT_PDF )

mirror = False
minimalHeader = False
offset = wxPoint(0,0)
mergeNPTH = False
drlwriter.SetOptions( mirror, minimalHeader, offset, mergeNPTH )

metricFmt = True
drlwriter.SetFormat( metricFmt )

genDrl = True
genMap = True
drlwriter.CreateDrillandMapFilesSet( plotDir, genDrl, genMap );

That file when done correctly, in a virtual environment, should create the Makefile to produce but errors out on some simple understandings that I cannot grasp right now (for whatever reason).

Anyway, if you are a python3 scripter and know your way around Kicad and pcbnew, please join on in. Oh, here are the error(s) from the above file:

make
sed "s/%%gitversion%%/`git log --date=short --pretty=format:'%h@%cd' -n 1`/" < bumps.kicad_pcb > bumps-fab.kicad_pcb
python3 kicad-scripts/kicad-fab.py bumps-fab.kicad_pcb
20:34:12: Warning: Legacy zone fill strategy is not supported anymore.
Zone fills will be converted on best-effort basis.
Traceback (most recent call last):
  File "/home/lertl/bumps/kicad-scripts/kicad-fab.py", line 27, in <module>
    pctl = PLOT_CONTROLLER(board)
           ^^^^^^^^^^^^^^^
NameError: name 'PLOT_CONTROLLER' is not defined
make: *** [kicad-scripts/makefile.inc:4: bumps-fab.zip] Error 1
rm bumps-fab.kicad_pcb

Okay. All for now. I see the error and I cannot find a workaround for now.

you’re going to need an older version of kicad, version 9 will open the pcb file with some warnings, but will not open the schmatic. gerbv will open the gerbers.

where did you get the original from?

ok, found the original,

original does open with kicad 9, there are some missing compoents, but both schematic and pcb open with kicad 9.

1 Like

So, the schematic is in .png format on the main page but it will not work in adding the components to the Cape in question. I cannot find a BOM either for the Cape. I figured this was done by way of the Makefile.

I can get the PCB working but no components.

So, the final question I guess. Are you sure I need to use an older model of Kicad?

the orginal repo (not the one you modified) does open with kicad 9,

some of the schematic symbols have chaged betweem the two version. now once you open the projecct, there is a feature in kicad to export the BOM.

not sure where the Makefile came from, don’t recall ever seeing one in the projects that i have done.

Okay. So, I need to do what exactly?

I mean…

  1. Import the gerbers
    1. Done
  2. Then, I need to export the BOM in Kicad
    1. Not done yet
    2. Off to test

Is that it?

All I can do so far is this idea:

Okay. And so, in the Schematic Editor in Kicad, I can alter the BOM and make/remove additions.

Have you seen the parts to the repo that installs the BOM or Parts to the board/Cape?

For some reason, I cannot configure the parts (through hole and/or SMD) to attach to the board so I can then export it for mfg.

from bumps directory, command line
kicad bumps.pro

a whole list of libraries not found
just skip it

from:
Tools, Generate Bill of Materials
generates: bumps.csv
this can be opened with libreoffice calc or equivalent

from the schematic, ya can double click on any component to see it’s properties

1 Like

Thank you. Off to test it.

I tested and tested. I had to remove-install-remove-install various versions of Kicad. Finally. Got it.

I owe them some money if this whole contraption works like stated…

And to you @amf99 , I appreciate your insight and help. Do you need anything from me?

I just sent in the .csv to be processed. Hopefully, that is all they will need to produce the part full of parts…

@amf99 ,

I am searching for things in general here on Digikey to support the build:

C1, C2, C3, C4, C5, C7           = Capacitors
6                                = Number of Capacitors
100u                             = Value of Capacitors
CP                               = No Clue? Maybe MFG. part number?
Capacitors_SMD:c_elec_6.3x7.7    = I am not quite sure what this means...

490-GRM31CR60J107KEA8LTR-ND      = The digikey part number as a guess?

I have some 100uF caps I need to attain to finish the build and this one has some odd markings on it in the BOM.

Capacitors_SMD:c_elec_6.3x7.7 is something. This something about caps means surface mount. Okay but the c_elec_6.3x7.7 has no meaning to me so far.

I have researched the size and shape in this matter. No go. No such size…I think.

If you know what I am describing, please do contact me.

Also:

While trying to update the PCB from schematic, I get this bunch of errors… Would you understand for me why this is happening and describe it for me? The reason I am asking is because I get two of the six errors. I see that Kicad does not carry these parts in their repos.

1. Error: Cannot update Q4 (footprint 'SOIC_Packages:SOIC-8_N' not found).
2. Error: Cannot update Q3 (footprint 'SOIC_Packages:SOIC-8_N' not found).
3. Error: Cannot remove unused footprint M1 (locked).
4. Error: Cannot remove unused footprint M2 (locked).
5. Error: Cannot remove unused footprint M3 (locked).
6. Error: Cannot remove unused footprint G*** (locked).

Number 1. and Number 2. are the ones I understand so far. They are not found. Understood. Okay but what is locked I guess is my discerning non-understanding.

capacitor electrolytic size 6.3mm x 7.7 mm

1 Like

in kicad, ya can lock a footprint to the pcb, thus you don’t want to move it. if you double click on the foot print, the properties should show if it’s locked.

fyi, based on the yr of the git repo, it looks like they used kicad 4.0 which ran on ubuntu 14. is what search engine returned.

1 Like

I went to kicad online and for some reason, I cannot find the 4.0 version for Windows or Ubuntu/Debian. I will keep looking.

Here is the board/Cape.

I am off on the sizing of the caps and the (thyristor?) big, yellow part on the bottom right of the photo. I am making headway but the build is not complete yet.

kind of depends on what OS your on when you do your search. on my cheap rpi5 it give me info, on my desktop 22.04 it harder to find things

I found the 4.0 on their gitlab repo. and I will test now.

For some reason, their site is giving me issues. I cannot find any articles on the main pages because the site is slowing my computer and/or my computer is in the way?

I tried:

mkdir -p build
cd build
cmake ..

Error!

Something about cmake < 3.5 is not allowed and kicad is using 
2.5.8 or whatever...

still trying over here…

Oh. Here is the error:

CMake Error at CMakeModules/CheckCXXSymbolExists.cmake:41 (_CHECK_SYMBOL_EXISTS):
  Unknown CMake command "_CHECK_SYMBOL_EXISTS".
Call Stack (most recent call first):
  CMakeModules/PerformFeatureChecks.cmake:86 (check_cxx_symbol_exists)
  CMakeLists.txt:141 (perform_feature_checks)

Then, without mkdir -p build for cmake, I try their /scripts/ files and I get dummy transitional files not available. Blah.

might need to down grade ubuntu to 14.04

1 Like

I am dealing with the KiCad people and they seem to think it is worth a real issue on porting 4.0 to 10.0 in specifics. For instance, on the Schematic Editor, there are tools and a drop down menu.

I tried to use the tools and erased half the repo. I think one person decided to fix it but does not quite know how so far. Heh?

@amf99 ,