In my journey to ARM mastery, I’ve been interested in SWD as a way to program, control and debug an embedded ARM core. Due to my obsession with cheap boards and open source, finding a satisfying solution to my SWD connectivity needs has been a journey in itself.

There are commercial SWD interfaces available, like ST-LINK and JLink. But those aren’t open source. You can get cheap JLink clones from China, but those appear to just use stolen firmware images from the JLink products. This interface, with open source firmware, seemed promising, especially since I could get a firmware binary running on a cheap VCC-GND STM32 board I had around. But since I couldn’t build the source without the Keil tools, and the free version of the Keil tools didn’t seem to work, and the free version of the Keil tools is not open source, my hunt continued.

Whereupon I landed at IBDAP. Someone had taken the same journey and decided to market a board and GCC/makefile-compatible open source firmware, using the CMSIS-DAP standard that is itself an open product of ARM. Very cool. The only downside being that Armstart is sorta out of business. I ordered what may be the last IBDAP board they sell, because after I bought it, everything on their site was marked as sold out. It took a bit of (email) arm-twisting to get them to ship me the board. But, it arrived, I was able to build the firmware (flashing it using another SWD interface), and I’ve connected to a couple boards through it with apparent ease. I may have finally now reached a point in my journey where I can release my obsession with open SWD.

The board may be found at other places, like Adafruit.

In case the Github link disappears, here’s an IBDAP fork. Here’s the firmware I built most recently, as a check for your build/board. Below are some documentation resources.

user manual, schematic.


Raspberry Pi 3 WiFi power management

Got my Raspberry Pi 3 today (on Pi day, no less).

Playing with WiFi, I was getting a lot of stuttering, pauses, slow-downs, whatever you might want to call it. Pings bounced around in the range of 300ms and 2000ms, and interactive ssh was annoying. iperf, surprisingly, was showing me good-enough numbers.

Poking through the iwconfig man page, my best guess was that power management was possibly related to the problem. Doing a
sudo iwconfig wlan0 power off
turned off the power management stuff, and not too surprisingly, the WiFi stopped misbehaving. There are surely more refined adjustments that could be made, but I’m not worried about power management at the moment, so it’s a solution for me for now.


Never delegate passion

In a great documentary about Charles and Ray Eames (people I had never thought to be interested in before I watched it), it was said that Charles said, “Never delegate understanding”. Great motto; one that, after I heard it, I realized is a big part of my approach to life. I’m happy to do extra work if it leads to extra understanding. I’m happier learning how to derive an equation from first principles than just memorizing it. I’m happier to chase a little detail through the eye of a needle than just assume that someone will take care of it.

But enough about my approach to understanding, let’s talk about something else about me. Because I also realized lately that, while I could blame my aversion to corporate cubicle life on the idea that I’d rather not work for someone else’s profit, it’s more accurate to say that I don’t want to delegate passion. That’s kinda what you’re doing, as an employee*. You go and work on someone’s thing, without any significant concern about whether you’re really passionate about it, assuming that someone else will supply the passion and you can just do the work. And, well, that’s fine, too, of course. It’s a totally workable system. Just not for some of us. I’d say, “never delegate passion”, where ‘never’ is defined as I always define it in my speech, as ‘never (unless you want to)’.

(Another, random, link about the Eameses: The Information Machine. Great if you love computers or 50’s modernist style cartoons, best if you love both.)

* Unless you happen to be an employee whose passions really do align well with the mission of the corporation, in which case, you may stop reading.



A brief guide to going to the library to revivify your mind

(This is a distillation of my long personal experience with the technique; take from it what makes sense to you.)

This is a way to till up your mind-soil and get little thoughts into solution to crystallize them into seeds of tranquility, or something. I mash my metaphors purposefully, because this technique works by mixing up your thought-patterns to get you out of those boring little loops.


Set aside a two to three hour span of uninterrupted time. It’s best that you be unhurried and unpressured, but this technique can also help you get to that state, so no worries if you’re worried.

Walk to the library. Or use some other human-powered locomotion. Getting your body energy into the act helps get things flowing. On your walk, let your mind drift. If you’re troubled by something, just go ahead and ponder that, but expose your worries to a layer of honest analysis, too. If you’re untroubled, just think about kitty-cats and flowers and such. This is the tilling part. You’re preparing your mind by loosening it up.

Upon passing through the threshold of the library, put aside any worry-type thoughts. In the library, you’re going to run a simple little exercise, two to four times. This is the solution/crystallization phase.

Identify a section of the stacks. If you have a tendency to visit one place in the library a lot, you can start heading there. Or if you have a topic that’s been on your mind a lot lately, type a few keywords into the catalog and choose a book at semi-random from the list and go toward it. Or if you just see a space that seems to be relatively free of other people, drift there. The idea is not to find a specific book or a specific topic, but just to get near things that you’ll probably like.

While moving casually toward your target area, keep your eyes open for any interesting oddities in the stacks. Books that attract you with their nice colors or hot keywords or cool titles or I’ve-always-been-curious topics or whatever. If anything looks good, you’ve found your place. Otherwise, keep going to your original target.

Grab a book. Don’t give any thought to whether you understand the topic well enough to read the book, or whether it’s something worthy of discussion at the watercooler, or whether you’d normally be seen reading such a thing. Just grab something good. Open it to a random page about a third of the way through. You could use the table of contents, or something, too, but probably just go with randomness. Start reading. Don’t stop because they’re referring to some term defined previously in the book, or there’s an equation that you don’t like. You’re not trying to win an award for Awesomeness In Reading Stuff You Already Understand, you’re just activating parts of your brain and getting excited about some ideas and how they connect.

Read for five to fifteen minutes. Maybe break that time up in between two or three books in the vicinity that grab your attention, or just stick with the first one. If you spend too little time, you won’t really get things activating. If you spend too much time, you won’t really get things stirred up.

Repeat the exercise a few more times. I know I already said, that, but it bears repeating. Two times (total) will at least start cross-pollination of ideas, four times is probably best if you have the inclination.

While you’re working on your second or third go-round, you’ll find that things are starting to connect. Ideas expressed in a book about machine learning algorithms will be echoed eerily in a book about sketches by famous designers. This is the crystallization, and it pretty much always happens if you’ve run the exercise according to the basic outline above. It’s pretty awesome.

After a sufficient period of crystallization, you’ll be all revivified and feel better. You can head home, and as you do, just keep going on the various connecting threads. Also, look at trees and sidewalks and telephone poles. Sit in a park for a few minutes. That kind of stuff.



Playing in communities of practice

I love playing in communities of practice. Not many things light up my brain more than the sort of flow I can achieve when I’m embedded deeply enough in a community of practice that I can smoothly follow a technical discussion, or better yet, anticipate some-but-not-all of the structure and details of a discussion, or better yet, enter into a creative dialog with another practitioner, or better yet, achieve actual artifacts of note within the field. A minute of that stuff is worth days of small talk and regurgitated opining, to me.

(By the way, the book Communities of Practice is pretty cool, from what I was able to read before someone else recalled it.)

At a recent Ames MakerSpace meeting, we were talking about the mission of the group. There already exists a mission statement, but if I were to state my personal mission as a member of the group, it would be something along the lines of: to facilitate growth within, and connections between, local communities of practice. I suppose that sounds pretty generic, but there’s a reason: any community of practice is fun to interact with if my interlocutors bring passion*.

It also might sound strange that I didn’t mention the tools and the space. That’s because the people and connections have a lot more value to me than those. But, I should add that tools and shared space are an important part of the process by which a community of practice forms and deepens its intimacy. These, and the artifacts and works-in-progress created by the community, embody a level of sharing/communication/expression that can’t be achieved by talk alone. It’s amazing what even just a sprinkling of that stuff adds to the interactions.

Seeing and helping others succeed is a great joy for me (I assume that’s true of most other people, too). Aligning myself with appropriate communities of practice helps to ensure a somewhat steady stream of such experience.


* In my time with the MakerSpace, I’ve heard people express their passion for, among other things: web development, sewing, miniature cattle, wire sculptures, storm doors, coffee brewing, rapid prototyping, bicycles, recycling electronics, gardens, metal fabrication, alternative currencies, fish, GIS, CNC, radio protocols, ecology, intranet collaboration, solar cells, robots, CAD, image analysis, power tools, winter dress systems, … I’m just scratching the surface, but that’s already a pretty great list. As measured in units of passion-diversity-intensity-per-hour, it’s been a good investment for me.


The difficulty of describing bugs in code

I’m working with someone to fix a bug in some code. I want him to be able to actually do the fix, and in the process, learn more about the code base. He’s taking over a project from me that I’ve been working on in isolation for a year or so, so the priority is on shifting the knowledge from my head to his rather than immediately fixing the bug.

I think I have a fix (which I developed in the process of trying to explain the code), but just handing it over wouldn’t achieve the goal of giving him the deeper understanding of the code that he needs going forward (I still offered him the option; we’ll see what he thinks). The fix only affects about three lines of code, and it probably would have taken me about 45 minutes to find and fix myself. But explaining the whole context of the code, and precisely how it was that I screwed up in the first place, that’s a lot more work. I spent 3 hours trying to document the meaning of one relevant variable, and I still feel like I didn’t do a great job of it. It will be at least another couple hours of work to describe exactly how I fixed the bug, if he wants to hear it.

This might be one of those cases where he’d be better off refactoring the code. Sometimes people use refactoring as a way to gain deeper understanding of the code, as well as making it easier to understand in the future. In this case, for example, I wrote a function called adjust-rowspan-vec, which probably should have been named update-rowspan-vec-for-next-row. Though the name rowspan-vec in itself is not all that clear, but ugh, it’s hard to find a good name for that one; maybe data-for-cells-which-span-rows-and-are-currently-in-flight-so-that-we-can-track-where-to-insert-dummy-cells-as-we-scan-down-the-input-rows, or something. So, yeah, probably needs a refactoring, just so that we can better wrap our heads around whatever concept I was trying to express with rowspan-vec.

It’s hard to describe the concepts in use in the code even if it was working properly, but to describe my partially-broken mental model when I wrote the incorrect code would add another level of complexity. I think I could do it, though, and it’s awesome that human languages have the ability to express such deep weirdness.

[And just to vent a little more, none of this is made any easier by the fact that the code in question is in a functional language, which means we’re using immutable variables and two levels of recursion rather than mutable variables and loops. Nor is it made easier by my lack of confidence in communicating in English with someone whose first language is not English…]


Vias and edges

Jayson was asking on Twitter whether anyone knew where to get pins like the ones on Basic Stamps. I wasn’t able to help him, but I did have fun looking around at the catalogs of Mill-Max, TE Connectivity, Interplex, and Keystone. There are a damn lot of connectivity solutions out there!

Sparkfun did have a couple interesting forum threads about these, here and here, and at Mill-Max, I found something close (though that doesn’t lead to any small-quantity distributors).

Anyway, when I was looking at the Basic Stamp, it popped into my mind that maybe one could save some hassle in doing home prototyping of 2-layer PCBs if one could route vias out to the edge of the board and use clips at the edges, rather than drilling and using rivets, wires soldered on both sides, etc. But then I realized that such a scheme is like trying to lay out your graph on a sphere rather than a plane, which leads to no advantage, as is well-known in topology. Topology is good for something, eh?

Thinking along those lines, though, makes me wonder about other methods that might yield some advantage. For example, route out a hole in the middle of the board and clip traces on those edges and you’ve got yourself a torus, which does (I think) get you more flexibility. It might be fun to do an investigation of graph embeddings in a variety of physically-realizable connection schemes, with an eye toward finding some method that is easy for a home prototypist given some small catalog of techniques and pre-manufactured connectors. There’s probably some paper written by Euler when he was 7 that lays this all out, so I suppose I should hit the library and brush up on my topology…



After reading The Milo Criterion, I was reminded of a thought I had a while ago:

it’s one thing to say “oh, that soup i just made from some random ingredients turned out really well.”. it’s another thing to throw up the recipe on your blog and let people put it together themselves. it’s yet another thing, though, for the entrepreneur to turn that into a can of soup that millions of people can buy for $0.99 as just another option in the soup aisle.

After I wrote that, I had a feeling that there was something odd about my use of the word ‘entrepreneur’ there. I think it’s that the average entrepreneur wants to think that their product is so radical that it wouldn’t fit in the soup aisle. It has to be in an end-cap display with a space cleared out around it so that people fainting from joy won’t hit their heads on shelves.

Maybe your thing is so radical it can’t rightly be called soup any more. But there’s quite a bit of marketing power in being on the shelf next to the soup, such that a customer in the soup aisle can use existing decision processes to decide on your product. If it really is a significant departure from soup, customers will tell you (and others) that, and they’ll work with you to define a new category. That’s probably a lot easier than trying to define that category ahead of time and then drag people there with you.


Rescaling the economies of scale

I’d like to work on rescaling the economies of scale. Let me start with a brief look at what’s meant by ‘economies of scale’. This is very simplified, and we could talk for days about different nuances and exceptions and such, and if you want to start that conversation, I’m up for it. But this model will suffice for me to explain what I mean by ‘rescaling’.

For any given product, we can find a number of ways to manufacture it. (A rubber ball can be fashioned by hand-kneading and rolling a bit of rubber, or by injection molding.) For each method of manufacture, we can separate costs into two buckets: setup and per-unit costs. (Hand-rolling balls has basically zero setup costs but pretty high unit costs, injection molding has high setup costs but quite a bit lower unit costs.) These costs mean that for any given product, there are a number of regimes, under each of which a particular manufacturing method is most economical.

So, at its simplest, the concept of rescaling the economies of scale means using the same ingenuity we use in devising those different methods of manufacture to improve upon the tools which are part of those methods, as well. We figured out how to make rubber balls cheaper by using injection molding, now let’s figure out how to make setting up molds for new products cheaper, too.

And of course, we do that. At least, whenever a production process is not completely vertically integrated, and the product is under competitive stress, then there are separate firms making tools for the process, and they are subject to competitive pressure to reduce their prices. The successful ball maker will seek and find cheaper alternative vendors for the mold making process.

So, not necessarily a radical idea, looked at that way. It might be a little more radical to say that my reason for wanting to rescale things is so that smaller producers are empowered to use more sophisticated production methods for smaller batches. To shrink the gap between the concepts of ‘prototype’ and ‘small production run’. To help bring the promise of mass customization to fruition. To allow more people to scratch their own itches. To give more little ideas a chance to come to life without having to appease the mighty powers of capital. OK, that last one is probably skirting radical, so I’ll stop there for now.


I am a magazine subscriber

I just subscribed to a new, paper, magazine (Circuit Cellar, if you wanna know). This is odd, because I don’t much like paper*, especially with ephemeral content like magazines.

But I think I know why I did. Paper magazines, after I’m ‘done reading’ them, become totems. Of what I was, or want to be, or want to do. But like any such totems, they can sorta disappear into the background of my perception after they’ve laid around the floor for a few days. Magazines, though, come again fresh every month, on someone else’s schedule. So I think I got the subscription mainly to help establish habits that I want to establish.

Or, whatever. I probably don’t actually know why I do things.

(* The fact that I have a couple thousand pounds of books does not contradict the assertion that I don’t much like paper. Deal with that as you must.)