Pcbnew external plugin?


Footprint, It means I need to check my netlist, doesn’t it?
I post it later on, thx

Kind regards,


Footprint is in the layout, symbol is in the schematic. I would expect your schematic “Reference” is the same as your Footprint “Reference”. It starts out that way but I think you can modify it in the layout after import from schematic.


Is that what you mean ?

Footprint = BGA-144_12x12_13.0x13.0mm_Pitch1.0mm



from :

mod = my_board.FindModuleByReference(“U1”)

I got this :

bianchi@bianchi-HP-Pavilion-dv6-Notebook-PC:~/kicad-bga-tools$ python2
Traceback (most recent call last):
File “bga_dogbone.py”, line 83, in
data = make_dogbones(my_board, mod, 0, 6)
File “bga_dogbone.py”, line 73, in make_dogbones
return [info.spacing, make_dogbone(board, mod, info, skip_outer,
File “bga_dogbone.py”, line 9, in make_dogbone
net = get_first_pad(mod).GetNet()
File “/home/bianchi/kicad-bga-tools/bga_utils.py”, line 24, in
for pad in filter(lambda p: p.GetNet().GetNodesCount() > 1,
File “/home/bianchi/kicad-bga-tools/bga_utils.py”, line 24, in
for pad in filter(lambda p: p.GetNet().GetNodesCount() > 1,
File “/usr/lib/python2.7/dist-packages/pcbnew.py”, line 15050, in

getattr = lambda self, name: _swig_getattr(self, NETINFO_ITEM,
File “/usr/lib/python2.7/dist-packages/pcbnew.py”, line 74, in
return _swig_getattr_nondynamic(self, class_type, name, 0)
File “/usr/lib/python2.7/dist-packages/pcbnew.py”, line 69, in
return object.getattr(self, name)
AttributeError: type object ‘object’ has no attribute ‘getattr

Any ideas why ?


Here’s the net

(export (version D)
(source noname.sch)
(date “Thu 24 Aug 2017 13:43:37 AWST”)
(tool “Eeschema 4.0.2+dfsg1-stable”)
(sheet (number 1) (name /) (tstamps /)
(source noname.sch)
(comment (number 1) (value “”))
(comment (number 2) (value “”))
(comment (number 3) (value “”))
(comment (number 4) (value “”)))))
(comp (ref IC1)
(value ATMEGA128-A)
(footprint TQFP-64_14x14mm_Pitch0.8mm)
(libsource (lib atmel) (part ATMEGA128-A))
(sheetpath (names /) (tstamps /))
(tstamp 599E62E0))
(comp (ref U1)
(value Allwinner_H3)
(footprint BGA-144_12x12_13.0x13.0mm_Pitch1.0mm)
(libsource (lib OzPi) (part Allwinner_H3))
(sheetpath (names /) (tstamps /))
(tstamp 599E6860)))
(libpart (lib atmel) (part ATMEGA128-A)
(description “TQFP64, 128k Flash, 4k SRAM, 4k EEPROM, JTAG”)
(docs http://www.atmel.com/Images/doc2467.pdf)
(field (name Reference) IC)
(field (name Value) ATMEGA128-A)
(field (name Footprint) TQFP64))
(pin (num 1) (name ~PEN) (type input))
(pin (num 2) (name “PE0(RXD0/PDI)”) (type BiDi))
(pin (num 3) (name “PE1(TXD0/PDO)”) (type BiDi))
(pin (num 4) (name “PE2(XCK0/AIN0)”) (type BiDi))
(pin (num 5) (name “PE3(OC3A/AIN1)”) (type BiDi))
(pin (num 6) (name “PE4(OC3B/INT4)”) (type BiDi))
(pin (num 7) (name “PE5(OC3C/INT5)”) (type BiDi))
(pin (num 8) (name “PE6(T3/INT6)”) (type BiDi))
(pin (num 9) (name “PE7(IC3/INT7)”) (type BiDi))
(pin (num 10) (name “(~SS~)PB0”) (type BiDi))
(pin (num 11) (name “(SCK)PB1”) (type BiDi))
(pin (num 12) (name “(MOSI)PB2”) (type BiDi))
(pin (num 13) (name “(MISO)PB3”) (type BiDi))
(pin (num 14) (name “(OC0)PB4”) (type BiDi))
(pin (num 15) (name “(OC1A)PB5”) (type BiDi))
(pin (num 16) (name “(OC1B)PB6”) (type BiDi))
(pin (num 17) (name “(OC2/OC1C)PB7”) (type BiDi))
(pin (num 18) (name “PG3(TOSC2)”) (type BiDi))
(pin (num 19) (name “PG4(TOSC1)”) (type BiDi))
(pin (num 20) (name ~RESET) (type input))
(pin (num 21) (name VCC) (type power_in))
(pin (num 22) (name GND) (type power_in))
(pin (num 23) (name XTAL2) (type BiDi))
(pin (num 24) (name XTAL1) (type BiDi))
(pin (num 25) (name “(SCL/INT0)PD0”) (type BiDi))
(pin (num 26) (name “(SDA/INT1)PD1”) (type BiDi))
(pin (num 27) (name “(RXD1/INT2)PD2”) (type BiDi))
(pin (num 28) (name “(TXD1/INT3)PD3”) (type BiDi))
(pin (num 29) (name “(ICP1)PD4”) (type BiDi))
(pin (num 30) (name “(XCK1)PD5”) (type BiDi))
(pin (num 31) (name “(T1)PD6”) (type BiDi))
(pin (num 32) (name “(T2)PD7”) (type BiDi))
(pin (num 33) (name “PG0(~WR~)”) (type BiDi))
(pin (num 34) (name “PG1(~RD~)”) (type BiDi))
(pin (num 35) (name “(A8)PC0”) (type output))
(pin (num 36) (name “(A9)PC1”) (type output))
(pin (num 37) (name “(A10)PC2”) (type output))
(pin (num 38) (name “(A11)PC3”) (type output))
(pin (num 39) (name “(A12)PC4”) (type output))
(pin (num 40) (name “(A13)PC5”) (type output))
(pin (num 41) (name “(A14)PC6”) (type output))
(pin (num 42) (name “(A15)PC7”) (type output))
(pin (num 43) (name “PG2(ALE)”) (type BiDi))
(pin (num 44) (name “(AD7)PA7”) (type BiDi))
(pin (num 45) (name “(AD6)PA6”) (type BiDi))
(pin (num 46) (name “(AD5)PA5”) (type BiDi))
(pin (num 47) (name “(AD4)PA4”) (type BiDi))
(pin (num 48) (name “(AD3)PA3”) (type BiDi))
(pin (num 49) (name “(AD2)PA2”) (type BiDi))
(pin (num 50) (name “(AD1)PA1”) (type BiDi))
(pin (num 51) (name “(AD0)PA0”) (type BiDi))
(pin (num 52) (name VCC) (type power_in))
(pin (num 53) (name GND) (type power_in))
(pin (num 54) (name “PF7(ADC7/TDI)”) (type input))
(pin (num 55) (name “PF6(ADC6/TDO)”) (type input))
(pin (num 56) (name “PF5(ADC5/TMS)”) (type input))
(pin (num 57) (name “PF4(ADC4/TCK)”) (type input))
(pin (num 58) (name “PF3(ADC3)”) (type input))
(pin (num 59) (name “PF2(ADC2)”) (type input))
(pin (num 60) (name “PF1(ADC1)”) (type input))
(pin (num 61) (name “PF0(ADC0)”) (type input))
(pin (num 62) (name AREF) (type BiDi))
(pin (num 63) (name AGND) (type power_in))
(pin (num 64) (name AVCC) (type power_in))))
(libpart (lib OzPi) (part Allwinner_H3)
(fp BGA-144_12x12_13.0x13.0mm_Pitch1.0mm))
(field (name Reference) U)
(field (name Value) Allwinner_H3))
(pin (num A1) (name JTAG-SE_L0) (type input))
(pin (num A2) (name EPHY_LI_NK_LED) (type input))
(pin (num A3) (name EPHY_T_XN) (type input))
(pin (num A4) (name EPHY_R_XN) (type input))
(pin (num E2) (name HTXCN) (type input))
(pin (num E3) (name PG9) (type input))
(pin (num F10) (name PA8) (type input))
(pin (num F11) (name PA11) (type input)))))
(library (logical atmel)
(uri /usr/share/kicad/library/atmel.lib))
(library (logical OzPi)
(uri “/home/bianchi/Documents/ORANGE PI/OrangePiLiteSch/OzPi.lib”)))
(net (code 1) (name “Net-(IC1-Pad49)”)
(node (ref IC1) (pin 49))
(node (ref U1) (pin A3)))
(net (code 2) (name “Net-(IC1-Pad50)”)
(node (ref IC1) (pin 50))
(node (ref U1) (pin A2)))
(net (code 3) (name “Net-(IC1-Pad51)”)
(node (ref IC1) (pin 51))
(node (ref U1) (pin A1)))
(net (code 4) (name “Net-(IC1-Pad59)”)
(node (ref IC1) (pin 59)))
(net (code 5) (name “Net-(IC1-Pad39)”)
(node (ref IC1) (pin 39)))
(net (code 6) (name “Net-(IC1-Pad29)”)
(node (ref IC1) (pin 29))
(node (ref U1) (pin F10)))
(net (code 7) (name “Net-(IC1-Pad19)”)
(node (ref IC1) (pin 19)))
(net (code 8) (name “Net-(IC1-Pad58)”)
(node (ref IC1) (pin 58)))
(net (code 9) (name “Net-(IC1-Pad38)”)
(node (ref IC1) (pin 38)))
(net (code 10) (name “Net-(IC1-Pad28)”)
(node (ref IC1) (pin 28)))
(net (code 11) (name “Net-(IC1-Pad18)”)
(node (ref IC1) (pin 18)))
(net (code 12) (name “Net-(IC1-Pad57)”)
(node (ref IC1) (pin 57)))
(net (code 13) (name “Net-(IC1-Pad47)”)
(node (ref IC1) (pin 47)))
(net (code 14) (name “Net-(IC1-Pad37)”)
(node (ref IC1) (pin 37)))
(net (code 15) (name “Net-(IC1-Pad30)”)
(node (ref IC1) (pin 30))
(node (ref U1) (pin F11)))
(net (code 16) (name “Net-(IC1-Pad48)”)
(node (ref IC1) (pin 48))
(node (ref U1) (pin A4)))
(net (code 17) (name “Net-(IC1-Pad27)”)
(node (ref IC1) (pin 27)))
(net (code 18) (name “Net-(IC1-Pad31)”)
(node (ref IC1) (pin 31))
(node (ref U1) (pin E3)))
(net (code 19) (name “Net-(IC1-Pad32)”)
(node (ref IC1) (pin 32))
(node (ref U1) (pin E2)))
(net (code 20) (name “Net-(IC1-Pad40)”)
(node (ref IC1) (pin 40)))
(net (code 21) (name “Net-(IC1-Pad42)”)
(node (ref IC1) (pin 42)))
(net (code 22) (name “Net-(IC1-Pad22)”)
(node (ref IC1) (pin 22)))
(net (code 23) (name “Net-(IC1-Pad12)”)
(node (ref IC1) (pin 12)))
(net (code 24) (name “Net-(IC1-Pad61)”)
(node (ref IC1) (pin 61)))
(net (code 25) (name “Net-(IC1-Pad41)”)
(node (ref IC1) (pin 41)))
(net (code 26) (name “Net-(IC1-Pad21)”)
(node (ref IC1) (pin 21)))
(net (code 27) (name “Net-(IC1-Pad11)”)
(node (ref IC1) (pin 11)))
(net (code 28) (name “Net-(IC1-Pad60)”)
(node (ref IC1) (pin 60)))
(net (code 29) (name “Net-(IC1-Pad52)”)
(node (ref IC1) (pin 52)))
(net (code 30) (name “Net-(IC1-Pad20)”)
(node (ref IC1) (pin 20)))
(net (code 31) (name “Net-(IC1-Pad10)”)
(node (ref IC1) (pin 10)))
(net (code 32) (name “Net-(IC1-Pad9)”)
(node (ref IC1) (pin 9)))
(net (code 33) (name “Net-(IC1-Pad8)”)
(node (ref IC1) (pin 8)))
(net (code 34) (name “Net-(IC1-Pad7)”)
(node (ref IC1) (pin 7)))
(net (code 35) (name “Net-(IC1-Pad6)”)
(node (ref IC1) (pin 6)))
(net (code 36) (name “Net-(IC1-Pad5)”)
(node (ref IC1) (pin 5)))
(net (code 37) (name “Net-(IC1-Pad4)”)
(node (ref IC1) (pin 4)))
(net (code 38) (name “Net-(IC1-Pad3)”)
(node (ref IC1) (pin 3)))
(net (code 39) (name “Net-(IC1-Pad2)”)
(node (ref IC1) (pin 2)))
(net (code 40) (name “Net-(IC1-Pad54)”)
(node (ref IC1) (pin 54)))
(net (code 41) (name “Net-(IC1-Pad17)”)
(node (ref IC1) (pin 17)))
(net (code 42) (name “Net-(IC1-Pad56)”)
(node (ref IC1) (pin 56)))
(net (code 43) (name “Net-(IC1-Pad46)”)
(node (ref IC1) (pin 46)))
(net (code 44) (name “Net-(IC1-Pad36)”)
(node (ref IC1) (pin 36)))
(net (code 45) (name “Net-(IC1-Pad26)”)
(node (ref IC1) (pin 26)))
(net (code 46) (name “Net-(IC1-Pad16)”)
(node (ref IC1) (pin 16)))
(net (code 47) (name “Net-(IC1-Pad55)”)
(node (ref IC1) (pin 55)))
(net (code 48) (name “Net-(IC1-Pad45)”)
(node (ref IC1) (pin 45)))
(net (code 49) (name “Net-(IC1-Pad35)”)
(node (ref IC1) (pin 35)))
(net (code 50) (name “Net-(IC1-Pad25)”)
(node (ref IC1) (pin 25)))
(net (code 51) (name “Net-(IC1-Pad15)”)
(node (ref IC1) (pin 15)))
(net (code 52) (name “Net-(IC1-Pad64)”)
(node (ref IC1) (pin 64)))
(net (code 53) (name “Net-(IC1-Pad1)”)
(node (ref IC1) (pin 1)))
(net (code 54) (name “Net-(IC1-Pad44)”)
(node (ref IC1) (pin 44)))
(net (code 55) (name “Net-(IC1-Pad34)”)
(node (ref IC1) (pin 34)))
(net (code 56) (name “Net-(IC1-Pad24)”)
(node (ref IC1) (pin 24)))
(net (code 57) (name “Net-(IC1-Pad14)”)
(node (ref IC1) (pin 14)))
(net (code 58) (name “Net-(IC1-Pad63)”)
(node (ref IC1) (pin 63)))
(net (code 59) (name “Net-(IC1-Pad53)”)
(node (ref IC1) (pin 53)))
(net (code 60) (name “Net-(IC1-Pad43)”)
(node (ref IC1) (pin 43)))
(net (code 61) (name “Net-(IC1-Pad33)”)
(node (ref IC1) (pin 33)))
(net (code 62) (name “Net-(IC1-Pad23)”)
(node (ref IC1) (pin 23)))
(net (code 63) (name “Net-(IC1-Pad13)”)
(node (ref IC1) (pin 13)))
(net (code 64) (name “Net-(IC1-Pad62)”)
(node (ref IC1) (pin 62)))))


Is it right, mod = my_board.FindModuleByReference(“U1”) ?


Looking at the python documentation, I can’t find “GetNodesCount()” on a net (technically a NET_INFO) object. That would cause an error, but I’m not sure the error message you’re getting is indicative of that error. I’d have to check in the Scripting Console to be sure.

It is probably best to contact the author or submit an issue in github for updating the script to the current version (or nightly version) of KiCad.


Replace that line with the following, all at the same indention as the current ‘for’ statement:

# pbyn is a dictionary of padlist by netcode
# this code replaces the use of "p.GetNet().GetNodesCount()"
k=[pbyn.setdefault(p.GetNetCode(),[]).append(p) for p in pcbnew.GetBoard().GetPads()]
for pad in filter(lambda p:len(pbyn[p.GetNetCode()])>1,mod.Pads()):

PcbNew scripts no longer work in V5?

I updated the bga tool to work with the nightly release of KiCad, and support ActionPlugin.

Place the two *.py files in the KiCad plugins directory,

Go into pcbnew, load your board and select the bga module you want to operate on.

If you KiCad has ActionPlugin support, go to the Tools > External Plugins menu and select BGA Dogbone (try Refresh Plugins if the menu item doesn’t appear).

If your KiCad does not have ActionPlugin support, then you can open the Scripting Console and type:

import  bga_dogbone

If that doesn’t work, let me know and I can help.


Any feedback on whether the update to the bga tool works for you?


I will give a try soon, thanks


I got message :

“This python script runs on the currently loaded board and the selected

Please have a look on the capture,

What should I do ?



Select the module you want it to add dogbones to.


I have U1 as bga chip. Is U1 a module? Or which one?


Yes, U1 is a Module. You don’t have to modify the code, just select U1 in the tool.


The step is select U1 ==> click bga_tools and see what happens ?
Correct me ?

Kernel 3.08
Kind regards,
Riko Ho


Yup, that should be it!


How to select U1 ? then ?


Click somewhere between the BGA pads. Does it highlight U1 when you do that?
This seems like a really basic question to be asking. If this is just an English issue, then it’s understandable. However, if you understood the English and really didn’t know how to select an object, please read/watch some KiCad tutorials.


Left-click selection only works in OpenGL canvas (see View menu).