Embedded - 418: Answer Me These Questions Three
Episode Date: June 23, 2022Chris and Elecia question embedded systems then answer listener questions about embedded systems. They mostly agree except about one thing which, after some discussion, they agree upon. Mostly. Video... of Cissy Strut cover where Chris plays all of the instruments Video where Elecia shows off some programmatic origami and simulation (not discussed but it seemed reasonable retaliation for talking about Chris’ video) Dynamic Linker for Cortex-M (github repo) Transcript
Transcript
Discussion (0)
Welcome to Embedded.
I am Alicia White, here with Christopher White.
This is going to be one of those weeks where we just talk with each other.
Assuming the computers and all of this complicated gear that I have
actually lets us talk for more than four seconds.
We're on intro number four, I think.
Maybe five. Yes, sorry. I think intro number four, I think. Maybe five.
Yes, sorry.
I think we're ready.
I think it's working.
Is this the thing to blame for our little oops on the last episode?
No, no, the thing to blame for the little oops,
the several oopses on the last episode is me.
And cut and paste and my finger on the trackpad
and somehow some clips that were from the end of the show
that were supposed to be deleted,
I got pasted to the middle of the show.
And then I fixed that and then reposted it,
and then I didn't realize that I'd missed one of those little clips
that had been randomly pasted.
So I had to fix that and re-upload it.
Anyway, so everything seems good.
I'm sure this is going to be fine,
unless it comes out and we sound like robots.
That's fine with me.
Looks like from our agenda that this is a AskEmbedded.fm, AskEmbedded episode.
There's lots of asks.
Yes, we foolishly asked what people wanted us to talk about,
and then they gave us a ton of questions, many of which we cannot answer.
But we can try.
Or we can at least say why we can't answer them
or don't want to answer them.
Or why the question is improperly formed.
So I'm finishing up my class per cohort,
and we did a retrospective where I asked the students
what could be better.
And it seems like the thing that they really had issues with were the quizzes, that they all seemed like trick questions.
Is that because they were all trick questions?
No, it's because writing quizzes is really hard.
I had no idea.
I mean, because I know what the answer is when I'm writing it. And I have to come up with, you know, alternatives that are both relevant and wrong.
Multiple choice is always difficult for everybody.
It's difficult to make good multiple choice questions.
And it's difficult to answer them sometimes because of this thing that you're mentioning, the ambiguity.
Or the, well, but actually, sometimes.
I'm definitely going to put a disclaimer at the top of all quizzes that say the answer is always it depends.
Oh, see.
Oh, sorry.
And if you feel that way, just try to go with the.
The best answer.
That's why sometimes they select the best answer.
Right.
Or the most common answer.
Assuming a perfect world with no corner cases,
which of these following four options would you choose?
Well, and I think perhaps some of my questions are very dense
and they need to be three questions
and they would be easier to answer as three questions
than one very dense question.
What is it the thing from uh monty python you get past me answer these questions three okay so yes so there'll be questions today and we will we will make mouth noises about how
the questions make us feel uh i think first we do need to start with bicycle repairments.
Pictures.
Which hopefully we will be putting in the show notes.
Do we really have to talk about this thing?
I really don't feel like it.
Go ahead.
Describe what these pictures are.
Okay.
We'll try to avoid the scatological humor.
It's a urinal, so there shouldn't be any.
It is an Android IoT connected urinal?
Well, we don't know that it's actually connected to the internet, right?
Was that, was that, was that?
Why would you put, there were just so many whys.
Well, the first why is why.
Like, why?
Why is there a screen at the top of your urinal?
A place where I won't put nothing.
I don't want to touch anything that's been near there.
I don't want to touch anything that's a picture of...
I don't want to touch a picture of this.
I don't want to touch things that have touched this.
I don't want to touch things that have thought about this.
I wonder if it's a touchscreen.
Of course it's a touchscreen.
How else are you going to interact with it?
Anyway.
Did you see a little keyboard to the side?
A little P-board?
Anyway, this was brought to our attention on the joint Slack,
which you can also join for just a dollar on Patreon if you're so inclined.
And so, imagine a place where you go to, as a male individual, go to, you know.
But at the top of it is a computer screen.
And not only is the computer screen there, which raises most of the questions,
but it has an error and a MAC address.
It's connected. It has a MAC address.
My favorite thing about this whole thing is if you look at the picture,
there's the brand name at the top, and it's Swiss Invent.
So if you don't have...
The Swiss invented this.
If you don't have a complete picture...
Their neutrality is now to be questioned.
It's a crashed urinal.
It has to be a title option.
Apparently it's in Switzerland,
because there's another picture of it working
and uh the text is in german or swiss german or whatever what exactly do you have to do
how much first of all how much beer do you have to consume to even have the time to interact with
this thing in a meaningful manner this This is not a long procedure.
How bored do you have to be?
What exactly are you going to do?
Are you going to buy stuff?
Oh, wait a minute.
The German says one hand free?
Yeah, that's enough.
Okay, moving on.
That says plenty.
We've discussed this enough.
People worked on this. Okay, people this enough. People worked on this.
Okay, people worked.
People had meetings about this device.
Long meetings in rooms.
Boring meetings where they were arguing with people about the right form factor and the right color
and the interaction model, the font, the state machine.
People talked about this.
People got mad at their managers because
of some slight they had
about some management detail while they were
working on this.
So if you ever feel bad about your job...
Unless you're the person that did this.
One more thing and then we can move on from this.
There is nothing that makes me want to retire and smash every computer in the house more than this
this is it this is the thing that this is
is this still recording yes okay let's let's move on to something. To one of the Twitter ones.
That doesn't make me both angry and sad and make me laugh at the same time.
From Twitter, which one?
Oh, from Twitter, let's do, do you have a tip everyone should know?
Okay, yeah, sure.
We ask our guests that, but we've never really had to answer.
A tip everyone should know.
Wow, I'm not prepared for that.
Okay, go ahead.
I hate to say that patience is key,
but it kind of is.
And it's not patience that you're waiting
for something else.
It's patience with yourself
as you're trying to figure things out.
That's a good one. I don't have that,
but that's a good one. I don't have that, but that's a good one.
I see people getting frustrated because it doesn't work.
And I think they get stuck with it doesn't work.
And the real thing is it doesn't work yet.
And that yet is really important.
Well, that's the key piece of impatience, right?
I want this to work now so I can get onto something that I want to do more.
And that's something I've been struggling with with music,
which I always come back to because I don't actually like computers.
So I'll analogize everything to something I do like.
But yeah, like, why do I practice?
Why am I practicing this thing?
Well, I want to play like this person.
You know, I saw them do this amazing thing or this improvisation.
I want to get to that.
Well, I can't get to that until I spend hours and hours doing things that are kind of boring or repetitive or require a lot of concentration.
And that stuff's hard.
It doesn't feel good.
What would feel good is to be amazing.
And, you know, that's the same with this.
It's like, what would feel good is to have this working
so I can add something else to it.
And getting to the point where the things that, you know,
it's the stupid cliche,
the journey is more important than destination.
But you have to get to a point where some parts of the journey are enjoyable and
and correcting problems overcoming failures reading the data sheet reading other people's code
yeah stuff like that is is actually at some level enjoyable and you have to have those small wins
though right you have to you can't just slog forever. So you have to, you have to
make your work so that both you do the boring stuff, but also the boring stuff does lead to
small wins. So if you're always feeling like you're in that state of nothing ever works, then
you have to ask yourself, maybe the way I'm going about things isn't the right way.
That's a good point. I mean, some of this comes because I'm working on the final reports critiques for class, but there were a couple of people who got really frustrated and would move on to something else and get really frustrated and move on to something else. good approach to not stay frustrated. But then they ended up with a project that was a whole bunch of frustrations
that weren't complete instead of one thing done well.
And I don't know how to help that.
Saying have patience with yourself, it wouldn't have done me any good to hear that.
No, no.
Once you've got somebody telling you that and you're in the
mode that that's like saying don't stress don't stress or you know calm down calm down
i will not calm down um you know it's really difficult and it's stuff you have to
practice and learning are both skills and all the things that irritate people about learning,
other things irritate people about learning how to learn properly. It's all very meta, but
if you don't know how to learn properly, which I don't profess to know how to learn properly, I
get into this state very often where I'm very frustrated. But if you don't know how to learn properly, then you can expend tremendous effort doing what you think is learning and getting not
very far. And that's one of the things I've been working on for a long time and trying to work on
more recently is how do I spend my time learning more efficiently? You're taking a drum class on how to learn.
I'm taking a drum class on how to practice.
On how to practice.
So there's no exercises about drums or anything.
It's not applicable just to drums, but it happens to be from a drum instructor.
And it's about how to practice and how to structure practice in such a way that there are these small wins how to find the most important
things to work on to the exclusion of all else um without having a scattered brain and like oh i
gotta learn this oh i gotta learn that oh god oh this doesn't work i gotta practice that um
and part of it's just to, to find ways to, there's only so much time you're effective while
practicing things and physical things are different from mental things, but I think it applies.
Once you've like been doing homework for an hour straight or something, or working on a technical
thing, your brain starts to get tired. And so do you want to keep repeating the things, keep working on the things that aren't doing a lot for you in
that first very effective hour? Or do you want to move the stuff that's really effective to the
first part where you're fresh? So there's things like that. And it may not be applicable to all
things, but that was kind of an important insight to me it was like oh yeah after 40 minutes i'm kind of tired and it's harder to it's harder to do certain things while i'm practicing
but in that first 20 minutes i've wasted 20 minutes warming up wasted 20 minutes just doing
you know rolls and things or rudiments on the snare drum to warm up but that time is gone
and i haven't learned anything.
And it was fresh, good time.
It was fresh, good time, and I spent that time doing something I already know how to do.
It's like when I read data sheets, I usually read them at the end of the day when I'm very tired.
Yes.
In order to get an idea of what's in them.
And then the next morning, having internalized what's where,
that's where I start reading the data sheets so I can implement code with them.
Yeah.
And so, you know, sometimes it just comes down to when are you working on stuff?
Are you working on your projects after a long day of work working on computers?
Are you working on your projects right before lunch and aren't really focused on it?
Yeah.
So that's a tip everyone should know.
Learn how to learn.
Well, that leads into what Carrie asked.
Well, I didn't get to give my tips.
Oh, I'm sorry.
I'm sorry.
I thought your tip was learn drums.
No, I would never want people to do that.
It's hard.
Frustrating.
I'm sorry.
What is a tip?
I have two tips for everyone.
Okay.
They're very short.
One is if you're on a Mac,
and this is not existential tips,
if you're on a Mac and you're in terminal,
you know, the terminal or command line,
your bash shell thing, your Z shell, your T shell,
whatever's in the thing where you typey typey.
On a Mac, if you've got a long command
line there and you want to edit something, like you've got a bunch of arguments and you want to
go back to the first one, you don't have to hold down the button or know a bunch of weird key chord
combinations to skip from word to word or go to the beginning of the line. Just hold down option
and your mouse, and you can put the cursor anywhere in the line edit that you want
with one click.
I love that.
Second tip, always do the homework.
Really?
Yes.
From you?
Yes.
Do you do it in the first five minutes of class?
No.
That won't get it done.
I mean, I went to school with you.
That only works in high school.
I saw you write a 20-page paper on tank warfare.
That wasn't homework. That was a paper.
In like an hour. It was impressive. And you had...
The reason I had... Look, the reason that...
That was the last thing I had to do before graduating.
It was like the last day of school and I did not care.
I think he made up the references, but he did have footnotes.
I did not make up the references.
The references were all good.
It was all about Tobruk.
Go look it up.
Yeah, no, do the homework because this applies back to your tip.
If you don't, you can't learn to do things without
doing things. And sometimes you have to do things over and over. And that works with math, it works
with computers, and all that other stuff. So much to my dismay, do the homework. That's the end for
tips. And now a word from our sponsor.
Why choose Newark for electronic components?
From humble beginnings as a small electronics shop in 1934,
Newark has grown into a leading international distributor of electronics and industrial components.
They offer products, services, and solutions that support customers
in a wide variety of applications. Industrial manufacturing and maintenance, medical product
design, automotive, avionics, telecommunications, security, and more. From design and testing to
production and maintenance, discover why so many choose to partner with Newark. Newark has operations in the U.S., Canada, and Mexico.
They are serviced from a regional distribution hub in South Carolina.
Newark is committed to supporting local language, currency, product, and shipping needs across North America and around the world.
As part of a global business, Newark has access to stock and strong relationships with electronic manufacturers.
They can easily serve all of your industrial electronic needs.
Learn more at Newark.com.
That's N-E-W-A-R-K dot com.
And we have a coupon for those of you in the U.S.
Pod Save 20 will get you 20% off.
That's P-O-D-S-A-V-E 2-0.
Thank you to Newark for sponsoring this show.
Okay, let's move on to other questions.
Okay, so related to all of this,
Carrie asked how we'd approach learning new skills
or leveling up existing skills
if you don't have a mentor at your workplace.
I'm not sure how the mentor makes a difference.
If you don't have somebody,
I'm reading that as you don't have somebody in person
to help you or teach you
or somebody to call up and ask questions.
If you have to learn purely from open source materials, I mean, in the broad sense, like
books or open source materials.
I would actually say books is a great thing.
When I learn things on the internet, sometimes they are without basis.
I mean, they're good and they're useful for what I'm working on, but because they aren't connected
to other things, I will lose them quickly. And so a book is somebody's long effort to make something clear in a way you can retain it.
Somebody's blog post is their reminder for how to do it themselves.
And possibly they're trying to help you too,
but to some extent they're writing it for themselves.
Yeah.
I would add into that, which I think is good,
and this goes back to the homework thing,
find ways to practice.
So if you have a book that has no exercises, you're going to have to come up with some exercises.
So if you're trying to learn, let's say you're trying to learn some new technical thing to do work on your project,
to incorporate in your projects, a code thing or some electronics thing.
Well, do you have a project that you want to use that on?
Because what I've found is that it's very hard for me to learn things with no,
not as I'm going to say goal, but nowhere to apply it in the near term.
And that was really hard with school with certain abstract things.
You know, it's math. When am I ever going to use this? Well, it turns out eight years from now. Not really motivating, but true
sometimes. And it's easier to learn the second, third, and fourth time. Yeah. So having a project
or a sub-project or something where you can take a technique and immediately work with it and try it, practice,
apply it in a few different ways,
but just do it immediately is way better
because you get that little dopamine hit of,
ah, oh, okay, I see, I see how this works
or I don't see how this works.
What am I doing wrong?
Because that's a piece that you can miss from reading,
just purely reading is, oh, I understand this.
Oh, yeah.
And then you go to
apply it it's like uh well that made sense in the book but now i have it in this other code
and i don't these don't connect i don't understand um so either either learn to make up
ways to practice on your own that feel good or find sources that have that built in with exercises at the end of chapters or
books that are part of some other like there are project books where you learn learn stuff that way
it's very hard to learn new skills if you're not using them yeah and i found it i found it easier
to learn new skills at work when I had to.
Yes.
Pressure and guilt actually work pretty well on me for that for, you know, short periods of time.
Because this is my job and I have to learn this.
I have to make this work or else people are going to be mad at me, which isn't a great motivator.
So if you can try to do the other thing before that happens, that's good.
The whole curiosity in practice?
Yeah.
That's hard.
You don't always get the opportunity for that.
It's rare.
That's why you have to make the opportunities.
Are there other ways to level up skills?
Teach them.
Oh, yes. teach them oh yes that is uh
that is one of the biggest fastest ways to learn is to try to
is to have to or try to teach someone else um
i learned freshman physics concepts way better than i ever had and fully
integrated them into my understanding when i had to teach
freshman physics um and i thought I understood them before, but until you've got a bunch of kids
asking you random questions that you have to answer because you're the teacher, that is rare. Every week with teaching class is a pop quiz on the material that I thought I understood.
And it's a pop quiz that you can't just say, I'm happy missing these points.
You have to answer.
I don't really know the answer.
I'll get back to you.
Yeah, you can only do that a couple times before they stop.
Are you the teacher or not?
Yes, exactly.
Yeah.
So I don't know how to find a way to teach, depending on the skill.
But, you know, becoming a mentor for someone else, you ask if there are no mentors in the workplace, well, make yourself one.
That's going to be very effective for learning new skills.
Because you have to stay ahead of them.
Or a slight step down from that is, you know,
pick something you're really interested in that you want to learn
and make a presentation.
Make a YouTube video teaching it.
Because that will focus your learning capabilities
when you're on the hook to actually explain something.
And the whole explanation process, if you were just explaining it to a rock...
The rock doesn't ask questions?
Right, the rock doesn't ask questions.
But even just the process of thinking slightly differently, oh, I need to explain this rather
than I need to learn this, can be helpful.
Going back to, you said making a video. You made a video.
Oh, yeah.
We don't need to talk about that, do we?
Yes, because you worked hard on it.
Ask me questions.
Okay.
You made a video recently.
There's a blue thing rolling down our driveway.
Okay, it's done now.
I made a video. I made a video.
You made a video recently.
What song did you play?
It is a song from The Meters.
It's one of the, an older funk song, kind of progenitors of funk, called Sisystrud.
And you play drums on it?
I play drums on it.
That was my original intention was to do a drum cover because it's a tricky drum part
that sounds simple, but is actually quite difficult.
And I don't think I actually nailed the feel, but I spent some time learning it because I wanted to.
And then you also played bass on it.
I just decided to play everything on it, yes.
Keyboards and guitar and bass.
Yes.
And then you did this, you learned the song.
Yes.
And then you took a video of you playing each learned the song. Yes. And then you took a video. Yes.
Of you playing each of these instruments.
Yes.
And not like once.
You did a couple of takes.
More than a couple, but yes.
And then you clipped this together.
Yes.
So that you would have a little music video of you in different shirts, which I found hilarious.
Not always. Because you would go change the shirts.
Well, no, it was different days.
Not always.
All right.
And you put together a video of you playing all of these.
Yes, I did.
Are you happy with how it came out?
It's fine.
I think my drums could have been better.
The other instruments I felt pretty good about.
I didn't quite get the...
Yeah, nobody cares, but...
Why did you do this?
Why?
Well, it goes back to practice.
And having a project in mind helps you learn things.
So that was a song I've wanted to learn for a number of years
and hadn't really spent the time to do it.
And I found a couple of videos of the original drummer,
whose name is Zigaboo Modaliste, playing it. That changed the way I thought about it and made me
think I could probably do it. And so I started spending time learning it. And I have been trying
to put out more video stuff because it focuses the mind. Much like teaching, it's putting yourself
out in public and you don't want to put yourself out in public and embarrass yourself. So that
makes me practice harder. It makes me focus more on the playing. It makes me more critical of things
I'm doing wrong. It makes you finish something. Feedback into my playing in practice and makes me finish something. So yes.
Do you think you'll look back on it in six months or a year and be happy you finished it?
I'll be happy I finished it. I'm hoping in six months to a year, I will be less happy about my playing. Fair enough. Because then I will have learned more and be able to recognize more things
I was not doing as well. How often do you look back and say, oh, you know, a year ago I didn't know how to do that.
And now I did through my own efforts of hard work.
Not as often as I should.
I can listen to that first record that I'm on and cringe throughout the entire thing compared to later work.
It was still a fun record.
Well, fun is, yeah.
It's enough for people like me who listen.
That's fine.
Anyway, yeah, so that's why I did it.
If people want to check it out, they can look at my YouTube channel.
Okay.
Please don't look at my YouTube channel.
Let's see.
Nails also asked if we should bring back the dinosaurs.
No.
No? No.
No.
I mean, we talked about a cassowary recently, so I feel like we have the dinosaurs.
Yeah, so we don't need to bring them back, and I don't like them.
We watched the David Attenborough dinosaur documentary, which was very strange, very cool.
And dinosaurs are scary?
Yeah.
And sharp.
And sharp.
Very, very sharp.
Like cassowaries.
Yes.
What's an often overlooked aspect
during development of an embedded system?
This one's from Peter.
You want to take a crack at that?
Sure.
I'll get started.
In class, I know I'm bringing everything back to class because I was working on class stuff before.
Sorry, I bring everything back to drums.
Before we started, and so my brain's there.
But we had Chris Speck come and talk to us about digital design.
And then we got to talking about iRobot and what he does. And he said that
up to a third of the time is spent on tools. And I was a little shocked by that. The students were
a little shocked and kind of relieved because they'd been dealing with tools all week.
And I know we talk about it a lot here.
I mean, we've talked to Tyler a couple of times,
and we do talk about compilers and everything.
Yeah, I think that that's a tough area that is often overlooked,
partially because once you have one, you never have to change.
Well, that's the thing.
That's what I was going to say.
I agree that a lot of time,
I don't know how to quantify it, but say 30% is spent on tools.
That's because for the first three months of your project,
90% of your time is spent on tools.
But yeah, that was going to be one of my answers too,
is tools and getting a streamlined workflow that everyone agrees on, everyone is happy with, and that everyone can deviate from without causing a fuss.
So having it so people can use their own editors and stuff and configure it the way they like,
I don't mean so that everybody's got a different number of spaces for tabs and stuff like that,
but you know, your code has to look the same.
But, you know, everybody wants a different theme or a different key thing.
So if you're enforcing an IDE, I really don't like that.
And if you can find a way not to do that, that allows people to be more efficient because they're more comfortable.
It's like enforcing having everybody in the same chair or something.
So, yeah, tools.
Good.
Security, over-the-air downloads.
Yeah, those are tactical things.
I don't think those are overlooked so much as they're...
Shuffed in at the end?
People look at them and they hope they don't, you know,
they're out of the corner of the eye
and they hope they're not coming up behind them.
Testing.
Testing, yeah.
I'm going to say integration.
I have a project that I might work on, I don't know.
And the actual what I need to do sounded pretty simple.
But then my next question is, okay, how do I test this to make sure it works?
Because it's in a giant system?
And how do I make sure?
And if that hadn't been one of my first questions,
the whole contract likely would have gone very differently
because how it was pitched to me, sure, that's like an afternoon's worth of work.
But now that I think about testing it,
I'm like, okay, that's like three weeks worth of work.
Yeah, yeah.
The reason I say integration
is because a lot of projects have multiple teams
and stuff comes together at weird times.
And that's never put...
The question was things that are
overlooked and that makes me think things are not put in the schedule or things that are not a lot
of time for or things that people get mad when you say oh we have to do this and it's the end
of the project and they just want to ship so integration is one of those where it's like you
need time once boards come back once the final boards come back once the housings come back, once the final boards come back, once the housings come back, the software, the firmware,
you need time for all of that to be put together
because you didn't have time when they were in their parallel development
to test them together or easy ways to do that.
And that can take a lot of time where things are just like,
oh, this doesn't work.
And now we have to re-architect how this piece of hardware talks to this other piece of hardware,
or, you know, stuff like that.
So integration is a big one, and that's been a big pain point at several companies I've been at,
because all the parts come into the building, and the software is done,
and then suddenly it's like, doesn't work uh marcello asked what would the perfect
programming language be apple soft basic 1979
uh that's i don't think that's an answerable question because every programming language has different applications it's designed to deal with different goals different performance
trade-offs different uh i have an answer okay go for it something my entire team knew well okay
well sure but if your entire team knows you you know, Pascal, that's going to be a
problem. And that's it. Not always. Okay, Pascal. Yeah, no. Yeah, I don't think there's a perfect
language. I think a lot of problems is people keep trying to write one. I have trouble with people knowing the surface of a language and not being able to dive deeper.
And that causes more problems than trying to find the perfect language.
I don't know that many programming languages, but I have had enough experience with a number that I like.
I like some things about C. I don't like some things about C. I like C++.
Python has many excellent qualities.
awk was awkward.
I'm not sure awk was awkward.
I'm not sure awk is a programming language.
It was the way I used it.
Yeah, no, I totally agree.
It's like asking, you know, in some sense, it's like, what's the perfect four-wheeled vehicle?
I mean, if we had John Katz on again, he would say fourth is the perfect language.
But I'm not so you have one'm not so... You have one way.
I mean, it depends
on your definition of perfect.
Yes.
Like, is there a language
that you can solve
most any problem in?
Sure.
That's probably C.
Binary, man.
Go straight for the binary.
Yeah, you can't solve...
Everything's a Turing test.
Yeah, okay.
A Turing machine.
But in C,
given enough time and effort,
not an infinite amount of time,
you can probably write any kind of application you want.
Sure, because you can write almost any compiler in C.
That's cheating, but yeah.
But you can do a lot in C.
It's just, do you want to do it efficiently from your time point of view?
Do you want, I mean, so, yeah.
But if you're writing a web application the perfect language is
not c right that's why i'm saying what's the definition of perfect something that could
conceivably be used everywhere i'm sure but that's not yeah next a grumpy old man asked
uh if we were ever going to have a follow-up with the cat no because the cat would be, if she was still alive, 23 years old now,
which would be really stretching it.
So we'd have to get a new cat.
Which I'm not opposed to.
But given the amount of hate mail we got for that,
probably not.
But think of how much more we'd get now.
I know.
That was like early.
Yeah, yeah.
If you could design your own microcontroller, what would it look like in terms of peripherals, cores, and other features?
We have another email that's sort of on that same topic.
Do you want to answer that or go through the email?
I'm going to try to answer it and then we can bring the email up.
I have purposely not thought about this before right now.
Even though on Twitter you said, I should think about this before answering.
Well, I think I said on Twitter, I should think about it, but I won't.
Oh, all right. Okay.
So the thing about microcontrollers is they suffer from kind of the same thing that programming languages do sometimes,
where they try to be the perfect thing by having a lot of features and a lot of peripherals.
If I was to design my own microcontroller, given a blank sheet and you can have whatever you want, it would be application-specific.
Exactly.
I'm not going to design a microcontroller without knowing how it's going to be used.
I would choose not only how much RAM
but what kind of RAM I needed,
how fast it needed to be,
whether there were trade-offs
in power and things like that for my
application. Maybe I want 64K
of fast RAM and a megabyte
of slow RAM.
And zero wait state flash.
Yeah, and the peripherals would be you know i would
probably not include any i squared c so that the electrical engineers could not use any i squared c
parts um still mad at i squared c i see yeah did you know that the transcription translates I squared C to ice cream? So it's the ice
cream bus?
Yes. And this would have two ice cream buses. But yeah, so, you know, there's things I like
on microcontrollers. So there's certainly, I can answer those sorts of things. Like I
prefer Spy to I squared C wherever possible.
FIFOs or not FIFOs?
Not FIFOs means you have to do DMA,
which is kind of good.
And FIFOs can lead to latency.
But on the other hand,
if you're not going to bother doing DMA,
FIFOs are really nice.
I have not enjoyed using FIFOs.
They kind of suck.
But I don't know.
Again, it would depend on...
It depends.
You know, it depends.
Yeah, I don't know.
Seeing this question from scratch,
what would you say to it?
It sounds like you would have a similar answer.
Oh, no. It would totally depend on
what the application was.
I mean, a low-power application
has vastly different requirements from one that
you plug into the wall and one that needs to be cheap is greatly different than a large
hadron collider, which doesn't need to be cheap, but it has other requirements.
Am I having a display on it with fancy graphics? Then I need some extra stuff
and DSP.
So yeah, it's hard.
I think before I can design my own microcontroller, I have to design
my own application. Right. Which I'm not
going to do because I don't like computers
and I regret bringing
more of them into existence.
Yeah.
Yeah.
And to take the question the other way, if I just had no application to
design my perfect microcontroller, it would probably be, it would probably end up being
something like a Homer car from the Simpsons, you know, with all kinds of weird features that I
thought were fun, you know, so useless to nobody or useless to, useless well useless to both nobody and anybody
so but this kind of leads into this other thing this little rant here is that all right yeah
chris l uh wrote an email in which he ranted which to be fair, he said I'm about to rant. Yes. I mean, I'm not putting that
word into his mouth.
I'm not sure what led to this,
but it was amusing.
It had to do with the SAMD21, which is a
Cortex-M processor from microchip slash Atmel, which is always, you know, could they separate again and we can have Atmel back?
Anyway, so the crux of it seems to be the documentation is terrible.
Oh, wait, no, there's more.
Wow.
Okay.
Do we want to go through, through like summarize some of the highlights
of this rant sure i mean one is the documentation is terrible um having used nxp and stm uh the
microchip documentation was incredibly detailed at the peripheral level almost annoyingly so
do we really need table of 32 identical registers printed out?
But the documents lacked quality at a higher level,
like how do you connect up these three peripherals
to measure a pulse width?
Yeah, that's the thing.
That's the thing I've had a lot of trouble with,
is there's a lot of documentation about the guts of these things
and not a lot of app notes.
Sometimes.
And sometimes there are app notes and people don't read them.
Depends on the microcontroller.
Indeed.
Chris L. also fussed about the examples that STM and NXP had better examples, better sample code.
Sure. examples that STM and NXP had better examples, better sample code.
Even the name, searching for SAM or SAMD or SAME is just crazy.
Why couldn't they make better
abbreviations to distinguish the TC
and TCC peripherals?
This caused no end of confusion.
Yes, yes indeed.
So is this just a microchip
atmel rant?
It does seem to be a microchip rant.
Which is, you know, I always find these amusing.
Next person to send me a Rust rant that's opposed to Rust, they may get a prize.
What? You haven't encountered Rust in six months.
No, that's not true. Actually, someone, so class registration is open for August 20th.
And someone messaged the person in charge of answering question there, could they do their final project in Rust?
And so Jason had to message me and I had to say, maybe. I'm not going to say no,
but we're not going to help you with Rust. Yeah, sure.
So I have encountered Rust in like the last few days and I actually went out to make sure
that the board that we're recommending will support Rust. So it wasn't like I just said
maybe. I actually worked for that
maybe. Yeah. Rust is
fine. Rust is fine. It's fine.
Yeah.
So, I mean, microcontrollers are
bad. Various
companies that make them could do better.
The only problem now is you get
the chip that you can get, so you're going to
have to put up with a lot. Yes.
I'm not quite enjoying the chip I'm working get so you're gonna have to put up with a lot yes i'm not quite enjoying
the chip i'm working on which is from a different company you can go to past episodes to glean what
that is but um but yeah so it and i you know st stuff is is good but it's also it's also a lot
i mean the how's difficult to understand and has mistakes.
It's 97 layers deep because they try to cover all of their peripherals with the same interface, and they never take anything out.
And all these micros want you to use some weird app, weirdbutt IDE that they control.
And it's the only thing I can say about that.
He has a little thing about,
doesn't like the IDE.
That's the Atmel Studio?
You got to spend that 30% tools time
to come up with a setup
that doesn't depend on that stuff as best you can.
I mean, at least it was Atmel Studio
and not MPLAP.
All right, enough of this.
Okay.
Peter asked about
Code Composer Studio, which is TI's
IDE. Is it
any good? How does it compare with other IDEs?
Is it worth learning if you want to work with TI parts?
Are there hidden limitations
you'll discover later, like with the
Arduino IDE?
I have never used it, so go ahead.
The embedded compilers currently or recently on my laptop include
TI Code Composer, VS Code with Platformio, VS Code with STM32 and Cortex Debug,
VS Code with Nordic, VS Code with Cypress and Cortex Debug,
and P-Lab for PIX, STM32CubeMXIDE,
Arduino Processing, Atmel Studio 7.0, and PSoC Creator.
No wonder your fans are always running.
All of those are trying to update the background.
Yeah.
So how does it compare?
It's in Eclipse-based, so it's going to look a little bit like STM32 Cube MX.
IDE.
IDE.
And it's not terrible.
It's not great.
It's what you want to use if you're working with TI parts.
They have their environment, and if you play in it, it will be much easier than if you try to take it over to some other platform.
So I would definitely use CodeComposer if you are using TI.
I would not use CodeComposer if you're not using TI.
I don't even know how that would work.
But when we say Eclipse-based,
Eclipse was like
VS Code before VS Code existed
and much worse.
I was using Eclipse in 2004,
so it's
not new.
It's not new. It shows
its age. It's Java-based.
It was cool for the... It's not new. It shows its age. It's Java-based. It was cool for the...
It's cool because it was
kind of the first cross-platform IDE
that you could really do a lot in.
And then
the early days it was really slow because
it was Java-based and computers were
the horsepower of
what you've got on your watch now.
And so it was nice because it was open source
and people could build their proprietary IDs on top of them,
and a lot of people have done that, and it's mostly fine.
But since it is a little long in the tooth and Java-based
and a few other things, it tends to be kind of mediocre in a lot of ways.
It goes back to the STM32 how.
At some point, if you're trying to support everything,
you get to start seeing the crusty bits
because you're not doing a good job on anything.
You're doing a fine job.
You're just not doing a good job.
It's fine.
It's fine.
Oh, we got a nice email from somebody who says by training i'm a cs guy
but i've veered heavily into low speed scientific computing python on heavy metal yeah about as far
as i can imagine from being in the same field and away from what your topics and guests would be
but every single episode you or your guests somehow manage to say something
that cuts right to the core
of something I'm struggling with.
It gives me a new perspective I desperately needed.
So that was very nice.
Thank you for that.
Do you want to try this question about overlays?
Oh, sure.
I have no problem with that question.
You shouldn't either.
You've done this.
Well, let's read the question and then I can explain what I've done and what I haven't done.
Simon says, how do you write ARM Cortex-M projects that use overlays to dynamically allocate new sections of code at runtime?
Can you discuss that, please?
What does it mean?
Somebody else asked, what does it mean to dynamically allocate new code sections?
And the analogy here is how do you dynamically link.so files in Linux at runtime,
but for bare metal or RTOS projects on ARM Cortex-M?
I have been near this happening.
I can talk about the details of this. It's been years, right?
Yeah.
So at Fitbit, on the Fitbit watch, there are apps.
Third-party apps.
Third-party apps.
But there are also first-party apps that use the same mechanism.
And as you might expect, running arbitrary code on a Cortex-M requires something difficult because you need to load new stuff into somewhere, you need to pull it into RAM, you need to start it.
It's like on a desktop.
You have to move things into memory and start executing them.
And that has a lot of complexities associated with it that you may not think about.
So that's what we did at Fitbit.
We did exactly this.
We had dynamic linking
to pull in new code at runtime.
In this case, it was into RAM.
And what I'm going to say
is it's extremely difficult in advanced.
So if you're going to take on this project,
prepare to learn a lot, research a lot,
and fall down a lot because it's hard.
The key difficult, one of the key difficult things
is you need a dynamic linker running on the system.
And what a linker does,
you want to describe what a linker does?
I'm not going to do it well.
It links things.
It's like a...
Okay, so a linker takes your object files...
Which have your code in them and references to things.
Right, and so each object file says,
this is my code.
This is how you call my code.
These are the things I call. And the linker
tries to make sure that everything that someone calls ends up in the final code, final hex file.
And so that's why sometimes if you have a global variable or a function with a typo in it,
it's after the linker it says, I can't find this function.
And that's because until then,
the compiler believed that function existed somewhere.
Right, right.
It's just setting a reference to it.
Go find this.
Go connect these things later.
The linker connects all of the references.
And so what it's doing is it's taking an abstract reference
and based on the link map or some other knowledge,
it's taking those references in the code
and rewriting them to be specific things.
So if your code comes out and it says,
oh, read from this table,
the object code is going to have a reference to that table,
but the linker is going to say that table's at this address. And so most code you generate for
microcontrollers is what's called, is position, I don't want to say position dependent,
but it's the opposite of position independent. It puts defined memory things in the code.
So if you think about what it means to put code in at runtime,
the code at runtime may go somewhere random
or to a memory location that's different than when it was compiled.
And so it's going to have those references,
but they're going to point to different places. And if the code isn't structured right, if it hasn't been generated
right, you can't fix that. That has to be done at runtime, where you load the code in on your
microcontroller, it goes to RAM, and then another process or thread or piece of code looks through
and says, okay, here's these references, and I need to rewrite these. And so you have to generate position-independent code
that can be dynamically linked.
And that takes some steps in your tool setup.
And then you also have to write a dynamic linker
for your device
to handle that position-independent code
and fix up the references
so that they can match wherever it is in RAM.
It's funny how we can have the same career for 25 years.
Let's call it 25 years.
And yet have entirely different views of this.
Okay. My view comes from thinking about it as a,
if you want to have dynamic applications,
thinking about it.
Not necessarily dynamic,
not even necessarily applications,
just more abstract.
Like I want to,
I'm at a Ram,
but my system does one thing for half of its life and a different thing for half of its life.
It has two different applications.
Okay, fine.
I'm sticking with applications.
Fine, that's fine.
But it's what you say.
I have a device and I want it to be drastically different.
And I'm willing to take a little bit of time for that difference to be put into effect.
And it may just be a little bit of time for that difference to be put into effect. And it may just be a little bit of time, but...
Sure.
When I think about that, I think about bootloaders and what they run.
Because that is an example of two applications running on a device.
And you are going from one to the other, and you have a very limited pipe between them.
Yeah.
The bootloader knows where the application gets loaded to,
and at some point the bootloader jumps to the application, the application runs.
Sure.
So that's one way to do it.
But that's...
Wait.
Wait.
You can actually, if you have an application running and you want to run something different, you can go back to the bootloader and say, hey, bootloader, run the thing at this other address.
And so you can cycle through applications that way.
But we aren't really sharing anything yet, are we?
You wanted the dynamic linking. Right. Because otherwise, each of these
has to be their own program. I want to blow away
existing code and replace it with something completely different.
I mean, you could do that by having this whole
bootloader application thing where the application is in external flash
and when you say, hey bootloader, I'm the application is in external flash and when you say hey bootloader
i'm done running please run something else you say and that something else is in this address and
it gets loaded okay so but all of that is not sharing the library that you want to share right
which may be a graphics library it may be library, it may be all of these things. Going back to TI Code Composer, that is where I learned how to do most of the things that you
seem to be wanting to do with this dynamic allocation. I came across it many, many years ago
as part of their BIOS, which is what they're calling their operating system.
And it's very obvious in the way they do their BLE handling. So if you want to go look up
specific code on this, look at their BLE. And what they do is they take a list of functions,
specific functions that somebody else might want to use.
So let's say init display.
And you make a chart of those functions.
A chart, a list, a table of function pointers.
Yeah.
And you have a special thing, a special handler, so that when you want to call a NIT display, you actually say, I want to call a system call number three, which translates to a NIT display.
Oh, you did a system call interface. All right. I can call whatever I want if it's in that table. And that table can change.
If I do a table that has the number that I'm calling and the function table, then I can search
through it. But that's not usually a good idea because you don't want that to change.
You just have a list of functions and somewhere, some header knows the list order.
Now, when you compile something, you compile it assuming that that table is at a fixed address in memory.
Yeah. And I'm trying to go a step beyond that.
You are.
The other way to do it is to not have that list,
but to have that library in Flash and not allow its memory locations to change.
We're not allowing dynamic, really, at this point.
We're allowing the applications to change, but that library is fixed at a location.
Yeah.
That involves changing more of your project files.
Yeah. fixed at a location. That involves changing more of your project files.
The first way involves changing your linker file,
but after that, you need the system handling interface,
and then you're good to go.
Forcing your library to be at a location and for your linker to know what the functions are in that library,
usually that's an extra file or two.
But the point of all this is
code has to be where it's supposed to be.
Right.
You cannot change the location
of where the application code is
or any of the libraries.
It's just that you can swap those things out
and they are all compiled in the same way
for the same target addresses.
And so the linker is fine
putting in fixed addresses for the memory references.
Yeah. Okay.
Either you put in fixed addresses for the memory address,
you put in fixed addresses for the references for the linker.
Yeah.
Or you put in an abstraction layer
that hides those functions.
And your abstraction layer is basically a dynamic linker.
Exactly. It's running at dynamic linker. Exactly.
It's running at runtime.
Yes.
Yeah.
No, okay.
That makes sense.
That's a better halfway.
Depending on the application,
that's a better halfway measure than going all the way,
which is difficult.
Well, like I said,
I saw it at TI so much that I just kind of got used to it.
And once I got over my fear of function pointers,
things become much easier.
I did find there is a little project on GitHub that I found,
and I don't know how good it is,
but it kind of describes the problems
with going all the way to dynamic linking.
And they were doing it for kind of big reasons,
like, oh, I want to run Lua or Python or JavaScript
and have a loader that can run,
or getting around LGPL licensing terms,
because you can dynamically link things.
Anyway, so I have a link to that,
and people can look at that and see what they think of it.
I do not endorse it.
I have not looked at it in great detail,
but it is something that other people have been thinking about.
Okay, what's next?
There's one about Android and aircrafts.
What? Why would you have Android on an aircraft?
Is that like the urinal again?
Was that on an airplane?
No, I hope not.
Okay.
I don't think so.
Peter asked about airplane entertainment systems that run Linux or Android,
how they're kept up to date across a fleet of globally distributed hardware
when the kernel exits the support window.
Who adapts all of the plane-specific modifications to the new kernel or backport security updates?
I have an answer.
I have an answer.
I have an answer.
And this answer is based on no knowledge.
So I could be very wrong.
But I think, I think the answer is no one. think, I think the answer is no one.
Yes, I think the answer is no one.
I don't think those are things that happen.
How do you make sure the planes get the updates?
You don't.
I agree.
I think they're crusty.
The worst code you can imagine running on the entertainment system.
And the way it gets replaced is when a new contract is signed with the airline
and they get a new entertainment system with the new Linux kernel.
Well, this was followed up with Lurian who said,
I'm curious to know if anyone has ever been on a flight
where the entertainment system was the same as the previous flight.
Okay, I have to admit, wait, wait, I have to admit,
I have never been on a flight with an entertainment system.
Because you stopped flying before that happened.
I stopped flying a long time ago.
So, I've never actually seen one of these.
So, I can only speculate.
Larian said that in their expectation, even with the same airline and the same class of plane, it's a completely different system.
Yes.
Which I thought really answered Peter's question.
The only way they're updated is when they're physically updated.
It's when they have no choice but to replace the entire seat.
Yes.
Yeah, yeah.
No, and I think, you know, it's the same way with cars, right?
Like, when do you update your before, you know, super modern cars that were running all this stuff, you know, when was your stereo head updated? Never.
Yeah.
That is not a thing that they spend a lot of time thinking about, I think, unless there's a major problem.
And hopefully, hopefully they're divorced from the rest of the plane system sufficiently, so that's not a problem.
But anyway, no one.
Yes.
Who's in charge of that?
No.
All right.
I think that's about it.
I may have some new clients soon.
You did it again?
Yeah.
But I am taking the summer off from teaching.
So you can work more for other clients.
That wasn't what I meant to do.
I refer you to our previous show where we discussed this.
Yes, Saturdays will be mine once again.
I'm so looking forward to it.
Clasper asked, we did a retrospective for me to get advice,
but then Clasper asked me for information about what they had done, about the whole development of the course process.
And one of the questions was, in an effort for them to be able to recruit other authors, what did I get out of the class?
And I didn't know how to answer. Like, why was it,
why was it good that it was a cohort in my opinion, for me? And the thing was, I started
thinking about it, like all of the students who have been in the cohorts and participated,
I feel about them like I do about the people that I managed at one point in my career.
I'm interested.
I want to keep in touch.
I want to make sure they do well.
They're just like, I want to protect them.
It really, this cohort thing totally engaged the managerial protect them, make them do well, mentor forever part of me.
And I did not expect the mama bear to come out.
That's cool.
If you are interested in attending the class, it's starting around August 20th.
Your company should pay for it.
Definitely, definitely.
And if you have 20 people at your company
who want to take it,
call Classpert.
They would love to hear from you.
Sign up for our newsletter.
Oh, right.
That will come up next week.
So we're going to run a contest
that has something to do with the newsletter that will be giving away three items.
So probably one per social media channel?
Yeah, sure.
And then we'll do something that says if you're on the newsletter, we'll randomly choose your email address and ask you if you want prizes.
Yep, yep.
So we're not penalizing people who are already on the newsletter list.
So it's not like you should exit and reenter.
It's anybody who's already there at some point.
Yes.
The end of July, mid-July.
We'll figure that out.
We'll figure that out.
All right.
All right.
I think that's it.
Yes.
Shall we have a little bit of poo time?
Wait, that goes back to the beginning.
Come on, it was hilarious.
How was I not going to?
It's fine.
It's fine.
Let's just, thank you for, you didn't do your thank yous.
I wasn't.
I was going to see if you did it.
I'm not going to do it.
I don't know the rant.
Thank you for listening.
Thank you to our Patreon supporters, subpoenas, for giving us money.
And questions.
And questions.
Thank you to our Slackimals for giving us questions.
Thank you to me for editing
this and hopefully not screwing it up this week.
And thank you
for being patient with the edit
last week. And thank
you to Bear for not
coughing through the show.
Bear's our dog. Thank you to
Newark for sponsoring this week's show.
We appreciate it greatly.
Greatly? Greatly.
And did I miss anything?
If you'd like to contact
the show... If you'd like to contact us or
the show, you can't contact the show. It won't respond
to you. If you'd like to contact us,
you can email us at show at embedded.fm
or you could hit the
contact link on
embedded.fm, which just sends us
an email. It'll show at embedded.fm. which just sends us an email, show it embedded.fm.
But anyway,
you can also reach us on Twitter at embedded.fm.
You can reach us on Instagram at embedded podcast.
You can reach us through the phone lines by dialing randomly until you
managed to get my cell phone number.
Facebook, LinkedIn.
You could send a snail mail, but we never check the PO box. So don't do that. Yeah. Yeah. But,
but yeah, and you can, you can, you can, you can check things out. You can check all sorts
of things out. I encourage you to do so. We'll have a link to
where you can send it for the newsletter in the show notes. It's also on the website.
And now we need Pooh. Let's see. They had decided to catch a half lump.
Piglet, I have decided something. What have you decided, Pooh? I have decided to catch a half a
lump. Pooh nodded his
head several times as he said this and waited for Piglet to say, how? Or, Pooh, you couldn't.
Or something helpful of that sort. But Piglet said nothing. The fact was, Piglet was wishing
that he had thought about it first. I shall do it, said Pooh, after waiting a little longer, by means of a trap. It must be a cunning trap,
so you will have to help me, Piglet. Pooh, said Piglet, feeling quite happy again now. I will.
And then he said, how shall we do it? And Pooh said, that's just it. How? And then they sat
down together to think it out. Pooh's first idea was that they should dig a very deep pit.
And then the heffalump would come along and fall in the pit and...
Why? said Piglet.
Why what? said Pooh.
Why would it fall in?
Pooh rubbed his nose with his paw and said that the heffalump might be walking along,
humming a little song and looking up
at the sky wondering if it would rain and he wouldn't see the very deep pit until he was
halfway down when it would be too late piglet said this was a very good trap but supposing it
was raining already poo rubbed his nose again and said he hadn't thought of that and then he
brightened up and said if it were raining already the heffalump would be looking at the sky wondering if it would clear up. And so he wouldn't see the
very deep pit until he was halfway down when it would be too late. Piglet said, now that this
point had been explained, he thought it was a very cunning trap. Pooh was very proud when he heard
this and he felt that the Heffalump would be just as good as caught already. But there was one thing
which had to be thought about and it was this,
where should they dig the very deep pit?