Embedded - 134: Diet-Friendly Dog Food
Episode Date: January 14, 2016Eric Hankinson (@Kumichou) tells us about the new embedded software components ofContextual Electronics. There is a 10% coupon announced in the show, good until June. CE uses the ST-Nucleo-F030R8 boar...d. Eric's blog is www.erichankinson.com and his day job is at LeanDog. The Amp Hour episode with Chris and Elecia is 281: Crossovers and Call-ins Sealand
Transcript
Discussion (0)
Welcome to Embedded FM.
I'm Alicia White, alongside Christopher White.
We've been talking about learning to program for embedded systems, generally in C.
Last week I mentioned that Chris Gamble has added some software to his contextual electronics apprenticeship program.
He did that by convincing a pair of embedded
software experts to do the lectures. This week, we're going to talk to one of those experts,
Eric Hankinson. Before we get started, Christopher and I were on the Amp Hour last week,
speaking of Chris Gamble. We were filling in for David Jones. Things went well. There were some familiar voices from this show's past and plenty of
giggling, as you might expect. It is show number 281, Crossovers and Collins.
Hi, Eric. Thanks for being on the show today.
Hey, guys. Thanks for having me on.
Could you tell us about yourself?
Sure. So I am primarily a software developer. I've been in the industry for
about 17, 18 years or so. And probably about the last year and a half or two years, I've been
getting more into embedded, but enjoy doing a lot of different things. So outside of even tech. So that I think really kind of helps for bringing some different aspects to what we're doing.
So I do a lot of web and mobile development as well.
So lots of different languages and platforms and DevOps and all that good stuff.
Cool. stuff cool well let's go on to the lightning round before we get into digging in more on that
certainly so favorite programming language oh python what programming language should
high school students learn python i are kyle I are Kyle neither
I have to pick one don't I
you must pick
oh god
I guess Kyle
I don't know
lesser of two evils
I don't like either answer
it's a devil's choice
it is
I don't like that
have you seen the new Star Wars movie
yes I have
very very pleased with it to put it bluntly
um bb8 or chewy bb8 yeah i can i like robots it's tough oh yeah favorite processor of all time oh uh wow there's a question um so i guess it would be you know i'm gonna i'm
gonna go back to the the um because i can't wow for the life of me i can't think of the processor
but i really uh got my start with the commoner 64 so i think that was a 6502 wasn't it was it a
6502 yeah i couldn't remember what it was that was that was like my start oh yeah i i think that was a 6502, wasn't it? Was it a 6502? Yeah, I couldn't remember what it was.
Everybody started with this.
Oh, yeah.
I think that's like the old school,
and everybody's got an emulator for it now and everything,
but I kind of soft spot in my heart for that.
I have to look it up now, so don't have people emailing us.
I know.
Hardware or software?
Software.
Same true for work versus home?
Well, work, I would say, is probably primarily software. And probably hardware for home.
Because, I don't know, that's a tough thing.
Because I like both.
I enjoy doing both.
And then I am also looking into doing things
like um just making up signage and doing stuff like that where i'm taking you know when i combine
hardware uh and a little bit of software if there's a microcontroller involved but also
things like woodworking or machining or other things to actually make more than one work that
is never like physical signage oh i know know. I'm breaking the rules here.
So, sorry, guys.
Both.
Let's see.
I don't know if we've done this one.
Favorite drink at 4 p.m.
Coffee, Mountain Dew, or Champagne?
Oh.
Yeah.
You guys didn't include beer.
I thought you were supposed to include that.
Good.
We're going to add a beer.
Yeah. 8-bit or 32 to add a beer. Yeah.
8-bit or 32-bit?
32-bit.
Little or big Indian?
Oh, does it matter?
Yes.
Oh, I have to pick one.
No, that was my answer too.
I know.
I know.
I'm sorry.
I'm like, I agree with that answer.
I guess big Indian.
Correct answer.
Object-oriented or procedural? Or functional Correct answer. Object-oriented or procedural?
Or functional.
Yeah, object-oriented primarily.
Well, you added functional, so now you're going to have to explain what all three are.
Right. Well, you know, so there's a little bit.
So I've been just basically practiced a little bit in the last week being away at a conference, a regional conference in the area. And a lot of
focus was on functional programming and functional languages, right? So Erlang, Haskell,
Clojure, all that stuff. So I've been basically spent a little bit time dabbling in Erlang and
it's cool. I'm still having a hard time kind of wrapping my head around that, but certainly I think that's getting more prevalent. So I found that question interesting. So,
but you know, for the most part, my head's still very firmly in object oriented. So.
Cool. One more question. One more lightning round question.
All right. Do you work on a boat? i do yes i do my full-time job um
yeah uh we'll say yes and then you guys can ask me to explain how's that okay before before we go
on back to the commodore 64 it was a 6510 which is very closely related to the 6502 but i had some
extra junk extra junk so we'll call it a 6502. All right.
With extra junk.
Plus junk, yeah.
Okay, so I introduced you talking about contextual electronics.
Yes.
And we heard about that from Chris Gamble like two years ago he started it.
Yes.
But it's changed some.
So tell me, as though I've never heard of it. What is contextual electronics?
Sure.
So contextual electronics at its core
is effectively an online apprenticeship
for learning electronics.
So right now we have two major projects.
One is the BenchBuddy,
which is all purely analog.
So you learn a lot about analog electronics
and your first foray, if you've never
done it before, into laying out a PCB and actually designing a lot of the parts probably don't have
their pad representations and whatnot in KiCad, which is the EDA or PCB layout tool that we use in the course. And then the newer project is called Roll With It,
and that is a telepresence robot. And that actually is a mixture of both analog and
digital electronics with multiple microcontrollers. The current microcontroller, I think, I recall we're going with is a STM32F03, has an F030R8 processor on it, which I think
is like 64k and it's two I2C buses and some other stuff that's on it. But we're using that board to
kind of get people jump-started in the course as we build one of the primary boards called
Central Command that actually will have the initial micro
controller on it and then program it from there so so i understand the electronics part but you
are your background software correct and so you're teaching software to electronics people? Yes, yes. So myself and my counterpart, Ron,
we are teaching the members
of Contextual Electronics,
whether they have an EE background or not,
or potentially even if they have
a software background or not,
how to program embedded devices,
specifically these Cortex processors,
using C.
And open source tooling like Eclipse
and OpenOCD and whatnot.
And so half of teaching people
embedded software things
like working with Nucleo,
Nucleo?
I don't know how to say that.
Whatever.
That little board you mentioned.
Yes.
Is dealing with everybody's OSs and their available tools.
I mean, when I helped out at the SparkFun thing tutorial at SuperCon,
that was 90% of what we did.
How do you get around everybody's particular setup?
Yeah. So that is a lot of that.
This whole idea of what was done for contextual electronics is really based off of my used to be a systems administrator in another life. And a lot of what I did was try to make my job easier because not unlike programmers,
you know, sysadmin folks like to be lazy too.
And so if there's things that they can automate, they will.
And so I actually used a open source tool called Vagrant.
It's created and maintained by a company called HashiCorp. And Vagrant is a way to
basically script the creation of virtual machines. And so in this case, there is a Vagrant file,
which is exactly what it's named. And that's basically a setup script. And that then relies
on a handful of bash scripts that I wrote that do a lot of
work of installing packages and running set and awk and other tools to basically modify configs
and whatnot. And what happens is that you use Vagrant and VirtualBox, you install those tools,
you run a command called vagrant up in the project directory
after you download it off of the Git repository.
And what it will do is it will completely script the creation
of this virtual machine, which I think is still Ubuntu 14.04 LTS server.
And it'll put a user interface and everything in it specifically
and then basically pull out all the parts we don't need necessarily.
And by the end of that operation, which is depending on your internet speed,
an hour, hour and a half, or potentially faster,
you actually have a pre-baked environment that has Eclipse.
It has the GNU ARM Eclipse plugin.
It has Openclipse. It has the GNU ARM Eclipse plugin. It has OpenOCD installed
and a command line tool called ST-Link.
It'll have KiCad installed.
It'll have the Atom text editor that GitHub created.
And even a couple rules on VirtualBox
that anytime you plug in the Nucleo board,
it'll actually sense the ST-Link programmer
and automatically associate it with the virtual machine itself
as soon as you plug it into the system.
So you shouldn't even be prompted by your host OS like,
hey, do you want to use it in Mac or VirtualBox
or do you want to use it in Windows or VirtualBox?
That takes care of it for you.
So what that allowed us to do
is get a heterogeneous environment for everyone.
So it doesn't matter if you're using Linux
or Windows or Mac,
you have the same environment across the board.
And that really simplifies the job of Ron and myself
with trying to help individuals
in case there happens to be, you know, some sort
of a problem with the development environment. I know my Chris is very into virtual machines,
and I have only used them occasionally and have not had a lot of luck with them.
The only way to fly.
Yes, any more. I mean, even, you know, I primarily at LeanDog, my full-time job, we use, we're all completely Mac.
So anytime I need to do anything Windows, if I'm working on a project in.NET or, for example, I have to use, you know, TI's CodeComposer Studio, pretty much I have to be in Windows.
So virtual machines have really made that
a whole lot simpler to do.
So who's your target audience
for your part of contextual electronics?
Is it just for electrical engineers
or people who want to go into EE?
Well, I don't think so.
I think it's really anybody
that's willing to learn embedded programming.
So I don't have a firm grasp of what everyone's background as far as the current members, but the couple people I've talked to, some of them are, you know, hey, I, you know, I do Java programming and some other thing, you know, for my full-time job. And so I'm learning electrical engineering and
I'm learning C and I'm learning, you know, how to, you know, quote unquote, properly build embedded
software or firmware for microcontrollers. And so I think it's just kind of, the students are
kind of from all different backgrounds and skill levels,
which is cool because then that really helps, you know,
kind of guide us with like, well,
what are people concerned with or what are they having problems with?
And then I think that that gives us a better idea of,
of where folks are coming from when we give and create future videos.
So how important is the community to everything?
I mean, I saw that you, you answer a lot of questions on the forums and whatnot.
Yeah.
But how much back and forth is there? Do you have office hours?
I was about to ask. Well, yeah, not necessarily, right? Nothing's certainly fixed. There are, I think there is an option actually with contextual electronics, you can actually set up time with one of us individually, if you wanted to have some like additional one-on-one, I guess tutoring would be a good word or mentoring, maybe actually even better. But primarily, you know, it's just kind of whatever the off time is.
And so because we're in, well, Chris and I are not in different time zones.
We're very close to each other, physically located.
But for like, say, Ron and myself, it actually is kind of helpful because depending upon
what's going on, if it's, you know, late at night, I might not see the questions and he will technically see it his early morning.
So we kind of have each other covered if there's different members in different locations and time zones and so on to kind of answer questions in a fairly expedient manner.
Because that's one thing where certainly if you're asking a question, you're trying to do stuff, you don't want to rack your
brain and then kind of wait, you know, anywhere from 48 to 72 hours for a response sort of thing,
right? So, we try to be really good about that. In my case, I have very small kids. So, really,
nothing happens until pretty much everyone's in bed. And then I have time to go out and help other individuals
or create content or what have you.
So you mentioned different levels.
We should probably, when Chris was on before you,
you paid for the entire module.
And it's a lot different now.
It's month to month.
Yes. module and it's a lot different now it's month to month yes and you can audit it for 30 bucks
or participate for 60 or uh the whole tutoring and hand-holding is 279 and that's all you can
consume for a month well i don't think you get all the tutoring you consume for a month i think that's limited to a couple of hours but yeah it's definitely not all you can learn uh in the as far as the tutoring is concerned right so
it's very much like um i think the genius bar at the apple stores do this they used to be like hey
just come in anytime do whatever no um oh boy and now i haven't i have
i know ron has helped one of the members i have not yet so i can't remember what the what kind of
the time breakdown is but there is um uh you get a chunk of time with that that uh 279 price so i
think a lot of people are participate if i recall as far as like kind of the breakdown of you know
where folks are at for 30 bucks a month you could get access to all the videos. For 60, you get all the videos
and the forums. Yes. And then there is even, I think, a handful of videos. If you're kind of
like following along, there's actually a handful of videos that participate members get that are
kind of like, hey, we're going to, you know to go and try to do this thing on your own.
And then we'll circle back and you can see how Ron or I would do it sort of thing. And it kind
of gives the opportunity for members to, I don't know, for lack of a better term, compare notes
to what's going on and how they're approaching it versus how we're approaching
the problem. And that failure part is sort of, or not failure, the try it yourself and maybe fail
method really allows a lot more learning. Yes, I agree. I think that actually really
reinforces it, right? Because you, I think as an individual trying to learn something, you definitely get more out of it. So there's a handful of videos where even though I went through and I actually, I basically wrote something in beforehand to make sure like, okay, this actually works, you know, the way I think it should. There's certainly been times where I'm actually
recording the video, I'm going through and I'm showing the members how to do something.
And then something falls over, usually OpenOCD, which I'm sure you guys have encountered.
But it's just like little quirky things where it's like, oh, that's weird. Why did that not work? I think I did, I think it was
the recent intro to I2C video
where
I go ahead, we build a firmware,
everything builds according
to the compiler, and then we go ahead
and we fire it up and OpenOCD is like,
oh yeah, no, we're great. We go ahead and we'll
start,
get past that initial breakpoint
and it appears everything's running on the micro.
And then I go to take readings with the Salier logic analyzer, and it's nothing.
I get nothing.
And it's like, wow, that's really weird because I'm pretty certain the code I wrote works
and this should all be fine.
So, hey, let's go and figure out why this didn't work and kind of review the code.
No, it looks like all of our settings are correct and you know everything seems to be fine the logic analyzer and then redeploy and all of a sudden
yep yeah everything's fine right or some other little quirky thing like that it's good for them
to experience that they have you turned it off and back on again is an important part of learning
when you're dealing with technology yes yes i can imagine people coming in you know with some
background in programming from, you know,
college or whatever,
doing some basic programming
or some Python or JavaScript
or wherever,
where everything just always works, right?
I mean, assuming you write
the code correctly,
there's no weird things that happen.
And so everything seems deterministic.
But once you get all these parts together
that are coming from third parties
and hardware,
everything's out the window.
And it's probably a good learning experience to see. Oh doesn't always work no no no it's not it's not i
mean it's not foolproof right now any of this stuff that we're doing and um certainly like
anything else um growing up my dad was a mechanic and so he taught me a lot about how to work on cars and stuff.
And really, anymore, there's a lot of electronic stuff, and there's more and more electronic things.
And, I mean, as much as I love electronics, truth be told, those are more points of failure, right?
Because we're just adding more moving parts.
And though technically they're not physically moving, right, they're just all these other systems and third-party components
and things that we rely on to put together to build our software
or to build our piece of electronics or what have you, right?
Like not every sensor is going to be foolproof.
Things fail over time or something happens and electrostatic shock or whatever
and inadvertently burn up components or some other
thing happens right so there's a lot of variables that come into play when when you're busy um not
only building hardware but also building software so how tightly are your classes coupled to the
ones that chris gamble is teaching electronics well um right now they're not very right we're we're um i guess they're kind
of close because at least we're going to use the same family of processor but generally speaking i
would think they're not because we're really trying to base everything off of this nuclear
board now as time goes on um there i think the videos will become more specific to the microcontroller boards and things.
Well, at least initially central command, there'll be stuff that'll be more, I guess, consistent with that because there'll be like, well, how do we program this, right?
We're going to be, you know, we have a programming header we're going to put on the board, but we don't have the ST-Link device, right? So how can we leverage the ST-Link
that comes with our Nucleo
to be able to program an external microcontroller, right?
For example.
But I think as time goes on,
we'll probably have some,
they'll get more specific to the hardware we're building,
but they run sensors and who knows what else.
So how did you get roped into doing this? um, they run sensors and, you know, who knows what else. So.
How did you get roped into doing this?
Yeah.
So, uh,
yeah,
funny you ask.
So,
um,
I have been listening to the amp hour for some time as well as,
uh,
embedded.fm.
And,
uh,
cause I love you guys.
I love both shows.
It's so,
um,
mind expanding for sure. As I, as cause It's so mind-expanding for sure.
Because there's a lot of things I'm still learning, even though I'm helping other people learn.
But I had actually mentioned, there's a lot of times I'd mentioned to my coworkers about listening to The Amp Hour.
And my boss, Nick Berent, he had said, oh, you know, I know Chris. And so, Nick is actually,
he's an adjunct professor at Case Western Reserve, which is Chris's alma mater. And he said, well,
you know, I'll introduce you. And so, I had a chance to talk to Chris briefly. It was a very
nice sunny day. We were on top of the boat where I work.
And he had mentioned that he was thinking about, you know,
trying to put this component, this software component into this embedded courseware.
And I said, oh, yeah, you know, I would totally be interested in that.
And he said, oh, okay, that's awesome.
I'm going to make an announcement on the amp hour.
And, you know, we'll take it from there so i made the
announcement and myself and ron and an undetermined number of other folks basically uh competed i
guess for lack of a better term is there a gladiator pit because i just have this image in
my mind that involves everybody at their keyboards, head to head competing.
Yeah, we're all in the octagon, you know?
Yeah, no, yeah, I mean, I totally, yeah.
When I first heard about this, that's, honestly, that's the same exact thought.
I was thinking, like, wow, it's going to be like BattleBots or some weird thing,
but only with software?
Like, how are we going to do this? So we all submitted videos on how, you know, presenting something.
So Chris basically said, okay, I have an idea for doing, you know, presenting something. So Chris basically said, okay, I have an idea for doing,
you know, this Nucleo board
or this Freescale board,
both because they were very,
very low cost processors
and low quantity counts.
And, you know, go ahead
and give me a video explaining
how you would basically do
an initial setup for that.
And so we all submitted that.
And one of the things I did was,
hey, you know, I also built this really cool thing
using Vagrant and VirtualBox.
And like, this makes things so much easier.
And I think it would be super helpful
for the members and whatnot.
And I'm like, and even if I don't get picked,
you're more than welcome to use it and whatnot.
I can kind of give you a rundown of how this effectively works and everything and so on.
And so it's, I assume that helped being one of the individuals picked to help lead the charge and do this so um do you totally want to go see what everybody else submitted and then
recut it into a video where you're pretending that everybody's like fighting
with a giant axes or something right well you know it'd be some kind of weird thing yeah like
it would be great but i think really you would need to have some sort of like you know we have
to really have a really good like sports announcer so you can really kind of get the crowd you know get the crowd and the crowd being like what individuals
watching youtube uh all all uh all wound up and everything right like oh man this is gonna be the
best you know um eric goes for the control z in order to go quickly backwards but now now oh my
god ron ron pulls out the control v and it's all done yeah have you seen
have you seen twitch oh yes it's only a little bit a little bit different right right yeah i
oh my gosh yeah i was thinking about that the kind of um thing you know how would that be right
and i've watched a couple people i I've actually watched some live coding recordings of people doing stuff.
And I'm like, oh, yeah, it's not.
I mean, unless you have somebody running commentary and cracking jokes and stuff.
Oh, my God.
He used a space instead of tabs.
I know.
What is he doing?
What is wrong with him?
Yeah.
Where's that curly brace doing that?
Oh, compiler error.
Yeah.
It's, ah.
No, it's not nearly as cool as it sounds in my head.
I don't think that'll take off.
So, I don't think so either.
It sounds like fun to me.
Yeah, well, now, so one of the things, though,
that folks might find interesting is that there is,
Ron and I are planning on,
and I don't think this will be every one of the upcoming videos, but as we go on, we're actually looking to do pair programming and record that.
So we'll be actually recording some different aspects of what it is we're trying to solve or things we're trying to, functionality we're trying to build for the central command board and doing the testing and things of that nature.
So although we haven't kind of finalized how it's going to look, but he and I had been talking,
and it's kind of like a show camera views where it's like, here's the desktop, and this is sort
of what's going on. Or if we need to do any kind of checks for logic output or things like that.
But also then have our talking heads
in the lower corner,
which is like Twitch.
Twitch is usually like,
and in my experience with Twitch
has been Minecraft.
So it's like watch way too much Minecraft on Twitch.
But a lot of times, right, you have this individual,
they're sitting there, they're testing their mod
as a lot of times any of the stuff I've ever seen.
But it's kind of like that.
And so we're thinking like having Ron and I.
And so you get more of the team development aspect, right?
So there's two of us, we're kind of talking through the problems
and we're writing code. And then eventually, that rolls into the okay, now, like, let's,
let's do all the TDD stuff, too, right? So let's, you know, Unity or whatever,
we would end up using to test drive the code. And so since actually, Ron has never done that, that's actually going to be a
learning experience for him. So I think it'll be kind of great because we'll be getting,
Ron's a great guy and we'll be getting, I'm sure, great commentary from him on how all this works
and sort of, you know, live feedback from his experience of doing that as well as the pairing and whatnot. So we're trying
to kind of introduce more like team development aspects, right? Because it's, at least to me,
when I write software and working where I work, we have, it's our area is a completely open space
and we're not in cubes. We don't have individual offices. Everybody can
hear everybody. And while that's, you know, if you're not used to that, it's a little unnerving
until you get used to it. But it's sort of one of these things where like you end up learning a lot
about the people that you're working with or the team that you're on. And you have a lot more
collaboration and corroboration on how we're going to solve these
problems or how we're going to get to the you know next kind of milestone whatever that is in the
project sorry i i spaced out there thinking about the horrors of an open office but i don't think
we should talk about that um i do understand talking more about pears.
I see.
Let's talk about your,
your day job for a little bit.
What do you do? A lean dog?
Yes.
Yes.
So I work for a company named lean dog.
We do not make diet friendly dog food.
A lot of people call us that.
Yeah.
Oh yes.
And so we're on,
so we mentioned earlier that we're on a boat. That is indeed true. As far as I know, still to this day, we are the only software company that is physically located on a boat that's in water. So we are moored, right? We're not mobile and like booking to Canada or anything like that.
Sort of sad, actually.
Yeah, we're, no, we're completely-
Offshore for legal reasons.
Right, right, yes.
We are like Sealand or something, right?
We are our own country.
But so the boat itself is actually a half,
it's the front half of a steamship
that was built in 1892,
which makes it older than the Titanic.
And the office is two stories tall, and we share it with another company,
Ayers Keithley, their marketing firm. And it's really interesting because it used to be a
restaurant, and it was kind of an icon of that area, the downtown, or I shouldn't say really
downtown, it's the lakefront. So there's like
Rock and Roll Hall of Fame, and there's this World War II submarine that we're parked next to.
And then there's us, and we get a lot of still to this day, being 2015, and the restaurant hasn't
been open since I think 2008 or so, or maybe even earlier than that, that we get people coming in,
hey, isn't this still a restaurant? And it really begs the question of,
well, if you look around,
it really looks nothing like a restaurant at all.
But yeah, we're very big into agile practices
and that includes the whole open spaces
and pairing and TDD
and acceptance test driven development or ETDD.
So the area I'm at is an an open what was the dining area effectively and then what was the
bar upstairs uh okay as fascinating as this is i'm gonna interrupt you sure suggest what does
lean dog do if they don't make diet friendly dog food yeah right, right. So, sorry. Yeah, I apologize because everybody's like, how are you on a boat?
So, we are a boutique software company.
We do have a design and delivery studio.
That's the portion that I'm a part of.
And we build software for clients, whether you're a startup or you have an idea and maybe you don't
have an IT staff or you're a larger company and you need to do things like maybe Skunkworks,
or it's just, hey, you know what? I've got so much stuff going on and I have a ton of budget
and my people can't actually get to it. Would you guys be willing to take this on and build this internal
product or product for sale, whatever the case may be for us?
We also have other portions of the business that go into training as well as agile coaching
and organizational, I guess you'd call it organizational transformation.
So that's, hey, you want to quote unquote go agile.
What does that mean?
And what does that mean for your business?
And so we have folks that are on the road
that will actually help the business
and work with the actual business side
and kind of get them going.
And then folks that will be embedded
with the development teams
and actually teach them things like pair programming,
user stories, TDD, ATDD,
and all the other awesome acronyms
that come with working in Agile.
Which do you do?
What is your function there?
I am primarily a developer for them.
So web primarily, as well as I do a lot of the DevOps for our customers if they do or do not have infrastructure and they need help with that.
So I've set up a lot of environments, done a lot of load testing and things like that for our customers.
Obviously, embedded work, a couple of different, doing varying levels and prototypes and whatnot, and also have done coaching in the past. TDD and so on. And outside of that being my kind of day-to-day thing, I a lot of times will give
talks at colleges or high schools to students about either kind of, you know, being in the
software development field or even just other topics like, you know, if a high school class
is interested in learning about like
3d printing or um building something basic with arduino and things like that that's all kind of
things i do from time to time so on your resume or linkedin or however i cyber stalked you it
looks like you do a lot of different things ruby rails python ios embedded there's a lot of breadth there and
there's a lot of commonality between languages but sure sometimes embedded in particular because
that's what i know depth is required how do you balance Having a really good memory?
No.
So that's a huge help for sure.
You know, it's hard.
I don't know.
I guess for me, I always kind of look at it.
It's hard to remember everything.
And certainly, I think the hardware, to a degree, forces you, depending upon, I guess,
depending upon what it is, right? So, if you're, I kind of view it as if you're in a Cortex family,
there's probably a lot that's fairly applicable across the board, whether using like an M0 or the brand new M7s that just came out. If you're kind of looking at just general functionality. But I'm very good at,
or have gotten very good at being able to kind of look things up and reviewing data sheets or
digging through the language and trying to remember how do I do this particular construct?
Or if it's maybe not so much C c but things like python or some of the other
interpretive languages or even really java and c sharp like well you know there's probably some
kind of a module or a plugin or something that does these sort of things so i don't necessarily
have to reinvent the wheel let's you know kind of figure out what that is and incorporate it.
So years ago, I had been doing.NET for almost 10 years.
And when I first started doing.NET,
after I got the general gist of what was going on,
most of the framework I could pretty much remember
and be able to kind of use something as simple as a text editor and then just build it.
I didn't necessarily have to use visual studio and the,
all the IntelliSense stuff that came with that. But it's, it's, you know,
now there's like, there's no way, there's no way there's so, I mean,
just the base.net framework itself is so massive.
There's no way that you're going to be really able,
at least I don't think
that you'll really be able to remember everything and be effective in that way. So there's a lot of
having the cursory knowledge of how the things work and where to look when you're trying to
jog your memory. So that could be a data sheet or really anything else, I think. So how do you define the difference between software and embedded software or software and
firmware? Wow. Well, I suppose I kind of look at it as embedded is not Linux. So I don't know. I don't necessarily, I guess, consider
like a Raspberry Pi or a BeagleBone
or something like that to be necessarily embedded.
I always look at embedded as it's bare metal,
like the software that's running on bare metal.
So that's embedded.
And then everything else is just kind of
application software. So even if i'm doing
something on a pi that is for convenience sake say written in python because there's all these
adafruit has all these libraries to deal with the gpio pins and whatnot on a pi makes it a lot easier
to do that um you're still you know maybe running or writing services uh that run on the Pi, but they're all contained within Linux.
They're not necessarily bare metal, like what we're trying to do with whether it's an Arduino or these Nucleo boards or any other microcontroller. How do you describe the difference between techniques in application software web development and the techniques that you would teach in contextual electronics for embedded developers?
Oh.
Are there different approaches, different tactics, strategies, thoughts?
I think a little bit, right?
So, I mean, one of the basic things is that if we're using C,
we don't have,
we don't necessarily have classes,
right?
So it's more procedural,
I guess,
because you're going to have just less like global space of nothing but
functions,
right?
So the kind of grouping things together will be really sort of relying on
things like header files.
And that's going to be probably about as good as you're going to get until you move to something
like say c++ where you actually have classes and whatnot that help you at least build i guess a
little bit more of a structure that you might be used to if you already have experience in object
oriented languages right so it's there's there's some of that is a little bit,
I think from that aspect, it's a little bit different. I mean, some of the things like
building it certainly are different. So you can either, right now we're really relying on Eclipse
to kind of put the projects together and generate the makefile and sort of do all that stuff behind
the scenes. But if you're doing some other piece of language say if you're doing c sharp you're
potentially most likely you're probably doing visual studio that's going to set up all these
ms build files for you and and one main solution and kind of orchestrate it
and for you even if you're compiling it from the command line right you're going to
feed something in ms build and it's pretty much going to wire it all up for you
versus something say like python or ruby right you You're going to feed something in an MS build and it's pretty much going to wire it all up for you versus something say like Python or Ruby, right?
You're just going to run an interpreter
and as long as you required all the files correctly
and you required your libraries or imported them,
if you're doing Python,
it's going to take care of all the compilation
and the execution of that.
So there's different, like the different structure,
I think is part of that is getting
used to for students if they've had a software background. But a lot of that is just kind of
how we decompose. I think other things will be like how we decompose the problem and deal with,
you know, if we're dealing with hardware, we're dealing with registers and other things that
you just don't have in application software. You're going
to have, you know, probably like a serial port class or something that helps you communicate,
depending upon if you're using some vendor piece of hardware, like maybe some sort of USB
library that's a driver library for a particular piece of dedicated hardware, right, that comes
from a niche manufacturer. You're going to have those drivers
and their SDK.
And you can,
if you look to do things like
TDD and stuff like that, you're going to look at how can I
mock these things out so that I can
focus on tests for
isolating my code and not deal
with those hardware. Well, you know, when you're
looking at specific hardware and doing firmware,
now it's like, oh, yeah, I'm going to isolate hardware,
but I'm going to do it at this much, much smaller level
where I'm going to be isolating registers or serial buses
or other things that kind of come into play.
So I think it's the same general ideas,
but I think a different level of granularity
is probably where that becomes different.
One thing that comes to mind also
is if you're coming from a general application background,
you don't usually think too much about resources, right?
Oh, gosh.
If you're developing on a Cortex-M0,
suddenly you might have these people who are like,
well, what do you mean I can't just have whatever memory I want?
No, yeah, you can't,
you cannot do the kitchen sink, right? That's just, that's not a, that's not an option, right?
Neither is failure. No, no, just kidding. But the whole thing is that, yeah, you really have to kind
of focus on what it is you're trying to accomplish and at minimum, really write the minimum amount of code to make it work and
as far as libraries and things are concerned you know take use what is the minimum amount that you
need to make things functional right you can't because of the limitations you cannot just you
know hey let's just pull in like all of this you this peripherals library and do all this stuff.
A good example of this is that if listeners have been messed around with an Arduino
and Adafruit has a breakout board for the TI CC3000 Wi-Fi chip,
there's actually their library, their C library,
when you go to its GitHub's page, actually mentions to say, hey, you know, if you're using this on a certain class or higher processor, you can actually use if it's a Teensy or something. Maybe it's an ATtiny.
There's a particular level of Arduinos that if you want to use that CC3000
so you get some level of network connectivity to like maybe push logging
or ping a URL or whatever, you have a much finer subset available to you
because of the memory constraint for that processor, right?
So that's, depending upon what you're doing,
that may actually come into play in writing drivers
if you have to support different levels of, say, different kinds of products.
And maybe one product has an M0 and another one has a Cortex-M4
that's got like a half a mega RAM versus the 32 or 62K of RAM on an M0, right?
So that certainly would be an example of something like that where you're much more resource
constrained, certainly. And you have to take that into account, right? It's not like, hey,
I'm running a MacBook Pro at 16 gigs of RAM and sure, i'll write a python script and like load all the things into memory
and you know go from there um that's not not so okay on a microcontroller so talking about
libraries and and cross uh compatibility with different controllers you did a video on cmsis
could you tell me about it sure so cmsis, for folks that don't know, because we, you know, being right in electronics and software, we never have enough acronyms, right?
Is the Cortex microcontroller software, or, oh my gosh, here I go.
So it's a serial, basically their specification, interface specification, right?
So that gives us,
it's a nice thing that ARM actually did.
So for the Cortex series of processors,
it gives us a baseline way
to access things like registers
and deal with, you know,
even though the processors
come from different vendors,
right, from TI or ST or Freescale or NXP,
you can, if they're all stamped with the CMSS specification,
you can be sure that at the bare minimum in the libraries
that you can actually access all the registers in the same
manner and program the, you know, whether it's I2C or any of the other buses, right, CAN and all
these with the same, doing that all in the same way, right, but still allowing the manufacturers
to kind of differentiate as far as, you know, what's, what do they bolt onto the processor, right?
So it gives you a baseline that makes it easier to deal with moving code amongst processors
or even potentially amongst manufacturers.
So that, yeah.
So it's a hardware abstraction layer.
Right.
And it allows different implementers based on who is making the chip.
So you're not dealing with the same code across different platforms.
It has some interesting effects because of that. Like, if you read the CMSIS code, you may find out that there are a lot of side effects happening
that you didn't necessarily expect, especially
if you're used to doing things
with registers or
even application code.
You might not expect,
oh, I'm not only setting
this GPIO, I'm clearing all of the
other ones and then resetting them, which might
have interesting effects. Right. So, so, so it, right. Interestingly enough there, oh my gosh, now I'm trying to think,
I know recently that there was, there was mentioned about there is an edX course on
microcontroller development using the Teva launchpad, which is a Cortex-M4.
And that's given by UT Austin.
And I actually took that earlier last year just to get a really good idea kind of on
how do professors teach a class like this?
I've never taken any class on edX.
So I thought it'd be a good opportunity
to kind of check all this out in one shot.
And the professors made a really good point
about kind of like making,
short of making like friendly changes to registers, right?
Do things like bit masking
and going in and saying, okay, great.
What I really want is given the data sheet and what's going on and what registers correspond to what ports.
And those then, each bit in the byte will tell you, okay, each bit represents a pin and so on right so you want to use like masking or or use flags in actually trying to
be mindful of what you are setting or what you are overriding so that you know you get the pin
that you want and you don't do exactly what you just said which is like oh i'm just gonna like
equals this thing out and i'll set it to this, you know, hex value.
And yeah, it sets this pin.
And then, you know, it's not until later
when you're maybe trying to do something
with other pins in that port
that you then realize like,
whoops, I actually like wiped out all these other pins
and I ended up like I disabled them
or I turned on their alternative functionality,
which is not something I meant to do or things of that nature.
Right. So it's it's that certainly there.
Yeah. You know, with great knowledge comes great responsibility and all that.
So our great power comes great responsibility.
So it's it's definitely you have to kind of be mindful of what you're doing when you're working at that register level.
And the CMSIS is very helpful as example code and very helpful as prototyping code.
But if you want to use it for everything,
consider rewriting part of it
because it's not necessarily efficient.
The goal is to check this box off for ARM implementation.
Only a few processor vendors are taking it seriously as the goal is to do something awesome here.
Right.
And I haven't met any of those processor vendors, so don't ask me which ones they are.
I'm just sure they're out there.
Sure.
I can mention some ones that don't take it seriously, but that's sort of rude.
Sure. ones that don't take it seriously but that's sort of rude sure um so you talked about watching edx
videos to get sort of prepped for teaching this way uh what else do you do to prepare a lesson i
mean how do you decide how you're gonna how big you're gonna make it what you're gonna talk about
and and how you're gonna present present it. Oh, yeah.
So I think sometimes that kind of,
I kind of feel like sometimes that's a little like,
that's sort of all over the place.
I guess it depends on what the topic is.
So a lot of times if we're looking at things where, ah, it's, I don't mind talking to people,
especially if it's a thing I'm really interested in.
But certainly for things like videos, you got to try to keep it as short as you can, I guess.
So, you know, you don't end up losing the audience.
And so it's kind of, depending upon what the topic, a lot of things I try to think about are, what's the shortest potential example I can come up with to try to get a particular point across. Or if it's something like, say, like the I2C or spy intros, it's like, all right, well,
what we're going to do is we're going to do something very simple.
We're going to configure that piece of functionality and then at least validate that it functions
using a logic probe.
And we're not going to go anything further than that. So let's come up with a
contrived example, I guess you could say, of just getting to that initial point, right? What's that
really short kind of win that we can have to sort of illustrate a point of, you know, in the case of the intros to those buses,
just get something working and validate that we say,
oh yeah, no, I can see that we're pumping data
and I can see that, you know,
the information we're pushing on the bus,
like, oh yeah, here, the logic software is showing us,
like, here's the actual bits that we're sending, right?
And we can see that and correlate it to the code code we wrote and um at least understand that you know we do have things configured
properly for example a lot of things are like with the c fundamental stuff is is just sort of
a little bit more difficult because some things it's it's how do we kind of illustrate some of
these things if uh you either don't have background in C or potentially you don't have
a background at all in programming. For all I know, we could be having members coming on
that don't have a program background at all, but they have enough interest that they want
to try to learn this. So it's hard to get that balance. Yes, exactly. I mean, that's always the balance with trying to teach something
is you need to know who your audience is
so that you can connect it with what they already know.
So how would you change prepping for contextual electronics
versus prepping for a real-life class
or an hour-long seminar at a conference?
Well, probably not, I guess overall, probably not too much different,
but depending upon what the subject would be, it's a lot of times I,
if I'm trying to teach some sort of a class on something or give a talk, I do like to have a number of examples, depending upon how much time I have.
But I think it's helpful to have in-context examples of what the subject is we're talking about. recently, for example, recently gave a talk to the Case Western Reserve Hacker Society,
and it was around,
I did some prototyping work with a TI sensor tag.
Have you guys ever seen those or messed with one of those?
Yeah, they come in two flavors now.
They're BLE with a sensor on them,
and you can update the code if you really try. But for the most part,
it's learning to write the application that works with the tag.
Right, right. Yeah, the mobile app, right, in this case. So, I had done a prototype where I
needed to add just a little bit of functionality to the firmware. And so, I thought, well, that,
you know, kind of a, not so much a lessons learned but like here's some
things that we were doing to deal with you know I want to write firmware how do I go about that
and what does that look like and so there were some examples I gave a little bit of code examples
of like oh here's things that I changed to say hold, right? So I want to be able to double click or double tap,
I guess, the user button on the sensor tag.
And I want it to basically take a snapshot of the readings
and stream the snapshot version over BTLE
as opposed to the constant updating every second,
which is the default behavior of the firmware.
And so there was like, show a little bit about that.
Okay, now we're, you know, we have a example application, a custom app that pulls that values in and shows that in our iOS app.
And then later, I basically showed an example of like, oh, here is using mobile Safari.
And that the app, native app I wrote, also happens to be an application extension.
And I can actually plug values from, you know, like temperature or barometric pressure into Google and ask Google to do temperature conversion for me, right? Just to kind of give the students sort of an idea
of like, there's this thing and here's how we like modify it and leverage kind of what comes
out of it and give some, you know, actual like physical example of that, as well as like code
and things like that you potentially would if it was a session, you know, around development with an SDK, for example. So what about Arduino?
You do have a few videos about that on CE, right?
Yes.
Do you use it a lot?
Do you like to teach with it?
I do a lot of times.
I mean, outside of contextual electronics, I have a lot. And just kind of if I try to, from time to time, participate in a local group that we have hosted at LeanDog called Make on the Lake.
And there's been a lot of times we try to do kind of like simple projects that sort of get people interested in things that, you know, can you do it like in an hour and a half or two hours projects.
And a lot of times those will be with things like an Arduino or Particle.
And I think that's an easy way to, an easy point of entry.
So certainly there's a huge ecosystem with breakout boards and expansion
and all kinds of stuff around Arduino as well as, right, custom Arduino stuff.
But the IDE, right, the Arduino IDE certainly takes care of a lot of the details, and the
details being things like all the register configuration, right, for making a pin to a
digital read or a digital write or, you know, analog reader write or turning on I2C or
a lot of those kinds of things where they take that needing to know the detail behind how that
works in the processor, whether it's an AVR or it's the newer, the Zero or the Dway where they're
actually ARM-based, you don't have to worry about that, right?
So I think from a beginner standpoint, that is an easy way to kind of get started
and sort of get the small wins kind of thing with,
hey, I can actually light up this LED by activating this pin if I'm using an Arduino
and then sort of build on it from there.
I think there's definitely value in that.
That is a starting point.
And one of the videos we have is kind of migrating away from the Arduino.
And because there's a lot of quote magic that it does
with the code that it compiles you now move into okay great now
if we're going past the arduino and you're going to like a nucleo or one of the free scale
kinetis freedom boards or something like that well now you're getting into the oh now you actually
have to learn like the deeper functionality of how do you make the pins
work the way they do, or how do you manage the program as far as if I want to do any kind of
logging, for example, and I want to use a little portion of memory and try to store some information
there temporarily before I push it over Zigbee or something like that, right? So
there's all these different details and things that I think are, and rightfully so, I don't
know that if you're just kind of looking to tool around with it, right? An artist that wants to
make some kind of display and light it and learn a little bit about how to do that, he can certainly use an Arduino and not like,
he doesn't need to know, right, the ins and outs of that. But if we're, you know, kind of a lot of
other folks that I've met that kind of have used Arduino and are very familiar with it are like,
okay, now I want to do more with it. Maybe I want more IO or I want to do these other things. And I'm kind of like, you know, outgrown it, I guess,
for lack of a better term.
Now I'm going to move on to something else.
So sometimes that's Raspberry Pi or BeagleBone
or any of the single board computers,
or that might be, you know, a higher order microcontroller
like some of these Nuc nucleos and things like that that are
more powerful than your you know at mega 328 or something like that just about anything
is more powerful than your pretty yeah pretty much pretty much uh so with teaching like contextual
electronics and the apprenticeship idea is is college no longer useful?
Actually, did you go to a four-year university?
Oh, yes.
So that's the, yeah, no.
I did.
I did three semesters and quit.
I never went back.
So technically, I'm still a freshman, according to the state of Ohio.
And a lot of what I've been doing is either been teaching myself,
so that includes even software development, or basically pairing with people and learning from
others. So whether that learning from others is I'm actually physically sitting next to people and kind of being mentored or, you know, videos or classes,
whether it's physically showing up to a class or doing stuff online, like contextual electronics
or edX. I've been kind of wherever I can learn something new. So, and even reading books and
doing, you know, trying to recreate the programs that I see in the books. So, and even reading books and doing, you know, trying to recreate the programs that I see in the, you can learn a lot of what electrical engineering does,
for example, from, say, something like contextual electronics.
But I don't think, say, you took something like civil engineering.
I don't know that that's possible.
I don't think you could be a civil engineer
and not go to an accredited college and get a degree in it. So I think some
of the stuff that I generally think it sort of depends, right? So software, I mean, there's a
ton of software people. I know lots of people that have CS degrees. I know people that are
great programmers that have degrees in music. And I know lots of other people that are great
developers that don't have degrees at all and are self-taught.
So that's kind of a tough thing.
So I think it really just depends on what you're going after and to the level, right?
So if you're just learning to cursory knowledge of software, you could probably take classes, but I don't think you would necessarily need to have a degree involved to have some level of proficiency.
Yeah, being able to program is not that hard.
Being a software engineer, I think, usually takes more than that.
Right.
Right, yeah.
It's, it's, there's a great analogy.
I was hosting an open space at the Code Master Conference I just attended,
and a gentleman, Guy Royce,
made a great comment where it's kind of like,
depending on your level of learning electronics,
we're all software programmers.
And if you take a look at things like
using an Arduino in breakout boards
versus
trying to go and actually
build analog electronics
and design your board and build firmware.
It's sort of the difference between those two economies
is like script kitties versus actual programmers, right?
Like if you're just kind of learning,
you're just going to sort of cobble things together
and you can get it mostly to work
versus I actually know why this works, right?
And that's that huge difference between them.
Really, a lot of times it's going to come with what you learn and then experience.
Because nothing can really replace actual experience.
You can read about it all you want, but unless you actually try to do it, it doesn't reinforce it.
Well, I think that's actually a pretty good point to end on.
Eric, any last thoughts you'd like to leave us with?
Sure.
Yeah, I really think that no matter if you're trying to do electronics or you're trying to do software, even embedded software or application software, really, I think the important part is don't be afraid to just get in and get your feet wet and try to learn stuff.
Don't be afraid to make mistakes.
And certainly in this day and age of, I mean, relatively speaking, how cheap electronics are,
if you're looking to just kind of tool around with things like Arduino or any of the breakout boards,
don't be afraid to accidentally burn it up.
I mean, it up, right?
I mean, it's, relatively speaking, pretty inexpensive.
So, there's, I think, a lot of learning opportunity there and available to folks out there that they want to get into electronics or software development. So, I mean, never stop learning.
Don't be afraid to make mistakes.
Seems like good advice. A little bit of destruction
goes a long way towards education.
It does. It does.
Our guest has been Eric
Hankinson, instructor at Contextual
Electronics and
Ruby iOS, DevOps
developer and Agile coach for
LeanDog. Note that Eric
brings us a coupon
for getting 10% off of
contextual electronics. Use
embedded.fm as you
check out and it is good through
June 2016.
Note
that it's, you know, if you
go for the participation level, you get
$6 off every
month from now to June.
So maybe time to start that resolution.
Yeah, totally worth it.
Thank you for being here, Eric.
Thank you.
And thank you listeners for listening and for my new iTunes review, which was five stars, which are the best.
Also, thank you to Christopher for telling me about it, for producing and for co-hosting.
He does a lot.
Hit the contact link on Embedded FM if you'd like to say hello or email us show at embedded.fm.
We'll be here next week.
I'm not quite sure what we're going to talk about.
This little note in here, tease future show.
And I don't know what I was thinking when I wrote that.
I never do that.
In the meantime, in the meantime, whatever the next show is, a final thought to leave you with.
This one is from Michelle Silverstein. From Where the Sidewalk Ends, there's a little poem
called Homemade Boat. This boat that we just built is just fine. And don't try to tell us it's not.
The sides and the back are divine. It's the bottom I guess
we forgot. Embedded FM is an independently produced radio show that focuses on the many
aspects of engineering. It is a production of Logical Elegance, an embedded software consulting
company in California. If there are advertisements in the show,
we did not put them there
and do not receive any revenue from them.
At this time, our sole sponsor remains Logical Elegance.