The Trouble with Gerbers

I tend to dally here and there in electronics. As I'm not a "professional" (but absolutely in "hacker" category) there are often conventions that end up being completely foreign to me. The most recent of these was the handling of Gerber files by Texas Instruments.

A little history

G-code is a generic term for the text based command language used by CNC devices. Most dialects originate from a standard published by the Electronic Industries Alliance (EIA) in the early 1960s referred to as "RS-274". I say "dialects" because (like most languages used in computing) it's been extended, mutated, and generally abused in the name of getting shit done.

If you've never seen it before, here's an example:

G90  ; Set all coordinates as absolute
G21  ; Set all units to millimeters
G1 X-10 Y-10  ; Move to the point X=-10, Y=-10
G2 X90.6 Y13.8 Z10 I5 J10 E22.4  ; This is more complex:
; Execute a clockwise arc ending at X=90.6, Y13.8, Z10
;   maintaining constant distance around the point X=5, Y=10
;   while extruding 22.4 units of material

If you wanted to visualize G-code, there are plenty of simulators which will show you the "tool path" (i.e. the actual movements which will be exected). After doing a quick search I found this one which was pretty neat.

The "G-Code Q'n'dirty toolpath simulator" by Nicolas Raynaud.

So, at the end of the day, we use G-code to control our robots.

Back to electronics

"Gerbers" are the specification used by most devices which manufacture PCBs. As mentioned earlier, Gerbers themselves use a specific dialect of G-code called "RS-274-X"12. The process of manufacturing a PCB involves a number of steps including taking layers of fiberglass with copper traces milled in place, stacking them, covering the outer layers in an epoxy type substance called "solder mask", and screen printing text onto the resulting board.

Each of the individual layers ends up getting it's own file with it's own definitions... and there's the rub.

Since (at the end of the day) these are all just files containing structured text data in a format originally ratified over 50 years ago, one could say that things are ocassionally "messy".

When one downloads a set of Gerbers they're (generally) all in a zip file. There are then a set of psuedo standards around how they're named. As a KiCad user, I'm used to having to output the following:

File extension Purpose
.GTL Gerber top (signal/copper) layer
.GBL Gerber bottom (signal/copper) layer
.GTO Gerber top overlay
.GBO Gerber bottom overlay
.GTP Gerber top paste mask
.GBP Gerber bottom paste mask
.GTS Gerber top solder mask
.GBS Gerber bottom solder mask
.GKO Gerber "keep-out" layer
.DRL Excellon drill file
.GL2, .GL3 Gerber (signal/copper) layer 2, 3, etc

Additionally, I've seen some manufacturers want these file names:

File extension Purpose
.GML Gerber mechanical layer
.GP1, .GP2, … , .GP16 Internal Plane Layer 1,2,...,16
.GD1 Drill drawing
.GG1 Drill guide

Notice the Excellon3 drill file in the first list and the "Drill drawing" and "Drill guide" in the second. Because... you know... why not?

In the process of researching this I learned that most of these file names are just a psuedo-standard derived from the proprietary schematic capture/design software "Protel" (the name "Altium" used until 2001).

Now that we've gotten that out of the way, let's get back to the beginning.

Thanks for doing your own thing, TI

One of the great things about Texas Instruments is that they provide STEP 3D models, libraries with the symbols and mechanical footprints, and similar resources for many of their parts. Even better, they also provide many "reference designs" showing how to use the part in a canonically correct way. As both an amateur AND a wing-nut with regards to Free Software/Open Source this is fantastic. I can directly see how to use a part rather than starting from the beginning.

Today, I was looking at "TI PMP5863". This is a reference design for a power supply which provides the following:

  • Ultra low noise (meaning the voltage itself has very little "ripple"/deviation from the intended value)
  • Bi-polar / dual-rail ±15v output (meaning it is outputting not only a specific voltage, but also the negative compliment)

After looking at the schematics4 for the board and datasheets5 for the relevant parts, I decided to take a look at the layers on the boards themselves.

That's when I encountered this list:

$ unzip
  inflating: PMP5863_REVC_PCB.L1     
  inflating: PMP5863_REVC_PCB.L2     
  inflating: PMP5863_REVC_PCB.M1     
  inflating: PMP5863_REVC_PCB.M2     
  inflating: PMP5863_REVC_PCB.S1     
  inflating: PMP5863_REVC_PCB.S2     
  inflating: PMP5863_REVC_PCB.FB     
  inflating: PMP5863_REVC_PCB.NCD    
  inflating: PMP5863_REVC_PCB.IPC    
  inflating: IMP NOTICE FOR REF DESIGNS.pdf  

This is the first time I've looked at Gerbers supplied by TI. From a basic level, I'd guess that L is referring to signal layers, M is solder mask, and S is silk screen. That's the trouble with Gerber files though. Unless one is using the newer "Gerber X2"6 format (newsflash: budget manufacturers in China operating on razor thin margins haven't undergone a re-tooling exercise), there is nothing in the files to denote what layer the file is for.

In a separate document published by TI I found the following:

File name Purpose
XXXXXXX-L1 Layer 1
XXXXXXX-L2 Layer 2
XXXXXXX-L3 Layer 3
XXXXXXX-L4 Layer 4
XXXXXXX-SMT SolderMask Top
XXXXXXX-SMB SolderMask Bottom
XXXXXXX-SPT SolderPaste Top
XXXXXXX-SPB SolderPaste Bottom
XXXXXXX-SST Silkscreen Top
XXXXXXX-SSB Silkscreen Bottom
XXXXXXX-FAB Fabrication Drawing
XXXXXXX-ASSY1 Assembly Top Drawing
XXXXXXX-ASSY2 Assembly Bottom Drawing

Meanwhile, in a forum post on the Chinese Support forum for TI, I find a different set of names used in a product called "controlsuite":

Filename Description Format
L1.PHO Primary Side Cu Gerber 8.5
L2.PHO NEG PLANE Gerber 8.5
L3.PHO PWR PLANE Gerber 8.5
L4.PHO Secondary Side Cu Gerber 8.5
PSS.PHO Primary Silkscreen A/W Gerber 8.5
SSS.PHO Secondary Silkscreen A/W Gerber 8.5
PSM.PHO Primary Soldermask A/W Gerber 8.5
SSM.PHO Secondary Soldermask A/W Gerber 8.5
PST.PHO Primary Solder Stencil A/W Gerber 8.5
SST.PHO Secondary Solder Stencil A/W Gerber 8.5
DD.PHO Drill Drawing Gerber 8.5
NC_DRILL.REP Drill Tool Listing ASCII
IPCD356.NET IPC-D -356 Netlist IPC-D -356 ASCII

I found this list interesting because it illustrates that even TI isn't consistent.

In the end, after even more research, I finally found a good "Rosetta Stone" produced by the folks at "PCB Prime" (PDF chart). Thanks to them for making my life easy.

As it was search engines that made it even possible to find this, I'm reproducing some fot he data hear in the hopes that it simplifies the lives of others too:

Common PCB Layout Software Gerber File Extension Comparison

  Altium / Protel Eagle KiCad Orcad PADS
Native Project Save File .PCBPRJ .BRD -- -- .PCB
Top Copper .GTL .CMP / .TOP F.CU .TOP L1.PHO
Inner Signal .G1, .G2, etc .LY2, .LY3, etc -- .IN1, .IN2, etc L2.PHO, L3.PHO, etc
Inner Plane .GP1, .GP2, etc -- -- -- --
Bottom Copper .GBL .SOL / .BOT B.CU .BOT L4.PHO (L2 if only 2 layers)
Drill Drawing .GD1 .DIM / .MIL / .GML -- -- D1.DWG
Drill Guide .GG1 .DIM / .MIL / .GML -- -- --
Keep Out .GKO -- -- -- --
Board Outline .GM1 / .GM3 .DIM / .MIL / .GML EDGE.CUTS .FAB --
Excellon Tool List -- -- -- -- --
Excellon Drill Description -- .DRD -- -- --
Notes GKO layer is sometimes used incorrectly as a board outline. Extensions will change depending on software version These are internal file names to KiCad. Protel naming can be selected when exporting Gerber.    

Blanks indicate there isn't a specific file for this layer or none was found at the time the chart was compiled. If you have additions or corrections, please contact

It was after reviewing this that things clicked together slightly more. Apparently TI is using the PCB capture software "PADS". Looking at we see that they used the first part of the file name as the extension, while in the Chinese forum post a hybrid of the Orcad and PADS naming was used.

If this provides some new insight, or you found it useful hit me up on Twitter ( brianredbeard) and let me know. DMs are open.

  1. Ok, to be fair it's mostly RS-274-X, though some machines still use the earlier "RS-274-D" (the most common and most primative G-code derivative in wide use). ↩︎

  2. Not to be confused with the Risco "Frontal Linker System", model RS-274 used in sausage-manufacturing. ↩︎

  3. While most everyone refers to "Excellon", this is a different variant of G-code known as "IPC-NC-349". This becomes a whole different rabbit hole. ↩︎

  4. If you're unfamiliar with schematics, SparkFun has a great write up: How to read a schematic. ↩︎

  5. Similarly, SparkFun also has a great write on datasheets: How to read a datasheet. ↩︎

  6. Gerber X2 was introduced in 2013... Turns out there's already an "X3" released this year. I wonder how long until that sees adoption. ↩︎