Table of Contents
Introduction
I wanted to make a custom printed circuit board (PCB) using the RP2040 microcontroller. In Part 1, I covered how I copied the minimal design files from the Raspberry Pi website, made my schematic changes, and then dragged the main bits of the minimal PCB layout onto my desired PCB outline. I now had a PCB containing the minimal design file features (i.e. RP2040, voltage regulator, USB connection and so on) plus my custom add-ons (primarily RS-485 circuitry, but that's unimportant to this blog post).
This blog post covers how I made the project more production-ready. The information here is quite generic, it will apply to non-RP2040 projects too.

USB Connector Trace Routing
One minor issue was that the USB connections were in the wrong order for the USB-C connector which I wished to use. I could have mounted the connector on the underside, but that likely would make production more complicated or more expensive. To keep the USB connector on the top side, I had to swap the order by passing one trace through the center of a resistor footprint. It’s not nice, but it shouldn’t matter too much at the 12 MHz rate those traces carry.

Note that for board assembly reasons discussed later, you may wish to stick with surface-mount connectors and not through-hole.
Copper Balancing with Fill Zones
In KiCad, copper can be added to a design by drawing shapes called filled zones. This is important because otherwise PCBs can warp due to unbalanced copper. As copper is added, it is inevitable that eventually a few issues may occur. One is that filled zones may overlap, and you’ll want to control which ones will take priority. KiCad has an excellent Zone Manager tool where you can see a list of all the zones in the design, plus a rendering of what they look like. It’s possible to adjust the zone priorities by moving items up and down the list.

Another problem can be that the board layout can be so compact, or component footprint pads so close to one another, that the fill zone might make only minimal contact with the pads that it ought to make contact with, and a design rule check warning will be raised. KiCad design rules by default expect there to be at least two connections between pads and the fill zone, but the RP2040 is very fine pitched (0.4 mm) and two connections are not possible for a few power pins (specifically pins 10, 33, and 49 on the QFN56 package). There are a few ways to get rid of the warning, I decided to edit the footprint in the library, and set those specific pins to ‘None’ for the zone connection strategy, so that I could draw a trace myself in the schematic, to connect those pins to the fill zone. The screenshot below shows those connections.

0402 Part Considerations
0402-sized parts are so small, that it’s very likely that the components will slide around or rotate, or even lift off a pad (known as tombstoning) when the solder paste melts during the solder reflow phase of production.
I had to modify the original minimal design, to get traces to attach to pads in a more centered and end-on fashion, and avoid traces coming off at angles. See the before and after screenshots.

Another thing worth checking, is that are 0402 parts actually necessary? Such tiny parts make production reliability unnecessarily poorer. If you don’t care about the size of a circuit board, and if there’s no electrical reason to have the part so small, then 0603 is a lot more attactive. Personally I would prefer 0603, but for now I kept the components at 0402 size.
Yet another problem can be that CAD packages might have oversized pads for capacitors and resistors. EAGLE CAD software was famous for having huge footprints, KiCad is better, but nevertheless it is worth comparing with actual 0402 component dimensions from datasheets, since the pads ought to be a size very close to the part size, there’s little room for error with such small components.
Gerber Time!
With the PCB layout complete, and the PCB Design Rules Check (DRC) executed, it was time to plot (i.e. generate) the Gerber and drill files, and then inspect the output using the KiCad Gerber Viewer tool.
I found it quite important to ensure Use drill/place file origin was checked, otherwise it created an offset that affected the placement of components in the Preparing for PCB Assembly section further below.

Here’s a closeup of the top layer of the final PCB (blue is solder paste, since this board will be reflowed).
I made the silkscreen text a bit larger, because there was space for it. I also added a pinout diagram for the connector I was using for my project, using the Image Converter application supplied with KiCad.


This is the bottom copper; there are a couple of traces in the center that carry the 1.1V core power for the RP2040.
Here’s the final render:

Speeding Up Creating Your Own Board
If anyone is interested in trying this themselves using KiCad, I placed my modification of the original minimal design in a custom RP2040 minimal design repository on GitHub.
It will save quite a bit of time use these files, compared to working with the original minimal design files. However, please note the board is untested currently, since I still need to get it produced.
This is the circuit diagram of the design I placed on GitHub:

PCB render:

Hopefully that's a good start to adding your custom circuitry.
Preparing for PCB Assembly
Now that the PCB layout is complete, I will need to supply some files (CSV format) that explain to the manufacturer what components need to be populated and where. I installed a KiCad plugin called Fabrication Toolkit to help create those files.

I also need to decide, do I purchase the components and send them to the board manufacturer/assembly firm, or do I request them to provide the parts?
With KiCad schematics, it is possible to use Tools->Bulk Edit Symbol Fields to add distributor part codes fields, that the fabrication toolkit can read to generate the required output.

With the PCB manufacturer that I’m planning to use, adding the PCB assembly service is quite easy; I uploaded the Gerber files as usual for a PCB-only order, then scrolled down and clicked on PCB Assembly which was listed at the bottom. Then, I clicked Next and the website requested me to upload a couple of the files (BOM and Position CSV files) that were generated by the Fabrication Toolkit. The website then listed all the parts for review, then I clicked Next to see a PCB assembly render:

The purple dots indicates what the manufacturer thinks is pin 1. You’ll notice U4 is wrongly oriented, and R3 and R4 were unknown to the manufacturer. The simplest fix for R3 and R4 will be to choose different resistors (I just got unlucky selecting the ones that I did), and click on U4 and click on an icon just above the board rendering, to rotate. Personally I will try to fix in KiCad, and then re-upload, rather than make changes on the PCB assembly website.
I clicked Next again, and the cost was listed. This is for a quantity of 10, not including shipping and tax. You can see that I would have saved about $7 if I’d used a surface-mount USB-C connector instead of the one I did.

Summary
There are quite a few details to consider when trying to produce complete PCB assemblies, and it is easy to miss things. I am not a PCB assembly manufacturing expert (and don’t wish to be, to be honest!), and have no doubt missed a load of things.
I have only touched on a few topics; in reality, one would create a checklist and run through it all, to ensure that the board is ready for production, whereas I skipped all that, considered a few basics (copper fill to avoid board warping and I tried to make the layout less likely to cause 0402 assembly issues), and I only briefly visually inspected the PCB Gerber files. In reality, to reduce self-stress and improve board production success chances, it is worthwhile finding a friend/colleague and sharing out the tasks, using each other to review the design and everything on your checklist.
It’s important to review the schematic, component selection, footprints, and PCB layout. Furthermore, it would be good to just get a few boards assembled, and test them, before committing to larger quantities.
Click here for the concluding Part 3 blog.
Thanks for reading!
Top Comments