delorie.com/archives/browse.cgi   search  
Mail Archives: geda-help/2012/02/08/13:54:02

X-Authentication-Warning: delorie.com: mail set sender to geda-help-bounces using -f
X-Recipient: geda-help AT delorie DOT com
X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on
ham02.websitewelcome.com
X-Spam-Flag2999: NO
X-Spam-Level2999:
X-Spam-Status2999: "No, score=-1.9 required=5.0 tests=BAYES_00 autolearn=ham
version=3.3.1
DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=default; d=gibibit.com;
h=Received:Date:From:To:Subject:Message-ID:In-Reply-To:References:X-Mailer:Mime-Version:Content-Type:X-BWhitelist:X-Source:X-Source-Args:X-Source-Dir:X-Source-Sender:X-Source-Auth:X-Email-Count:X-Source-Cap;
b=RYm2iMXMBk1IJkWydMjRHPUkylpcnADhNPpCUAHc1ktt8wvPRELVN8jTC0rkWP+qZIGUh6CQ0UkzbvcfXcoxmRFkkwyUGLMZsxVtli6sNgUE0Ps8Y82xaB4Nv8Qdqr7C;
Date: Wed, 8 Feb 2012 10:19:34 -0800
From: Colin D Bennett <colin AT gibibit DOT com>
To: geda-help AT delorie DOT com
Subject: Re: [geda-help] Distributing footprints for one's PCBs
Message-ID: <20120208101934.3cab15de@svelte>
In-Reply-To: <20120208113749.6533.qmail@stuge.se>
References: <20120208113749 DOT 6533 DOT qmail AT stuge DOT se>
X-Mailer: Claws Mail 3.7.9 (GTK+ 2.24.6; x86_64-pc-linux-gnu)
Mime-Version: 1.0
X-AntiAbuse: This header was added to track abuse, please include it with any abuse report
X-AntiAbuse: Primary Hostname - gator297.hostgator.com
X-AntiAbuse: Original Domain - delorie.com
X-AntiAbuse: Originator/Caller UID/GID - [47 12] / [47 12]
X-AntiAbuse: Sender Address Domain - gibibit.com
X-BWhitelist: no
X-Source:
X-Source-Args:
X-Source-Dir:
X-Source-Sender: c-67-185-118-84.hsd1.wa.comcast.net (svelte) [67.185.118.84]:41762
X-Source-Auth: colin AT gibibit DOT com
X-Email-Count: 1
X-Source-Cap: c2t5bGVuO3NreWxlbjtnYXRvcjI5Ny5ob3N0Z2F0b3IuY29t
Reply-To: geda-help AT delorie DOT com
Errors-To: nobody AT delorie DOT com
X-Mailing-List: geda-help AT delorie DOT com
X-Unsubscribes-To: listserv AT delorie DOT com

--MP_/+4LwP/ikJT38zOakp0BhrVr
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: quoted-printable
Content-Disposition: inline

On Wed, 8 Feb 2012 12:37:49 +0100
Peter Stuge <peter AT stuge DOT se> wrote:

> Hi!
>=20
> Colin D Bennett wrote:
> > But really, each pcb project should always include files for all
> > footprints and symbols used.
>=20
> Could a separate repository with the footprint/symbol library be
> another acceptable method?

That's a good question.  At first, I thought referring to a separate
repository for my footprints/symbols was the ideal solution.  I
wouldn't have to keep multiple copies of the symbol and footprints
files, and could get updates into my circuit projects when my
symbols and footprints were updated.

However, there are a couple of serious problems with it:

(1) You can't zip up your project and have it be self-contained.

(2) As symbols and footprints are modified in the repository, your
    circuit projects will immediately see these modified symbols.
    In most cases, you will need to do some manual step to ensure
    the new symbols and footprints are applied properly (symbols,
    usually linked and not embedded, will cause a broken schematic
    if pins are moved, for instance).

You _could_ work around problem (2) by always creating a new file
name whenever you change a symbol or footprint, like =E2=80=9CLED-3.sym=E2=
=80=9D
convention used by gschem symbols.  But I want to be bold in
modifying my symbols and footprints to make them better.  And,
requiring the user to rename files whenever they are checked
quickly becomes cumbersome and in my opinion defeats one of the
main reasons for using a version control system in the first place.
Also, gschem doesn't support replacing, e.g., an instance of
LED-2.sym with an instance of LED-3.sym in your schematic -- you
would need to delete and re-add the symbol, which means you would
have to add all the attributes back, which is often MANY attributes
for me (refdes, value, comment/description, manufacturer,
manufacturer_partnum, footprint, ...).

The solution at which I have arrived is working perfectly for me,
and allows clean management of symbol and footprint versions, while
providing me full control over how and when my schematics and board
layouts receive updated versions of the symbols and footprints.  My
circuit project VCS branches are completely self-contained: that
means that if I want to revise a prior version of the board, say
that uses an older footprint, I can check out an old revision of
the circuit project and it will have the correct footprint/symbols
for that older design, which I could modify as needed without being
required to update anything unnecessarily.

Here is my solution:

(1) Symbols and footprints are managed in a central
version-controlled branch called =E2=80=9CElectronic_component_library=E2=
=80=9D:

Electronic_component_library
=E2=94=9C=E2=94=80=E2=94=80 Footprints
=E2=94=82=C2=A0=C2=A0 =E2=94=9C=E2=94=80=E2=94=80 Abracon_ABM8G.fp
=E2=94=82=C2=A0=C2=A0 =E2=94=9C=E2=94=80=E2=94=80 Abracon_ABMM2.fp
=E2=94=82=C2=A0=C2=A0 =E2=94=9C=E2=94=80=E2=94=80 ...
=E2=94=82=C2=A0=C2=A0 =E2=94=9C=E2=94=80=E2=94=80 Tyco_1734035.fp
=E2=94=82=C2=A0=C2=A0 =E2=94=94=E2=94=80=E2=94=80 Vishay_Dale_XT49M_SMD_cry=
stal.fp
=E2=94=9C=E2=94=80=E2=94=80 Symbols
=E2=94=82=C2=A0=C2=A0 =E2=94=9C=E2=94=80=E2=94=80 741G14_Schmitt_Inverter_5=
pin.sym
=E2=94=82=C2=A0=C2=A0 =E2=94=9C=E2=94=80=E2=94=80 74595_with_pwr_serial_out=
_bottom.sym
=E2=94=82=C2=A0=C2=A0 =E2=94=9C=E2=94=80=E2=94=80 ...
=E2=94=82=C2=A0=C2=A0 =E2=94=9C=E2=94=80=E2=94=80 Varistor.sym
=E2=94=82=C2=A0=C2=A0 =E2=94=94=E2=94=80=E2=94=80 Zener_Diode.sym
=E2=94=94=E2=94=80=E2=94=80 update

Note the script called =E2=80=9Cupdate=E2=80=9D in the root.


(2) Circuit projects exist as standalone version-controlled
projects, and have the following structure:

<Project>
=E2=94=9C=E2=94=80=E2=94=80 Footprints
=E2=94=82=C2=A0=C2=A0 =E2=94=9C=E2=94=80=E2=94=80 CK_KMT0.fp
=E2=94=82=C2=A0=C2=A0 =E2=94=9C=E2=94=80=E2=94=80 Header_1x20_100mil_NoSilk=
.fp
=E2=94=82=C2=A0=C2=A0 =E2=94=9C=E2=94=80=E2=94=80 SOT-23_Microchip_TT.fp
=E2=94=82=C2=A0=C2=A0 =E2=94=94=E2=94=80=E2=94=80 ST_LQFP48.fp
=E2=94=9C=E2=94=80=E2=94=80 Layout
=E2=94=82=C2=A0=C2=A0 =E2=94=9C=E2=94=80=E2=94=80 Board.pcb
=E2=94=82=C2=A0=C2=A0 =E2=94=9C=E2=94=80=E2=94=80 Board.project
=E2=94=9C=E2=94=80=E2=94=80 Schematic
=E2=94=82=C2=A0=C2=A0 =E2=94=9C=E2=94=80=E2=94=80 gafrc
=E2=94=82=C2=A0=C2=A0 =E2=94=9C=E2=94=80=E2=94=80 Schematic.sch
=E2=94=94=E2=94=80=E2=94=80 Symbols
 =C2=A0=C2=A0 =E2=94=9C=E2=94=80=E2=94=80 Capacitor.sym
 =C2=A0=C2=A0 =E2=94=9C=E2=94=80=E2=94=80 Connector_20pin.sym
 =C2=A0=C2=A0 =E2=94=9C=E2=94=80=E2=94=80 Microchip_MCP1700_SOT23.sym
 =C2=A0=C2=A0 =E2=94=9C=E2=94=80=E2=94=80 Not_Connected.sym
 =C2=A0=C2=A0 =E2=94=9C=E2=94=80=E2=94=80 Resistor.sym
 =C2=A0=C2=A0 =E2=94=9C=E2=94=80=E2=94=80 Signal_ground.sym
 =C2=A0=C2=A0 =E2=94=94=E2=94=80=E2=94=80 STM32F100_LQFP48_LowMediumDensity=
_PkgOrder.sym

I copy all symbols I want to use from the
Electronic_component_library project into my circuit project's
Symbols directory.  The Schematic/gafrc in my circuit project tells
gschem et al to look in ../Symbols for the symbol files.  Similarly
for footprints, all footprints go in the Footprints directory, and
my Board.project file tells gsch2pcb to look there for footprints.

Now, my circuit project is completely self-contained and will not
be broken if I modify or delete symbols and footprints from the
main electronic component library.

If I do want to get updated symbols and footprints in my circuit
project, all I have to do is run the =E2=80=9Cupdate=E2=80=9D script that i=
s in the
Electronic_component_library project:

.............................
---=3D=3D=3D begin session log =3D=3D=3D---

$ ~/Projects/Electronic_component_library/work/update  .
  NXP_LQFP-48_7x7_SOT313-2.fp: up to date with library.
  APEM_MJTP1230_6mm_tactile_switch__4pin.fp: up to date with library.
  Vishay_Dale_XT49M_SMD_crystal.fp: up to date with library.
U SOT23__MOSFET_1G_2S_3D.fp: updated version available.
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
(/home/cdb/Projects/Electronic_component_library/work/Footprints/SOT23__MOS=
FET_1G_2S_3D.fp differs from ./Footprints/SOT23__MOSFET_1G_2S_3D.fp)
-------------------------------------------------
Library symbol: (source)
-rw-r--r-- 1 cdb cdb 842 2011-01-08 12:57 /home/cdb/Projects/Electronic_com=
ponent_library/work/Footprints/SOT23__MOSFET_1G_2S_3D.fp
# Author: Colin D Bennett <colin AT gibibit DOT com>
# Revision: 2
# Date: 2010-01-14


-------------------------------------------------
Target symbol:
-rw-r--r-- 1 cdb cdb 552 2010-02-09 17:23 ./Footprints/SOT23__MOSFET_1G_2S_=
3D.fp
# Author: Colin D Bennett <colin AT gibibit DOT com>
# Revision: 1
# Date: 2010-01-14


-------------------------------------------------
Update the local copy? [y/N]y
`/home/cdb/Projects/Electronic_component_library/work/Footprints/SOT23__MOS=
FET_1G_2S_3D.fp' -> `./Footprints/SOT23__MOSFET_1G_2S_3D.fp'
  TSOP-5.fp: up to date with library.
  DPAK_Pin2IsTab.fp: up to date with library.
U LED_logical_pins.sym: updated version available.
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
(/home/cdb/Projects/Electronic_component_library/work/Symbols/LED_logical_p=
ins.sym differs from ./Symbols/LED_logical_pins.sym)
-------------------------------------------------
Library symbol: (source)
-rw-r--r-- 1 cdb cdb 1400 2011-05-25 00:20 /home/cdb/Projects/Electronic_co=
mponent_library/work/Symbols/LED_logical_pins.sym
symversion=3D3
-------------------------------------------------
Target symbol:
-rw-r--r-- 1 cdb cdb 1466 2010-02-09 17:23 ./Symbols/LED_logical_pins.sym
symversion=3D1
-------------------------------------------------
Update the local copy? [y/N]y
`/home/cdb/Projects/Electronic_component_library/work/Symbols/LED_logical_p=
ins.sym' -> `./Symbols/LED_logical_pins.sym'
U NMOSFET.sym: updated version available.
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
(/home/cdb/Projects/Electronic_component_library/work/Symbols/NMOSFET.sym d=
iffers from ./Symbols/NMOSFET.sym)
-------------------------------------------------
Library symbol: (source)
-rw-rw-r-- 1 cdb cdb 1134 2012-01-26 17:41 /home/cdb/Projects/Electronic_co=
mponent_library/work/Symbols/NMOSFET.sym
symversion=3D2.1
-------------------------------------------------
Target symbol:
-rw-r--r-- 1 cdb cdb 1093 2010-02-09 17:23 ./Symbols/NMOSFET.sym
symversion=3D1
-------------------------------------------------
Update the local copy? [y/N]y
`/home/cdb/Projects/Electronic_component_library/work/Symbols/NMOSFET.sym' =
-> `./Symbols/NMOSFET.sym'
  ON_Semiconductor_NCP1117.sym: up to date with library.
  Switch_pushbutton_NO_simple_4pin.sym: up to date with library.

---=3D=3D=3D end session log =3D=3D=3D---
.............................

After copying in any updated symbols, you will need to verify the
schematic is correct, and you might need to mess around in gschem
to get it to stop complaining about a =E2=80=9Cmajor version change=E2=80=
=9D.

After copying in any update footprints, you will need to update the
elements in an existing board layout file one-by-one, though pcb
provides a trick that allows you to paste a new element as a
replacement of an existing one.  Actually, I often will delete the
element from the board, save the layout, run gsch2pcb, and paste
the Board.new.pcb file, placing it by hand.  If you have dozens of
changed elements, you unfortunately have to do it one-by-one no
matter what, though I recall someone having made a script to
do it automatically by parsing and modifying the .pcb file.

In case anyone else finds it useful, I've attached my update script.

Regards,
Colin

--MP_/+4LwP/ikJT38zOakp0BhrVr
Content-Type: application/octet-stream; name=update
Content-Transfer-Encoding: base64
Content-Disposition: attachment; filename=update

IyEvYmluL3NoCiMKIyBTY3JpcHQgdG8gY29weSBuZXdlciBmaWxlcyBmcm9tIHRoZSBnRURBIGdz
Y2hlbS9wY2IgZWxlY3Ryb25pYyBjb21wb25lbnQKIyBzeW1ib2wvZm9vdHByaW50IGxpYnJhcnkg
aW50byBhIHByb2plY3QuCiMKIyBCeSBDb2xpbiBEIEJlbm5ldHQgPGNvbGluQGdpYmliaXQuY29t
PiwgMjAxMS0wNS0wNC4KIyBMYXN0IHVwZGF0ZWQgMjAxMS0wMi0wOC4KCgpkaWUoKSB7CiAgICBl
Y2hvICJFcnJvcjogJDEiID4mMgogICAgZXhpdCAxCn0KCiMgVXNhZ2U6IGNvcHlfdXBkYXRlcyBT
UkNESVIgREVTVERJUgojIE9wZXJhdGlvbiByZWN1cnNlcyBkb3duIHRoZSBkaXJlY3RvcnkgdHJl
ZS4KY29weV91cGRhdGVzKCkgewogICAgbG9jYWwgU1JDRElSPSIkMSI7IHNoaWZ0CiAgICBsb2Nh
bCBERVNURElSPSIkMSI7IHNoaWZ0CgogICAgIyBGaW5kIGFsbCBub24taGlkZGVuIGZpbGVzLgog
ICAgbG9jYWwgZGVzdHBhdGgKICAgIGZvciBkZXN0cGF0aCBpbiAkKAogICAgICAgICAgICBmaW5k
ICIke0RFU1RESVJ9IiBcCiAgICAgICAgICAgICAgICAtdHlwZSBmIFwKICAgICAgICAgICAgICAg
ICEgLXBhdGggJyovLionIFwKICAgICAgICAgICAgICAgICEgLW5hbWUgJyp+Jyk7IGRvCiAgICAg
ICAgY2FzZSAiJHtkZXN0cGF0aH0iIGluCiAgICAgICAgICAgICouc3ltfCouZnApCiAgICAgICAg
ICAgICAgICBjb3B5X2ZpbGVfdXBkYXRlICIke1NSQ0RJUn0iICIke2Rlc3RwYXRofSIKICAgICAg
ICAgICAgICAgIDs7CiAgICAgICAgICAgICMgSWdub3JlIGFsbCBvdGhlciBmaWxlIHR5cGVzLgog
ICAgICAgIGVzYWMKICAgIGRvbmUKfQoKIyBVc2FnZTogY29weV9maWxlX3VwZGF0ZSBTUkNESVIg
REVTVFBBVEgKY29weV9maWxlX3VwZGF0ZSgpIHsKICAgIGxvY2FsIHNyY2Rpcj0iJDEiOyBzaGlm
dAogICAgbG9jYWwgZGVzdHBhdGg9IiQxIjsgc2hpZnQKCiAgICBuYW1lPSQoYmFzZW5hbWUgIiR7
ZGVzdHBhdGh9IikKICAgIHNyY3BhdGg9JChmaW5kICIke3NyY2Rpcn0iIC1uYW1lICIke25hbWV9
IiAtdHlwZSBmKQogICAgaWYgWyAtbiAiJHtzcmNwYXRofSIgXTsgdGhlbgogICAgICAgICMgVGhp
cyBmaWxlIGV4aXN0cyBpbiB0aGUgbGlicmFyeS4KICAgICAgICAjIFNlZSBpZiBhIG5ld2VyIHZl
cnNpb24gaXMgYXZhaWxhYmxlLgogICAgICAgIGNtcCAtLXF1aWV0ICIke3NyY3BhdGh9IiAiJHtk
ZXN0cGF0aH0iCiAgICAgICAgY21wX3N0YXR1cz0kPwogICAgICAgICMgU3RhdHVzIGlzIDAgaWYg
aW5wdXRzIGFyZSBzYW1lLCAxIGlmIGRpZmZlcmVudCwgMiBpZiB0cm91YmxlLgogICAgICAgIGlm
IFsgIiRjbXBfc3RhdHVzIiA9IDEgXTsgdGhlbgogICAgICAgICAgICBlY2hvICJVICR7bmFtZX06
IHVwZGF0ZWQgdmVyc2lvbiBhdmFpbGFibGUuIgogICAgICAgICAgICBlY2hvICI9PT09PT09PT09
PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09IgogICAgICAgICAgICBlY2hv
ICIoJHtzcmNwYXRofSBkaWZmZXJzIGZyb20gJHtkZXN0cGF0aH0pIgogICAgICAgICAgICBlY2hv
ICItLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tIgogICAg
ICAgICAgICBlY2hvICJMaWJyYXJ5IHN5bWJvbDogKHNvdXJjZSkiCiAgICAgICAgICAgIHNob3df
ZmlsZV9pbmZvICIke3NyY3BhdGh9IgogICAgICAgICAgICBlY2hvICItLS0tLS0tLS0tLS0tLS0t
LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tIgogICAgICAgICAgICBlY2hvICJUYXJn
ZXQgc3ltYm9sOiIKICAgICAgICAgICAgc2hvd19maWxlX2luZm8gIiR7ZGVzdHBhdGh9IgogICAg
ICAgICAgICBlY2hvICItLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t
LS0tLS0tIgogICAgICAgICAgICBlY2hvIC1uICJVcGRhdGUgdGhlIGxvY2FsIGNvcHk/IFt5L05d
IgogICAgICAgICAgICByZWFkIGFuc3dlcgogICAgICAgICAgICBpZiBbICIke2Fuc3dlcn0iID0g
InkiIC1vICIke2Fuc3dlcn0iID0gIlkiIF07IHRoZW4KICAgICAgICAgICAgICAgIGNwIC12ICIk
e3NyY3BhdGh9IiAiJHtkZXN0cGF0aH0iCiAgICAgICAgICAgIGZpCiAgICAgICAgZWxpZiBbICIk
Y21wX3N0YXR1cyIgPSAwIF07IHRoZW4KICAgICAgICAgICAgZWNobyAiICAke25hbWV9OiB1cCB0
byBkYXRlIHdpdGggbGlicmFyeS4iCiAgICAgICAgZWxzZQogICAgICAgICAgICBlY2hvICIgICR7
bmFtZX06IEVSUk9SIGNvbXBhcmluZyB3aXRoIGxpYnJhcnkgc3ltYm9sLiIKICAgICAgICBmaQog
ICAgZWxzZQogICAgICAgIGVjaG8gIj8gJHtuYW1lfTogbm90IGF2YWlsYWJsZSBpbiBsaWJyYXJ5
LiIKICAgIGZpCn0KCiMgVXNhZ2U6IHNob3dfZmlsZV9pbmZvIEZJTEUKc2hvd19maWxlX2luZm8o
KSB7CiAgICBsb2NhbCBmPSIkMSIKCiAgICBscyAtbCAiJGYiCiAgICBjYXNlICIke2Z9IiBpbgog
ICAgICAgICouc3ltKQogICAgICAgICAgICBncmVwICJzeW12ZXJzaW9uPSIgIiRmIgogICAgICAg
ICAgICA7OwogICAgICAgICouZnApCiAgICAgICAgICAgIGhlYWQgLW4gNSAiJGYiCiAgICAgICAg
ICAgIDs7CiAgICBlc2FjCn0KCiMKIyBNYWluIHByb2dyYW0KIwoKTElCRElSPSIkKGRpcm5hbWUg
IiQwIikiClsgJCMgLWdlIDEgXSB8fCBkaWUgIlVzYWdlOiAkMCBQUk9KRUNURElSIgpQUk9KRUNU
RElSPSIkMSI7IHNoaWZ0ClsgJCMgLWVxIDAgXSB8fCBkaWUgIkV4dHJhIGFyZ3VtZW50cyBvbiBj
b21tYW5kIGxpbmUiCgoKY29weV91cGRhdGVzICIke0xJQkRJUn0iICIke1BST0pFQ1RESVJ9IgoK
IyB2aW06IHNldCBldCBub3NtYXJ0dGFiIHNtYXJ0aW5kZW50IHRzPTQgc3RzPTQgc3c9NDoK

--MP_/+4LwP/ikJT38zOakp0BhrVr--

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019