Close

Recap: early work #2

A project log for BradWii on the Hubsan Q4

In which the author runs open source firmware on a palm sized quadcopter

ajlittajlitt 03/15/2015 at 05:221 Comment

After a few iterations of the OpenSCAD model and a week of waiting for the pogo pins I ordered from Sparkfun to come in, I have a working jig. It turns out my photogrammetry was a little off, since it took a couple of iterations of the model to dial in the pin locations. This likely comes from parallax error since I didn't remove the motors when I scanned the board. I also had some problems getting the hole sizes right for the pins since the C and D pins are so close to each other that they wind up a little narrower than the other two.

Next up I soldered wires to the pogo pins and hooked them to the STLink/V2 debugger on a STMicro STM32F0 eval board I had on hand. I found this guide by TheLastMutt for flashing and erasing the contents to remove the flash read/write lock on the Mini54 under OpenOCD.

So what's with the flash lock? Like most micros the Mini54 has a similar feature, preventing most debug port operations including writing flash unless a bulk erase is performed first. Hubsan's firmware is written to the Q4 with this lock enabled.

The code in the guide didn't work without some changes, one being the transport settings needed changing for STLink/V2, and the OpenOCD patch didn't have the right mask for the part ID. My changes in gist form.

After I got OpenOCD and the part to talk, I erased the original firmware to get rid of the flash lock. Unfortunately the lock also prevents reading out the existing contents, so I was stuck with a dead toy until I could get some alternate firmware working. This is the part of the movie where the scientist infects themselves with the deadly mystery virus for motivation to find a cure. I knew that the BradWii firmware supported very similar quads but getting this to work would be a learning experience.

Discussions

zakqwy wrote 03/15/2015 at 06:47 point

"This is the part of the movie where the scientist infects themselves with the deadly mystery virus for motivation to find a cure."

Excited to here where this goes! I hadn't heard of BradWii prior to this post--thanks for pointing me in that direction, seems like an awesome system!

  Are you sure? yes | no