We're hiring!

We're actively seeking developers for our new Detroit location. Learn more

Adventures in Undefined Behavior

I recently had to write my own malloc. While replacing important bits of the C standard library would normally be serious over-engineering, it turned out to be the only option. The Backstory We had taken over an embedded project with known stability issues, and I quickly determined that thread race conditions were involved. After fixing…

Read More »

Posted in Embedded Software | Tagged | 2 Comments

heatshrink: An Embedded Data Compression Library

In embedded systems, space is always tight. Adding pennies of extra storage can be enough to kill a budget (when multiplied by hundreds of thousands or even millions of units), so available space has to be used effectively. For my current project, I need to fit a lot of data into 16 MB of flash:…

Read More »

Posted in Embedded Software, Tools | Tagged | 13 Comments

Making Diagrams with graphviz

graphviz-ab2

graphviz is a great tool for creating quick diagrams. While it does not have a particularly polished WYSIWYG editor such as omnigraffle, it can automatically create diagrams from its simple markup language, DOT. After reading in the DOT markup, it uses various layout algorithms to automatically arrange the diagram. The DOT language is pretty flexible…

Read More »

Posted in Prototyping, Tools | Tagged | Leave a comment

Code Reading

Translation

I was recently asked if I had any advice for reading code. It’s an important skill for developers, because practice reading code leads to faster ramp-up on projects. Studying good codebases is also one of the best ways to pick up a sense for project architecture design. 1. Find Your Point of Entry First, there’s…

Read More »

Posted in Design & Development | 6 Comments

Message-Oriented Programming

Mail Slot

I just finished a project that used a Kinect’s computer vision tools to gather information about people nearby, then communicate with other hardware to adjust the environment. (Vagueness due to NDA.) The Kinect’s SDK limited me to C#, C++, or Visual Basic, but the other device only had a USB HID interface (a generic human…

Read More »

Posted in Design & Development, Embedded Software | Comments closed

My Presentation at Strange Loop

Strange Loop Audience

I recently gave a talk at Strange Loop called Data Structures: The Code that Isn’t There. I think it went pretty well, though I started out nervous due to a last-minute battle with OSX’s display settings and a much larger audience than anticipated! They had many excellent questions, both during the talk and through the…

Read More »

Posted in Events | Comments closed

Auditing Changing Requirements for Common Classes of Errors

Needle in a Haystack

While testing an engineering build for an embedded project, we noticed some strange behavior: the code matched the requirements, but some magic numbers in the requirements were out of sync with the diagnostic protocol. I realized that a batch of old requirements had been added by copy-paste-modify, and someone had forgotten to update a few…

Read More »

Posted in Embedded Software | Comments closed

Randomized Testing in Lua with Lunatest

While unit and integration testing can verify that code correctly handles known edge cases, randomized testing can detect the edge cases themselves. The programmer describes their assumptions about a function’s output and how to randomly generate representative input, then lets the test runner search for counterexamples. This is particularly useful when checking algorithms’ invariants, and…

Read More »

Posted in Embedded Software, Testing | Comments closed

Problem-Solving Like a Generalist

books-scaled

I develop embedded software, but if you look on my coffee table, you’ll see books on a wide variety of programming topics — information retrieval, garbage collectors, and so on. This would strike some people as strange. Shouldn’t I be focusing on electronics or something? Yes and no. I consider myself an “embedded specialist,” and…

Read More »

Posted in Culture, Design & Development, Embedded Software, Languages, Tools | Tagged , , | Comments closed

Raspberry Pi: Prototyping Potential

Recently, the Raspberry Pi Foundation started shipping its Raspberry Pi boards. (And I got one!) They’re tiny, low-power computers, originally designed so that schoolkids could afford a personal Linux computer for learning programming. Despite selling at the same price point as an Arduino ($25), they have almost as much processing power as a netbook. Once…

Read More »

Posted in Design & Development, Embedded Software, Hardware Design, Prototyping, Tools, Unix, Linux, and Bash | Tagged | Comments closed