Assembly-izing Tassel

Tass­sel: the extra ‘s’ is for “scat­ter­ing”

Work con­tin­ues on Corn­troller, my vague­ly retard­ed ver­sion of Shane’s sweet brush­less motor con­troller.

I got my Digi-Key order last week and start­ed assem­bling the board at the Graphics/Visualization/Usability (GVU) Pro­to­typ­ing Lab, the sis­ter lab to the Geor­gia Tech Inven­tion Stu­dio1, and home to my favorite hot-air reflow sta­tion on cam­pus for pro­to­typ­ing.

Now the thing about reflow sol­der­ing is that it per­fect­ly cap­tures the sights, sounds, and smells of hell.

What else but hell would make you sit in place, hunched over for hours, as elec­tric fire brings tears to your eyes and sol­der paste brim­stone pierces your nos­trils? Bright incan­des­cent light­ing, smol­der­ing sol­der­ing irons, and in the case of the GVU reflow sta­tion, a 50-deci­bel elec­tric pump all mag­ni­fy the feel­ing of burn­ing alive in invid­i­ous flames of divine wrath.

But the GVU ver­sion of sur­face mount hell is actu­al­ly pret­ty legit. The afore­men­tioned elec­tric pump is hooked up to a pre­ci­sion sole­noid valve gas dis­penser (con­trolled by a foot ped­al), which in turn feeds pres­sur­ized air into a hand-held tube of lead­ed sol­der paste. Hit the foot ped­al, and a small and care­ful­ly con­trolled bit of gray goop flows out.

The setup basi­cal­ly lets you do man­u­al pick and place assem­bly. Less effi­cient for small and medi­um runs than sol­der paste sten­cil­ing, but way less setup time and a lot more fun2. It’s per­fect for pro­to­typ­ing a new board.

Now I end­ed up shoot­ing video instead of tak­ing too many pic­tures, so bear with my video screen­shots here.

To make life eas­ier, I assem­ble com­po­nents under a 10×/30× stereo micro­scope with tweez­ers in one hand, sol­der paste dis­penser in the oth­er, and foot on the foot ped­al.

At 10× you can see the par­ti­cles in the sol­der paste.

After assem­bly, I pre­heat the board over a Zephyrtron­ics… board pre­heater.

I’m not even mak­ing this up. This thing emu­lates the flat “warm-up” peri­od of the reflow tem­per­a­ture pro­file you’d use in a full reflow oven. In addi­tion, it has a genius “cool” mode dur­ing which it draws air down (instead of blow­ing hot air up), using ambi­ent air to cool the board (“ramp-down”). No more blow­ing on the board until your face is red and your tongue is cov­ered with flakes of sol­der.

It even comes with a sweet PCB jig to hold your board at just the right height above the pre-heater.

After that, you pret­ty much just apply heat like a nor­mal per­son.

You may notice that in addi­tion to unpop­u­lat­ed iner­tial sen­sors, there are also two fun­ny-look­ing sol­der bridges.

You have ze Ger­mans to blame for that. Had I the Euro­pean-styled schemat­ic sym­bols für a com­mon-mode choke ge-used, which had I the wrong ori­en­ta­tion for the part ge-using. I think.

In oth­er words, I man­aged to short my input pow­er leads across a pair of induc­tors.

Not that that sur­pris­es me in the least; I’ve man­aged to build almost every cir­cuit I’ve ever designed to have a short from pow­er to ground. Heck, this is the prob­a­bly the high­est imped­ance short I’ve got­ten on a first-try board in the past two years.

Actu­al­ly, may­be the foot­print I was using for my Würth-Elek­tron­ik com­mon-mode choke just had a mis­take in pin assign­ments. But I like to chalk it up to cul­tur­al dif­fer­ences, since it’s 34% more hilar­i­ous that way.

At any rate, I end­ed up skip­ping the choke com­plete­ly using sol­der bridges; I get less noise immu­ni­ty, but hey, nobody’s per­fect and I’m not sure if it would’ve even helped at all.

At this point, it was time to try out the log­ic pow­er sup­ply. With fin­gers crossed, I hook up the bench pow­er sup­ply to the V+ and V- pow­er pads and hit the switch.

Noth­ing.

Turns out when sol­der­ing leads to the V- pad while “e-test­ing” the board, I had bro­ken one of the traces from the pad.

Oops.

I haven’t made a sol­der­ing boo-boo this bad in years, but what­ev­er. I briefly con­sid­ered run­ning a lit­tle green wire over the trace3, but then real­ized that I tent­ed over all my vias with sol­der­mask4 and couldn’t air­wire even if I want­ed to.

Instead I just ripped up the sol­der­mask with an X-acto knife under 30× mag­ni­fi­ca­tion and then sol­der bridged the shorn cop­per. Like a boss.

Now I was get­ting a sweet 3.304V out of my LT3970 cir­cuit from an input of 4V all the way up to 31V, which was as high as the pow­er sup­ply could go. Not real­ly sure why this mat­tered, since I’ll always be putting 5V into the board, but what­ev­er.

But why the heck am I post­ing about such minor minu­ti­ae as fix­ing a bro­ken trace when I should be plop­ping down code like a pro? Well, because per­form­ing board bringup5 on an STM32-based board like this is an (nec­es­sary) act of dis­tilled masochism, and I avoid it like a plague even when I’m already work­ing on the board to begin with. I mean, hell, the soft­ware you use with the pop­u­lar GCC/GDB ARM tool­chain is called OpenOCD.

So I plug my board into my Olimex ARM-USB-TINY-H and then pray to Tony Stark to guide my board to a suc­cess­ful JTAG inter­ro­ga­tion.

C:\Users\Xo>"C:\Program Files (x86)\OpenOCD-0.4.0\bin\openocd.exe" -f interface\olimex-arm-usb-tiny-h.cfg -f target\stm32.cfg
Open On-Chip Debugger 0.5.0-dev-00753-g422e9f9-dirty (2011-02-14-13:06)
Licensed under GNU GPL v2
For bug reports, read
        http://openocd.berlios.de/doc/doxygen/bugs.html
Info : only one transport option; autoselect 'jtag'
1000 kHz
adapter_nsrst_delay: 100
jtag_ntrst_delay: 100
Info : device: 6 "2232H"
Info : deviceID: 364511274
Info : SerialNumber: OLTQ5QMÖA
Info : Description: Olimex OpenOCD JTAG ARM-USB-TINY-H A
Info : max TCK change to: 30000 kHz
Info : clock speed 1000 kHz
Info : JTAG tap: stm32.cpu tap/device found: 0x3ba00477 (mfg: 0x23b, part: 0xba00, ver: 0x3)
Info : JTAG tap: stm32.bs tap/device found: 0x06430041 (mfg: 0x020, part: 0x6430, ver: 0x0)
Warn : JTAG tap: stm32.bs       UNEXPECTED: 0x06430041 (mfg: 0x020, part: 0x6430, ver: 0x0)
Error: JTAG tap: stm32.bs  expected 1 of 5: 0x06412041 (mfg: 0x020, part: 0x6412, ver: 0x0)
Error: JTAG tap: stm32.bs  expected 2 of 5: 0x06410041 (mfg: 0x020, part: 0x6410, ver: 0x0)
Error: JTAG tap: stm32.bs  expected 3 of 5: 0x16410041 (mfg: 0x020, part: 0x6410, ver: 0x1)
Error: JTAG tap: stm32.bs  expected 4 of 5: 0x06414041 (mfg: 0x020, part: 0x6414, ver: 0x0)
Error: JTAG tap: stm32.bs  expected 5 of 5: 0x06418041 (mfg: 0x020, part: 0x6418, ver: 0x0)
Error: Trying to use configured scan chain anyway...
Warn : Bypassing JTAG setup events due to errors
Info : stm32.cpu: hardware has 6 breakpoints, 4 watchpoints

“hard­ware has 6 break­points, 4 watch­points” is actu­al­ly what I expect to see, mak­ing this by far my most suc­cess­ful board bringup to date. But wait, what are those errors? Why isn’t my device (0x06430041) being rec­og­nized? Let’s take a look at the stm32.cfg script:

    # See STM Document RM0008
    # Section 29.6.2
    # Low density devices, Rev A
    set _BSTAPID1 0x06412041
    # Medium density devices, Rev A
    set _BSTAPID2 0x06410041
    # Medium density devices, Rev B and Rev Z
    set _BSTAPID3 0x16410041
    # High density devices, Rev A
    set _BSTAPID4 0x06414041
    # Connectivity line devices, Rev A and Rev Z
    set _BSTAPID5 0x06418041

Oops, my STM32F103VG XL-den­si­ty micro­con­troller isn’t in there. The com­ments men­tion Sec­tion 29.6.2 of RM0008, the STM32F1x Fam­i­ly Ref­er­ence Man­u­al. In sec­tion 31.6.2 (dot­dot­dot) of the newest ver­sion of RM00086, we see that 0x06430041 is Revi­sion A of XL-den­si­ty devices.

So I need a more recent ver­sion of OpenOCD that has the new­er STM32 devices. Crap.

See, I use the default vanil­la FTDI dri­vers for my Olimex, pre­sum­ably so I can use the Vir­tu­al COM Port dri­ver for the bro­ken-out UART the ARM-USB-TINY-H doesn’t have. Yeah, I’m dumb. But OpenOCD doesn’t sup­port those dri­vers out of the box; licens­ing issues pre­vent bina­ry dis­trib­u­tors like Fred­die Chopin from mak­ing avail­able bina­ries com­pat­i­ble with reg­u­lar FTDI dri­vers. Instead most peo­ple use libft­di and libusb-win32 for hard­ware inter­fac­ing on Win­dows.

So I got­ta build OpenOCD myself to make it work? God damn it; what is this, Lin­ux?

Let’s just say $ ./configure --prefix=/cygdrive/c/Users/Xo/Desktop/ocd-build/out --enable-maintainer-mode --disable-werror --disable-shared --enable-ft2232_ftd2xx --with-ftd2xx-win32-zipdir=/cygdrive/c/Users/Xo/Desktop/ocd-build/ftd2xx CC="gcc -mno-cygwin"7

With my new OpenOCD 0.6.0-dev build, I got a ful­ly suc­cess­ful JTAG scan, and the OpenOCD GDB server is now open for busi­ness:

C:\Users\Xo>openocd -c "gdb_port 2222" -c "telnet_port 4444" -f "C:/Progra~2/OpenOCD/interface/olimex-arm-usb-tiny-h.cfg" -f "C:/Progra~2/OpenOCD/target/stm32f1x.cfg"
Open On-Chip Debugger 0.6.0-dev (2011-10-19-22:04)
Licensed under GNU GPL v2
For bug reports, read
        http://openocd.sourceforge.net/doc/doxygen/bugs.html
Info : only one transport option; autoselect 'jtag'
1000 kHz
adapter_nsrst_delay: 100
jtag_ntrst_delay: 100
cortex_m3 reset_config sysresetreq
Info : device: 6 "2232H"
Info : deviceID: 364511274
Info : SerialNumber: OLTQ5QMÖA
Info : Description: Olimex OpenOCD JTAG ARM-USB-TINY-H A
Info : max TCK change to: 30000 kHz
Info : clock speed 1000 kHz
Info : JTAG tap: stm32.cpu tap/device found: 0x3ba00477 (mfg: 0x23b, part: 0xba00, ver: 0x3)
Info : JTAG tap: stm32.bs tap/device found: 0x06430041 (mfg: 0x020, part: 0x6430, ver: 0x0)
Info : stm32.cpu: hardware has 6 breakpoints, 4 watchpoints

lol @ C:/Progra~2. Because this thing f—ing breaks if I don’t.

  1. At least in sweet, sweet fund­ing []
  2. No, not real­ly []
  3. I hear in some Asian elec­tri­cal engi­neer­ing tria- cir­cles, using more than 三 (3) lit­tle green wires is a shame to the engineer’s fam­i­ly and results in decap­i­ta- rit­u­al de-accred­i­ta­tion []
  4. Yeah. On a first-ver­sion pro­to­type. Balls, suck­as. []
  5. “Per­form­ing board bringup” sounds way cool­er than “bring­ing up” []
  6. As of 2011/10/19 []
  7. Yeah, that real­ly is for my ben­e­fit only. How did you guess? []