Cannot route in keepout area (but there is none) (solved)


I have encountered a peculiar problem where I am unable to join matching net to net. An error message shows up saying “Cannot start routing inside a keepout area or board outline.”, however there is no keepout to speak of and I’m not exactly sure what it means by ‘or board outline’ as by definition everything should be within the board outline. As it happens, the board outline encloses everything with no other extraneous artifacts to cause confusion as far as I can tell. Screenshot attached.

This is a new design in Kicad 5.1 stable release and I’ve not encountered the problem in previous releases and while I don’t consider myself an experienced user, I can navigate the basics…

Might be related to this thread??

Anyone know what might be going on?

Your whole design isn’t visible, I can’t even tell what layers are used in the visible area. If you have something in Edge.Cuts, those lines have a keepout area.

Usually the easiest way to find a solution is to give the whole project as a zip file. Screenshots or screencast are the second best option.

Sorry, thought the screenshot might have highlighted the crux of the issue. Reattached a couple of full screenshots showing edge cuts layer: a simple circle encompassing the whole design represented in default colours. Design rule checking on or off makes no difference.

I’ll work on a redacted version of the project and attach when available.

Maybe it because of this: If that’s so, draw the edge with two half circle arcs instead.

Interesting. Well, I’ve been able to route other nets perfectly fine and I’ve tried deleting the board edge and creating a non-circular one (and even leaving it out completely) but to no avail, so I don’t think it’s the same thing, but suspiciously coincidental nonetheless…

I’ve noticed two things:

  1. Without modifying anything from above, I could start a trace from the SMD capacitor highlighted, but not from the TH pad connected to the trace antenna (same net highlighted). This suggested a problem with the trace trace antenna library part, so…

  2. I tried to re-generate the TH pad in the lib. Same problem. I then redrew the part of the copper art from the antenna trace to the affected pad. This helped. It allowed me to join SMD capacitor pad to antenna TH pad in the PCB file, however now I have DRC errors “track too close to copper item”. The copper item in question is exactly the graphic line segment forming the spiral of the antenna joined to the TH pad of the antenna that I just redrew (both part of the lib part). It clearly isn’t a problem for the other antenna connection drawn the same way which is a bit odd… am I missing something? I could swear I’ve done something similar in the past and it has worked fine…

Again, can you give the project? If not, can you strip it down so that it still shows the problem but has your sensitive information removed?

I am not working with KiCad yet, but when doing such antennas in Protel (I have one old - from 1997) I had a problems like that when I tried to do an antenna as footprint. For Protel my connections to two antenna pads were separate nets (like you have) and Protel didn’t alloved me to short two nets (by tracks in antenna footprint)
I work-around that by makeing antennas the one net (at schematic I draw that net in antenna-like form). When I use the same antenna at another PCB I just copy the antenna tracks from old PCb to new one. Of course more elegant would be to have a footprint for it but I didn’t found how to do it with my Protel.
During my slow KiCad investigation I didn’t considered to check it yet as it seems for me not a big problem to work like in Protel (PCBs with antennas are about 50% of my PCBs but first in KiCad I plan others).

How did you make your spiral?
I assume you designed it in an external program, imported it in Pcbnew directly and put it on a copper layer.

If you import your custom graphics into the Footprint editor, and highlight (select) it, then you can press the right mouse button and select “Create pad from selected shapes”. This probably makes it easier for KiCad to manage your antenna.

I have not checked it, but I suppose if he do it he will end with antenna footprint haveing only one pad. I’m not sure if it is what he wonts.

I encountered the same problem with an old version of PADS. I think I was able to use ECO mode to get around the issue but then it would try to undo my changes when updating the netlist. This was my motivation with Kicad to make it a library part so that the copper traces become graphic lines and not tied to any net.

I made the spiral using the free TI Webench online tool. It has an export option to Eagle .brd format which I then imported into a Kicad PCB layout. I went through some trouble to get it into a Kicad library part which involved creating a blank library part and then using a text editor and spreadsheet to reformat and transfer to the library (change “segment” to “gr_line”, remove net reference etc.).

I have figured out the problem:

The TH pad of the antenna (defined in the library part) is not the issue. The issue is the graphic line forming the spiral (also defined in the library part) being on the same side that I am trying to attach the copper trace. Kicad is treating this as keepout / board edge according to the error message and will not allow netlisted copper trace to connect within design rule clearance limits. The other TH pad connects to netlisted copper trace because the graphic line is defined on the bottom layer and the trace is on top layer. Furthermore, Kicad is not complaining about the netlisted TH pads being too close to the graphic lines because they are part of the library part.

As suggested, creating “pads” out of a portion of the spiral line segments definitely makes life easier. In the screenshot below I’ve highlighted the segments I turned to pads which allow me to route without violating design rules. The no net graphic lines and pads are both in the library part so design rules don’t apply, and since the pads are long enough (>0.2mm in my case), I can connect to the tip furthest from the rest of the spiral or “keepout / board edge” as Kicad interprets it.

So in conclusion, Kicad seems to be behaving appropriately, but it’s error message in this case is not very helpful.

Thanks all for the help!

1 Like

PCB antennas, and other distributed-element RF structures, are situations where you spend time either fighting the tool, or finding some obscure workaround, when you try to do them in KiCAD. I know there are specialized layout programs specifically for RF designs, but there seem to be more and more cases where bits of RF circuitry find their way onto PCB’s that aren’t overtly RF in nature.

I hope there is some top-down development thought being directed toward this topic.


KiCad has a very nice way to make such things now. Make them into custom pads as already suggested above but keep a bit of space at the second end. You then place a normal pad for the second connection with a bit of clearance to the previosly generated pad and connect these to with a graphical line on the same copper layer. Graphical lines are ignored by DRC and therefor can be used to make net ties. (See the net tie footprints for detail how this is done.)

Without experimenting I have one question: Is there anything against using normal pads for both antenna ends?

You can use normal pads but the underlying graphic line that forms the antenna is treated as “keepout / board outline”, so you will not be able to join netted copper trace to the pad unless the pad is large enough that you can join to the edge of the pad without getting too close to the graphic line. Or you can join to an other layer if it is a TH pad like my original screenshot.

The advantage of the custom pad is you can make it longer (to keep away from “keepout / board outline”) and look like part of the antenna artwork. Hopefully you can see from this screenshot of my final design what I mean:

For the ends no. Using a custom pad for the middle will make DRC work with that part as well. The alternative is using a normal drawing on the copper layer which is ignored by DRC (which is how our hacky net ties work)

And if you already use such a pad for the middle part you might as well use it instead as the first one to save you making a third pad. (simply place the anchor pad of the complex one where you would have placed one of your end pads)

Thanks. Sometime in future I will look at it closer. I just supposed standard pad can also be long enough.

Yes, true. In the case of a coil antenna/inductor, a rounded rectangle could also mimic the track but a possible disadvantage is center snap. At least with custom pad, you can use an ‘anchor pad’ to define snap point at one end of the rectangle.

I newer tried custom pad but I tried to use few pads with the same number. I suppose you can put one just to have a center for snap and next to connect with the rest (not pad) of antenna.
I am using round ferrite at back of my RFID antennas. I like real round tracks I use for antenna in Protel. Because of this I will first move to KiCad PCBs without antenna, and then … may be.

Don’t forget about the offset property of the normal pads. This will offset the “center” of the pad (or drill hit for THT pads).