Posts Tagged ‘Making Embedded Systems’

h1

My checklist for debugging insurmountable issues

June 21, 2014

I listen to the Amp Hour podcast. Last week, they were talking about ways engineers fail and about checklists as a way to be more disciplined in avoiding preventable errors.

I try to learn from my mistakes so I do have a checklist of sorts when I reach the “it’s all broken and never, ever going to work again” stage of debugging. Of course, when I get to that point, the symptoms are usually different. Still, some parts of the path are relatively common.

1. Having you tried turning it off and back on again?

It is a joke, a very well seasoned joke. But it is only funny because it is so horribly true. This isn’t a good way to debug a horrible problem but it does provide the circumstances the problem happens under. I often start from scratch to reproduce issues because there is often a clue in the process. So, turning it off and back on again is a way to make sure that I start from a well-understood starting point.

The next questions:

Really? Are you sure?

But these are going to follow most of these checklist questions. As embedded system get more complicated, it is pretty easy to turn a part of the system off but not all of it. I don’t usually go from no-power-to-my-desk, I almost always start with my computer on. But sometimes, turning off all power is necessary (including restarting the debugger).

2. Does it have power?

This is different than the previous in that the “it” refers to all the things that may be broken: the processor, the debugger, the sensor or actuator, the level shifters, everything. This step usually requires a voltmeter (and is related to #5).

3. Is it running the code you think it is?

I sometimes have two or three code bases. If my development environment is pointed to the wrong one, I could easily be compiling over here but loading the image from over there. Or possibly, if the load process is difficult, I may think I’ve loaded the code and somehow missed a step.

I’m working on a big system now, a monitor of another system. When I compile the code, it goes through four machines before it gets to where I can try it out. The possibility that I typed cp instead of scp (or forgot the ending colon!), well, let’s just say it happens more often than I’d like.

This is the reason to have build numbers. But if you are really, really sure it is running the code you think, change something about the output and reload. Make sure you see the change.

4. Did you read the boot and debug output?

I write error logging features and always want a serial debug output. I love power on self tests. However, once the system is working, I stop looking at them. But sometimes, if a cable has loosened or hardware has failed, the system will tell me. But only if I am listening.

5. If it used to work, what changed?

Nothing changed, of course. It just stopped working. My minor code change could not possibly have caused something so catastrophic.

I’ve heard that. I’ve said it. That doesn’t make it true.

If nothing changed, then run the old code. If it fails, well, that’s interesting now, isn’t it? If it succeeds, well then, stop saying nothing changed, something obviously did.

This does require frequent commit to version control, to get back to a last-known-good image. But you were doing that anyway, right? And then you can binary search to determine where the error crept in.

Note that if the code change doesn’t explain it, compare the map files (even the binaries). Realizing that something crossed a boundary may give you inside. Oh, also, the makefile (or project file) may have changed: optimizations can have big ramifications.

6. Is there anything interesting in the map file?

Like many embedded engineers, I find the map file to be a bit of an illegible mess. Happily, I’m not afraid of them anymore. There is an amazing amount of information in the map file. And it provides a different perspective on the code, sometimes it will jog my memory.

7. Can you prove it is hardware?

Of course, at this point, it probably is. But you know hardware engineers, they can be feeble. They need proof. So what kind of proof can you offer? How can you break it down to show it cannot possibly be the software?

Seriously, I have had the privilege of working with some phenomenal hardware engineers. It is seldom hardware (but not never). The process of proving it is hardware is a good part of debugging. Plus, if you can make the difficult error repeatable for the hardware engineer, they’ll probably take you to lunch for making their jobs easier.

8. Can you explain the problem to another engineer?

When I tutored intro to CS, I asked people to explain their problem to a teddy bear outside my office before explaining them to me. I usually listened in. However, at least 50% of the people thanked the bear and left without talking to me. Ok, probably only 20% thanked the bear but most walked away because they never actually needed my help. They needed to get their thoughts in order, to explain it to themselves.

I do that now, talk to myself. Sometimes I try to explain it to a trusted colleague (or a junior engineer) in email, trying to figure out what questions they would ask me so the explanations is really good.  Occasionally, I even send the email after all that, if I still can’t figure out the problem.

9. Did you use the single line if again?

When I saw Apple’s goto Fail bug, I completely understood.  I avoid unbraced if statements because one month, I tallied up my most common coding mistakes and found that unbraced if statements caused a disproportionate number of my bugs. I vowed never to use them again.  Since this is a known failure point on my part, it makes my checklist.

 

h1

Podcast statistics

February 18, 2014

I know little blog, you are not getting the attention you deserve. Neither is the are-you-ok device. I’m spending a lot of time working and a lot of time with my podcast.

Speaking of my podcast, several people have recently asked for statistics on the listeners. It would make more sense if said people were offering me money (i.e. sponsorships) but because the podcast is sponsored by our consulting company (Logical Elegance), I haven’t bothered to figure out how to make sponsorship work. And if it is this annoying, I may never bother.

Anyway, I decided to sit down and figure out the statistics. And write a paper-let for potential non-sponsors. (Why? Why? I really do have useful things to do but this is what I did.)

Determining traffic is very difficult, particularly as producer Chris and I do the podcast as a hobby, not as a business. However, I’ll try to give you some ideas to help you decide if this is a good media outlet for you.

embedded.fm stats

This is our traffic to embedded.fm over the life of the podcast. Most people hear about the show and visit embedded.fm.

However, once they’ve heard about the show, they use a podcast app to listen regularly, such as iTunes, Instacast, Stitcher, or Zune. For the ones that use RSS (iTunes, Instacast), libsyn provides the statistics of episodes downloaded. (Zune and Stitcher are used by less than 5% of listeners.)

libsyn download stats

I find the graph a little hard to read, though the orange trendlines do show a week-to-week consistency. Looking at the monthly numbers, you can see that there was a bump in November when Jeri Ellsworth’s show came out (and my show was mentioned on The Amp Hour).

 

Year-Month Month Year Total Downloads
2014-01 January 2014 4,160
2013-12 December 2013 3,558
2013-11 November 2013 5,700
2013-10 October 2013 2,216
2013-09 September 2013 656
2013-08 August 2013 608
2013-07 July 2013 507
2013-06 June 2013 383
2013-05 May 2013 122

 

Geographically, the listeners come from around the world, though mostly English speaking countries.

Listener geography

 

Looking at a few specific episodes, the numbers depend on many factors. I don’t know what they are, some of it is guest promotion but a large part is simply how interested the market is in the topic.

Episode 36: Drive your boat with a Wii mote. Saleae founder talks about the Saleae Logic

Episode 36: Drive your boat with a Wii mote. Saleae founder talks about the Saleae Logic

Episode 29: Ducking the Quadcopter. Microgen Systems VP of Engineering talks about energy harvesting.

Episode 29: Ducking the Quadcopter. Microgen Systems VP of Engineering talks about energy harvesting.

 

Episode 26: The tofu problem. Deeply technical discussion on internationalization of embedded devices.

Episode 26: The tofu problem. Deeply technical discussion on internationalization of embedded devices.

Episode 23: Go for everything I want. Jeri Ellsworth talks about CastAR and Valve.

Episode 23: Go for everything I want. Jeri Ellsworth talks about CastAR and Valve.

Finally, I can’t speak to the specific breakdown of the audience, from the emails I receive, it is primarily hardware and software engineers.

h1

Intro to podcast

January 21, 2014

Dear Friend,

Thanks for forwarding on this message to people who might be good candidates for being a guest on my podcast.

My podcast is Making Embedded Systems, the show for people who love gadgets. Usually more about the development of gadgets than actual gadgets, the audience consists mostly of hardware and software engineers.

The show is in iTunes, Instacast, and Stitcher or you can get it directly from embedded.fm.

I’m interested in talking to folks about their gadgets: how does it work? how did you develop it? how did you fund it? what’s your favorite tool? did you set up a manufacturing line and where? how do you teach people to do this?

If any of those could be something you can chat with me about (either personal projects or professional), then I’d be happy to send more details about how it works.

The summary is that it takes about 90 minutes of your time, it isn’t live so mistakes can be removed, and you shouldn’t have to prep much since I want to talk to you about something you already know. I prefer to record in my home studio near San Jose and Campbell, California but we can do recording via the Internet.

While this is sort of advertising for for my book and our consulting company, we don’t really discuss them (except to say, yep, still there). I do this mostly because I like to talk to interesting people about their jobs… and maybe to have a few more more women’s voices talking about technology (but not necessarily about being women-in-tech). That isn’t to say it is only women guests, if you’ve got a widget that you are enthusiastic about, I’m open to lots of topics.

Interested? Know someone who might be interested? Please send a message

Thank you!

Elecia

h1

Want to be on my podcast?

June 5, 2013

I have a podcast now: you can listen at http://embedded.fm/ or search for Making Embedded Systems on iTunes (or Instacast or Stitcher). The podcast is about embedded systems and, like this blog, it consists of whatever I’m excited about (and who I con into being my co-host/guest).

But what I really wanted to put here was some of the process stuff I’ve learned having done the first four podcasts. Here is the short version.

  1. Find guest, agree upon general topic.
  2. Make outline (ideally Wednesday before show)
  3. Send outline to guest, get mods back by Friday.
  4. On Saturday (or Sunday), do 2 hour recording session.
  5. Producer does producer-y thigngs
  6. Show comes out on following Wednesday.

So, once I hook a victim and choose a topic (i.e. “What an electrical engineer thinks a software engineer should know”), I make an outline.

The outline isn’t exactly a script, though the intro and outtro are written out. The outline is more a list of points and questions so I don’t forget any of my plans. We don’t have to stick to the outline but it means I don’t have the “err, what was it I meant to ask” feeling all the time. It also lets the guest know what things I’m likely to want to ask about so they don’t get caught off guard.

I sent the outline to the guest. Actually, the outline starts with a notes section:

I tend to script the first few minutes as it helps get comfortable. I have no problem going off script, it is just a crutch for the first few awkward minutes.

If you want this (or something else), let me know. We found paper to be noisy so I’d prefer to put your notes on my ipad if you’re ok with that.

Finally, I put in two end points. The goal is 45 minutes but I’d rather be 5 short than 20 long.

Next in the outline is the intro, all scripted out, as promised above.

This is Elecia White, welcome to Making Embedded Systems, the show for people who love gadgets.

This week I’ll be speaking with Phil King one of my favorite electrical engineers. The plan is to hear what a hardware guy thinks software engineers should know.

Hi Phil, welcome to the show.

[Phil says hello]

I know you’ve worked at some neat places, we made children’s toys for Leapfrog and a gunshot location systems at ShotSpotter. What else have you been up to?

[Phil gives 30s bio]

When I was a manager, hiring new embedded software engineers as my minions, Phil was part of the interviewing team. He was excellent at finding people with really good skills, even better, he could articulate what he liked (and didn’t like) about candidates.

So, Phil, what was your secret question?

And now we are out of scripting and into the outline. From here, there are lots of points I might want made (either by my guest or by me, I don’t usually differentiate). Sometimes these are question (“You always really cared, making sure we hired good software engineers. Why is that important to you?”) and sometimes they are just notes for both of us (“software engineers can damage to HW…”). Also in the outline, I might have reminders purely for me (“tell story about capacitors”) so I don’t forget something I think is nifty.

But these are just conversation points, if we skip one, no big deal. If the conversation is flowing, I’d like it to flow naturally.

Finally in the outline, there is the outtro, what I need to record when the show is over.

We’re out of time though I know we’ve got a lot more to talk about, you willing to come back?

[Phil]

Ok, thank you for joining me. Thanks also to our producer Christopher White and to everybody tuning in. Please leave us comments and questions at embedded.fm or show@makingembeddedsystems.com. We love to hear from you.

Next week, we’ll be talking to (? about ?). Have a good one.

I write the outtro so I don’t forget to thank people or say where to send comments.

Once the outline is done and sent, I start taking notes for random things I might want to say… extra things inside the outline bounds. Sometimes I ask for questions or information from twitter for “voices from the audience” sorts of things. I also try to think up some pre-show chat while we are getting the sound levels right (I jokingly asked Phil about his feelings on exclamation points, we got off on a tangent about the interrobang which made it into the show a little). It calms the guest (and me) and makes the show flow better if we are already chatting.

Recording isn’t hard, thanks to my husband-producer-superhero, Christopher White. He’s done wonders to make us sound good. Despite most people not liking their voice (me included!), everyone has been happy with the recordings, so far. In addition to monitoring sound levels, he tags points where we start and stop (hey, I stutter, sometimes I don’t want to share that) and highlights where we mentioned things that should go in the show notes (that RSS feed doesn’t write itself, you know).

Recording takes about 1-2 hours to get enough info for around 45 minutes of show. Later, usually right before he releases it, Chris edits the audio to eliminate the goofs. He makes us sound good (and balanced), does any bleeping, adds music as needed (he wrote the intro!). He attaches it to the RSS feed, presses publish. That makes it go to iTunes and Instacast and Stitcher where people can get it.

If you want to be on the show, please let me know. Most of my guests haven’t done too much prep (I want to talk about what you know, not something you need to learn and prepare for) so the process is about 2.5 hours of your time: gadgets, embedded systems, parts, technology, working on gadgets, maker projects, etc.)

There are some things I still need to figure out. We have a recorder I can carry about (if I’m willing to get crummier audio) so it is possible to do on-site things. But I need to learn to use it better, especially to get voices right for an interview. I have a plan to interview someone in San Francisco in July so I have a deadline. And I know some people do podcasting via Skype audio which would increases my pool of guests; I want to sort that out.

There’s always more to try out and to learn. And I suppose when there isn’t, I’ll do something else.

 

h1

Embedded systems conference call for abstracts

October 13, 2012

About a year ago, I was getting ready to push the giant, red button that said GO for my Making Embedded Systems book. I thought that once I was done writing, it would be finished. Then I thought once the figures and tech reviews were done, the book would be ready to go.  Surely once we fixed all of my misplaced commas, it was done, right?

Not really. Then I started doing promotion. I did two webinars for O’Reilly. Those are a lot of work. I also looked around for other promotion to do: speaking at schools, talking to magazines about reviewing my book, being in the scary “out there” to meet people and market my book.

I also wanted to present at the embedded systems conference in the spring, I’d attended for many years but here was my opportunity to speak! By the time the GO button was pressed and I came up for air, I’d missed the conference deadlines. There was a slot for someone to talk about LEDs but what do I know about LEDs?

Turns out, enough to fake it. With the wonderful help from EE Rob Mitchell, I did a live demo on how to take some Christmas lights and make them run from an Arduino (similar to Deep Darc’s blog post). I showed how I could make lights to leave up all year as they changed colors based on day of the year. We went from boxed lights and uninstalled software to working things, showing the process of cutting wires and loading software. We even talked about productization paths, methods for getting from idea to market and how to look at costs.

We had more show than information but it was fun. And live demos are tricky things; the audience is there to see you succeed. But if you crash, burn, and light a fire on stage, well, that’s ok too.

Even though we were in the LED section of the conference, we got all-access badges which let us go to any session we wanted. And we got access to the break room. It doesn’t sound like much, but it was where all the other speakers hung out. And there was lunch, coffee, assorted snacks, tables, and chairs. At times, it felt like heaven.

One thing there wasn’t, though, was women. I think I saw two other women the whole time I hung out there. I was kind of disappointed not to meet any other embedded systems people who share my gender, if only because they’d be the only ones who’d really appreciate my light-up shoes project.

So, this year, I looked in early October for the call for abstracts. It appeared, they were all set. Eeek! How could I have missed it again?!? Ahh, no, it just hadn’t opened yet. I emailed the track chair for my LED session (feeling guilty as I never wrote her that article I’d promised). That led to me talking to one of the organizers, actually getting to pitch a few ideas that aren’t open yet, maybe getting to co-chair a track. Whee!

The call for abstracts is open now. Go on, submit an idea or two. I’m most excited about the case studies for debug and test and the one about getting to “Hello World” in under five minutes. (Hey! That is what I did last year!)

And if anyone wants to join a panel, loosely on sensors, well, drop me a line. I’m percolating on my own ideas but happy to listen if someone wants to chat about theirs.

Here is a prototype for a light-up animal.  Naw, this is a jelly fish from the Monterey Bay Aquarium. But if your idea for a talk is a quarter as cool as this jelly is, please submit it.