Skip to content
PodSubs
ShowsPeopleGuestsJobsNewsEvents
More
BlogPodCred
Menu
ShowsPeopleGuestsJobsNewsEventsBlogPodCredNetworksSign in
Join nowSign in
  • Shows
  • People
  • Jobs
  • News
  • More
    • Guests
    • Events
    • Blog
    • PodCred
    • Networks
    Join nowSign in

The Embedded Frontier

The Embedded Frontier artwork

#029 - How to Write Fast RTOS Code

Nov 19, 202635 minAudio
ShareXLinkedInFacebookWhatsAppEmail

Jacob Beningo talks with RTOS pioneer Bill Lamie, creator of Nucleus, ThreadX, and PX5 RTOS, about how to write efficient, high-performance real-time code. They cover POSIX pthreads, keeping software simple, RTOS benchmarking, test-driven development, using AI as a development teammate, and practical tips for structuring RTOS applications. Key Takeaways: • Keep it simple: complexity is the biggest enemy of embedded software, and a complex solution is probably not the right one. • Minimize nested function calls in critical paths, since pushing and popping registers and return addresses is expensive. • Design for performance from the start. Every comparison and data reference matters in the real-time path, and performance can't be bolted on at the end. • Use an error-checking veneer selectively. Enable it for new or untrusted code and call the direct API for proven code to save cycles. • Standardizing on the POSIX pthreads API makes it easier to share code between Linux and RTOS-based products and to move between RTOSes. • Write documentation before code to keep your design flexible and expose interfaces that are hard to explain. • Adopt test-driven development by writing test cases before the code. This keeps you from writing unreachable paths and makes coverage targets such as 100% statement and branch coverage achievable. • Treat AI as a teammate, not a replacement. It excels at tedious tasks like proofreading, QA, concurrency review, and quick hardware lookups, but it isn't reliable for pure code generation. • Put as many threads as possible at the same priority and use higher priorities only when preemption is absolutely necessary. • Use a minimalist number of threads and system objects to reduce accidental RTOS overhead. Links: • PX5 RTOS • Bill Lamie on LinkedIn • 2026 RTOS Performance Report • Eclipse ThreadX • Why RTOS Functional Safety Certification Matters • RTOS Best Practices Course

Audio and video play straight from the show's own hosting. PodSubs stores and serves no media.

Transcript

From the show. Tap a time to play from there.

Jacob BeningoAll right, in today's episode, we have Bill Lamie here with us to talk about real-time operating systems and how to write efficient code in the kernel and also as part of your RTOS application. So, Bill, how's everything going with you today?

Bill LamieOh, good. Thanks for having me, Jacob.

Jacob BeningoYeah, absolutely. I appreciate you joining us. And for all of those of you listening who are joining us, you don't know this, but this is actually our take two. The first version of this a couple of weeks ago didn't work. So this time we're crossing our fingers that you'll all get to enjoy this conversation. So kind of a fun little thing there. But in any event, Bill, just in case there are listeners who aren't aware of your work, do you want to give maybe a minute introduction, kind of talk a little bit, you know, give a little bit of a background about what you've been doing? I know you have invented and worked on many RTOSs in the past. So why don't you give us a little bit of a history there for our listeners?

Bill LamieYeah. So we have an hour for this, Jacob? Or how long for my history? Because it goes way back.

Jacob BeningoTake what you need. But I think, yeah, the good summary pieces will definitely give everybody kind of the idea.

Bill LamieSure, sure, sure. So I started off as a college student. I was in my senior year at San Diego State. And I walked by the bulletin board and I just, you know, and this is a real bulletin board physical, you know, with actual, You know, push pins, you know, you know, putting three by five index cards up there. And on one of the cards, there was this, this little state, this little job offering that said part-time programmer wanted 10 hours a week, $7 an hour. So I go and a phone number. So I called it And it happened to be a company building an operating system for a U. S. Navy ship, the LHD class amphibious warfare ship.

Bill LamieAnyway, and so that's, that's basically how I got into operating systems. At a very early age, I ended up taking a full-time job with that company after school. And then later, you know, many years later, I morphed into my first real-time operating system called Nucleus. And that was back in the 1990 timeframe. And then in around 1997, I introduced another operating system called ThreadX with Express Logic. And I've been doing that for many years.

Bill Lamie2019, Microsoft bought Express Logic, you know, and took all of us in, and we worked there for a period of time. I left after about three years and started another operating system called PX5 RTOS with a, with kind of a different philosophy of embracing open API standards, the POSIX PThread standard in particular, thinking that the RTOS world was just crazy with all the different RTOS APIs. So that's kind of, you know, you know, where I came from and, you know, where we are today.

Jacob BeningoExcellent. Yeah, I appreciate that background. And I know it's definitely, definitely diverse. We've had a lot of RTOS experiences. Where, where do you kind of see the RTOS industry right now today? You've mentioned that that there's lots of APIs that different RTOSs are using and POSIX as a way to standardize. What do you see over the next couple of years? Where do you see all of this going? Do you see it going? Well, where do you see it going? I won't lead you.

Bill LamieYeah, yeah. Well, I mean, you know, the kind of the reason why, you know, I thought I could add value by doing yet another RTOS was, you know, seeing how fragmented it was in terms of APIs. A hundred different RTOSes with a hundred different APIs out there is just insanity. You know, each one of these things, you know, you have to learn. You never really, you know, master one because, you know, you move over to another platform is completely different. And then today, the reality is embedded Linux for really higher end MPUs in the embedded space.

Bill LamieEmbedded Linux is the standard. So, you know, and that embedded Linux has the POSIX PThread API in it. So my idea is try to, you know, push towards unification on the RTOS side for the POSIX PThread API. And I kind of hope I push the other RTOSes that way, too. You know, I think that that's that's the way we all, you know, we all need to be going, you know, and hopefully we can make it a lot easier for developers. Right now, there's just too much complexity all the way around from development tools, RTOS. Everything is just too complex today.

Bill LamieAnd I'm hoping that maybe with the, you know, standard RTOS API, you know, we can make a difference there.

Jacob BeningoOh, absolutely. I mean, I've even seen in the industry where I've had customers who, you know, they're building platforms or multiple multiple product lines, right, or a product line based on one platform. And some of their products, they want to be Linux based, and then others are microcontroller based. And they go, well, how do we, reuse our code from one to the next when the underlying operating system is completely different, right? And POSIX is, I know, one of the ways that people try to look at a way to manage that. And certainly, I've seen customers as well who have, you know, tried to move from one RTOS to the next.

Jacob BeningoAnd that doesn't always go smoothly, right?

Bill LamieYeah, the priorities are different. You know, one is the highest on one, one is the lowest on the other. I mean, it's a mess. And so that's exactly what we want to do, too. We want to make it so, you know, developers that have a Linux based solution and an RTOS based solution, they can share code. You know, that's one of the ultimate goals of PX5 RTOS and kind of what we're doing.

Jacob BeningoExcellent. Very cool. Now, I know with your experience working with real-time operating systems, and just general embedded systems industry experience, what are some of the design lessons that you've learned over the course of your career so far?

Bill LamieYeah, I mean, it goes back to, well, I should back up maybe. One of my advantages is that I'm very average. And so not too smart. And not too smart means that you really are sensitive to complexity. And that's really what kills, you know, all software, but especially embedded systems. The complexity, you know, if you create complex software, likely that complex software is going to run pretty slow. And you might not even know how it's running, you know, in some situations.

Bill LamieSo I think, you know, the biggest thing, and it's, you know, all of us know this is keep it simple, stupid. So, you know, that's really, I can't say that more. If the solution is complex, it's probably not the right solution.

Jacob BeningoYeah, absolutely. Complexity is definitely I think an evil to a lot of designers, developers and architects. I actually keep a list of what I consider to be my seven modern embedded software principles. And number three on the list is kiss the software, which is keep it simple, silly or keep it simple, stupid, which however you want to substitute it. But it's one of those things, it's literally posted right here. You can't see it. But every day when I go to write code, I go, all right, what are my principles? I'm making sure I'm following. And that one is, like I said, it's in the top seven, top three.

Jacob BeningoSo excellent. So keeping it simple. Some other thoughts on things that you've learned that developers, even, you know, teams working with real-time operating systems might want to keep in mind?

Bill LamieYeah, the, you know, so, so keep it simple. But, you know, in practical terms, you know, there's other things too, like function calls kill. So, you know, if you have, you know, the more nested function calls you have, you know, each one of those eats up tons of performance, you know, pushing, pushing registers on the stack, return address on the stack, doing all that stuff, and then popping it back off. That whole operation is really, is really, you know, expensive in terms of performance. So keeping, you know, keeping your function call nesting and the number of function calls down to a minimum is good too. So not, not highly nested calls.

Bill LamieOn, on the RTOS side, you know, we do all sorts of different things to try to improve performance. You know, one of the things that we do is, is we have an error checking veneer and the real implementation. So in cases where, you know, the application is new or you're using, you know, less reliable code, you can, you can call on a, on a per function call basis, you can use the error checking veneer. If you don't, you can go right to the direct, you know, API implementation with less error checking.

Bill LamieSo, you know, that gives you the ability to get rid of some of the stuff that's, you know, unnecessary when you've proven the software out at the top level in terms of the application code. And yet still on a function, on a per, per function or per file basis, you can turn on error checking where it's needed. So that's one thing that's good. The other thing that we do that's unique is that we put all of the global RTOS data in one type def. And so that way, when we instantiate that, it's one single C structure. And the code generation for that, then after you, you know, access at one time, 32 bit address has been built for that structure, then all other accesses are then register relative.

Bill LamieSo you, you eliminate a whole, you know, two instructions per global variable access by doing that little trick. And that's something that we have a patent on for px5 RTOS. So, so we, you know, we do little things like that, but it's really, it's, you have to have performance in mind, you know, when you go into it, it's not something that you try to, you know, optimize, you know, at the backend, you really need to be thinking about, hey, this is my critical path, my real time path. And, you know, what am I doing here? Because every single comparison matters, every single data reference matters. And you really have to have that mindset when you're, when you're writing the code from the first place.

Bill LamieNow, luckily for me, I've done this three times. So, you know, you know, I, I kind of, I kind of know what I need to do performance wise on the RTOS. And, and that kind of shows up in your reports as well.

Jacob BeningoYeah. Yep. Yep. Absolutely. And, and, and for those of you, maybe that aren't familiar, uh, over the last several years, I've done several real-time operating system reports, um, where I basically done benchmarking across several different RTOSs. The last one was published, um, in the summer of 2026. Um, it had eight different RTOSs and px5 was one of them. Um, and, you know, not to, you know, um, uh, you know, I guess, toot your horn or anything like that, but, um, px5 was the fastest in all the different categories I checked. And part of that is because of the processes and the way that you think about, um, designing your kernels. Um, so, which is very impressive.

Jacob BeningoIt's always, you know, it's even compared to ThreadX, which you wrote, which is now, you know, open source, px5 still beats that even, uh, in each of the categories, which is quite, um, you know, it shows that experience pays to some degree, but also paying attention to close, you know, small details can make a huge difference.

Bill LamieYeah. Well, and I can't thank you enough for doing those reports because, you know, otherwise you're, you're just basically another RTOS vendor saying, Hey, RTOS is faster, you know, and no one really knows and customers that care, you know, they have to build their own benchmarks and do the testing themselves, which is real cumbersome. But, uh, your report, at least, you know, put something out there that's general and independent. And, uh, so that's a, that's a real big help for us. Appreciate that.

Jacob BeningoOh yeah, absolutely. Yeah. I think doing benchmarking like that is kind of interesting because the whole industry then, you know, everyone has to pick an RTOS. They need to understand performance. And while I'm not, it's not, the report doesn't, you know, push anybody in any different directions. It kind of does give the, you know, here's the, here's the, the process that we use to actually check the performance. Here's how we're here's the configuration settings we use. Here's the boards that we use. You can go verify it yourself, but you can also use the numbers that I found from running those benchmarks to help create a, uh, an informed decision when you do have to make those choices.

Jacob BeningoSo it should help speed up that process, but it's, it's hard to, um, you know, everybody says, Hey, ours is the, ours is the best. Right. And then you go, okay, well, how does that actually work out? You know, and when you just looking at the open source RTOS is, um, you can see there was a huge difference in, in, in the performance and everything. And they said, even amongst ThreadX and PX5, um, so far and some, you know, hopefully further commercial ones in the future, we can see that there's a big difference. So.

Bill LamieYeah. Now, the only thing sad for us, Jacob, is that, um, you know, once again, I'm helping other RTOS get better because, you know, they just see those numbers and they go, Oh God, you know, we're dreadful. And they, you know, they, so they creep up, you know, every report. So it's a, it is a little bit unfortunate, but, uh, throughout my career, uh, you know, I, I've, I've done things that have kind of, you know, I guess made things better for everyone by, by helping make some of the other RTOS is better as well.

Jacob BeningoYep, absolutely. So, and it, it definitely, I know it impacts the way people think. Cause, um, you know, as, as an example, we saw that, um, you know, Zephyr improved quite a bit between the 2024 report and the 2026, cause they saw where they stood and they said, Hey, you know what, we need to be measuring performance. And that kind of, you know, allowed them to get above, um, you know, FreeRTOS also, you know, above FreeRTOS, but, um, yeah, still, still slower in areas compared to, you know, a commercial RTOS. Let me put it that way. So.

Bill LamieAnd then FreeRTOS had that scheduler, um, undeterministic feature, I'll call it.

Jacob BeningoYeah.

Bill LamieAnd they have, they've had that for years. Um, and it wasn't until the report came out where they said, Hey, maybe we should do something about that. But that was in there, you know, from the beginning.

Jacob BeningoYep. Yep. It's been in there for a very long time. And it was, yeah, it was just over this, uh, sometime in the last two years that they fixed that. Cause the first 2024 report showed that that was still a deterministic problem with their cooperative scheduler. And then this last test over the summer, I was like, Oh, they, they fixed it. So, uh, and I'm still looking, I haven't got a thank you note from Zephyr or a thank you note from free art. How's that?

Bill LamieYeah, exactly.

Jacob BeningoSo, so the, the, the competition will keep on creeping, which I think overall makes it so that everybody, I think everybody starts to realize they need to be looking at how these things perform and it starts moving the general quality of the industry forward. Right. And so it becomes a, uh, you know, you're encouraging everybody else to pay close attention to, you know, yeah, we have very powerful processors today, but that doesn't mean we should be wasting cycles still. There's still a lot of resource constrained devices out there, um, that, that really do care about performance.

Bill LamieYeah. Well, and just about every application can use the extra cycles for something. So, you know, no matter what it is, you know, if you're wasting it in the RTOS, you're taking it away from the application and, and that's a bad thing. Um, yeah, so.

Jacob BeningoOh, absolutely. Which is, um, uh, I think quite interesting. So, um, so while you, you know, kind of speaking about performance, you know, performance and how, you know, how, how developers make decisions, what are some of the, what are some of the trade-offs that you see that you have to make when you're trying to balance features, uh, versus safety, portability, performance, uh, and those types of things with, um, you know, with an RTOS or even applying to an RTOS based application?

Bill LamieWell, for us, you know, we have to compete against free. So that puts us in a position where we really have to do our job well. So, you know, performance is one of the things, um, but, you know, you go back to complexity, you know, creating something that's simple enough for people to understand and actually know what they're putting in their product. Uh, you know, you look at some of the, like, if you look at Zephyr, for instance, it's a, it's a monster, you know, the complexity is off the, off the charts, uh, probably the most complex, you know, RTOS in existence ever.

Bill LamieUh, and, you know, from my perspective, that's terrible. I think that's one of the worst things in the world, but, uh, but that's out there. So we, we compete, um, you know, in performance, we also completing complexity. We also compete in, uh, you know, the API, as we mentioned before, you know, standardizing on, uh, on a native implementation of, of the POSIX pthread API makes life easier for everyone. Um, now, some of the, some of the guys, you know, they've done that sort of like Zephyr has a, has a layer for POSIX, uh, ThreadX has a layer for POSIX, uh, and there's a handful of others that do as well, but now you just doubled the API overhead.

Bill LamieSo, um, you know, so you're, you're, you're paying the price for that. And also a lot of those things, since they're kind of afterthought additions, they're not very good in quality. Um, and then, you know, we have, you mentioned functional safety. That's another area that we specialize in, um, IEC 61508 SIL 4, ISO 26262 ASIL D, automotive, medical class C, um, and, you know, even for applications that don't need, you know, the functional safety certification, it's the same source code.

Bill LamieSo you get all the benefits of the rigor that we have to go through to get that functional safety certification, you get it everywhere. So, um, you know, that just goes to quality and, and reliability. Um, but then you have things like documentation. I mean, uh, you know, one of the things that, um, that we had always done, I started doing this from nucleus time period, uh, is writing the documentation before the code. So you're not locked into, you know, any particular, you know, once you have the code base, you know, you're kind of work the documentation around the code.

Bill LamieYou go, well, I, I've already laid the code, so I need to make the documentation say what that does. But when you do it the other way around, when you write the document first, you have a lot of flexibility in the code because it isn't written yet. Uh, and so, and, and you also get a good proof point. You can say, Hey, um, this is really hard to explain, probably not the right way to do it. And so you, you can rework your design a little bit too, if you, if you focus on, on that. So, so we put a lot of effort into the ease of use, the documentation, as well as the technical features like performance and size and, and all of those goodies, uh, good things that people look for, uh, in their design.

Jacob BeningoPerfect. No, I think that's, I think that's fantastic. I think it's a very interesting way to do it too, because there's a lot of teams that I see that they don't take the time up front to kind of do a little bit of their, their documentation, right. And they go straight into coding and it really does lock them in. And then once you start writing code, you're not going back to rewrite it. Despite all the times I hear a team say, Oh, well, we're just getting this out the door. We'll go back and fix it after we deliver this time. And what happens is, is the next fire comes up and that code ends up living there, you know, for a decade or more.

Jacob BeningoAnd so a little bit of extra time up front to define those interfaces and think about how, um, you know, how developers, how users interact with things, I think makes a huge difference, uh, in the development cycle.

Bill LamieSo another thing that we did, Oh, sorry, sorry, sorry, I was done.

Jacob BeningoGo ahead.

Bill LamieOkay. Another thing that we did with a PX5 is we used a test driven development. So we, we wrote the test cases before the code too. So, um, and that was the first time we didn't do that before with Nucleus or I didn't do that before with Nucleus or, um, or any of the other RTOSs in the past. Uh, and that was good. That was a real, that was a, a real good experience. Uh, because, you know, much like the code, you know, the test cases will, you know, show you things as well.

Jacob BeningoOh, absolutely. So how was your, uh, how was your initial experience? Did you find you had to change the way you thought about programming or did you find that because you already wrote the documentation first that adopting TDD was a pretty natural process for you?

Bill LamieWell, those went kind of in parallel. So the, the documentation would, would be happening in parallel with the test cases. So, so we, and then we'd write the code, uh, you know, and, and it was, it was pretty natural, you know, but I have to say that, you know, I kind of, you know, I had written a lot of test code before. So, you know, especially RTOS test code. So, uh, you know, that wasn't new for me, you know, it was a completely new application. It might've been a little bit more of a challenge, I think, but, uh, but since I knew what the test harness would look like, you know, for an RTOS, you know, ahead of time, I think it was, it was all pretty natural.

Bill LamieBut it was worth, you know, because a lot of, you know, one of the worst things is, you know, laying a bunch of code out and, and then doing the test as an afterthought. Um, and, you know, God, that's, uh, you know, that's terrible. And also it's hard, you know, you have to keep in mind that you have, you know, you have to satisfy your test case too, when you're writing the code, because if you write a whole bunch of unreachable paths in your code, you're never going to get there with your test case. So it makes you conscious of, you know, Hey, can I verify that this works as you're writing the code? And that's not something that a lot of engineers do, I think.

Jacob BeningoYeah, no, I agree. I've seen a lot of teams that really struggle to adopt test driven development. And that's why I was kind of curious about your experience adopting it. Cause I know even myself, um, I probably first came across it 15 years ago. And one of James Grenning's, um, talks at like the embedded systems conference. And I remember trying it and just being like, this is so weird. Like, I can't, I'm no, no, thank you. And then several years later, I'm like, I really should give this a better chance. And then I started doing it. I was just like, wow. Like, why was this so hard for me before?

Jacob BeningoAnd then now it's like, if I ever go and write code without writing a test first, it's like, this doesn't feel right. Like I want to write my tests. And usually that's like throwaway code, but even writing some throwaway code, it's like, oh, I shouldn't have a test here. Right. So.

Bill LamieYeah. Well, we have the other problem too, where we can't ship unless we have 100% statement and 100% branch decision coverage testing. So, so, you know, the test code is like kind of, you know, a deliverable. So, you know, you know, starting that off, you know, as early as possible, you know, and, and before the code is a, is a real good thing for us, you know, just because of what our deliverables are really.

Jacob BeningoOkay. Excellent. And I think, you know, from, from that, I think there's probably a lot of other teams that could adopt that type of thinking. I, I, you know, people are working on functional safety or, you know, robust applications, medical mission critical, even if it's not a certifiable product. I mean, I think there's a huge advantage there. If you're not already doing that, adopt a technique like this. So I think it makes a huge difference. It'll save you tons of time in the end, you know, you know, it's a little bit more work up front, but you know, just like anything else, you know, that, that does save you in the backend.

Bill LamieYep. Absolutely.

Jacob BeningoSo I know we've been talking about some, some different practices and processes that you use that have helped produce a very good, robust, fast, efficient kernel. A lot of folks today are starting to leverage artificial intelligence. Where do you see artificial intelligence kind of fitting in with RTOSes? And even in your own development cycle, is this a, a no, no, you can't ever do it or, or where have you been finding maybe some benefits, um, that other developers could find as well?

Bill LamieOh, I look at AI or we look at AI as a, as a teammate, you know, so, I mean, not to use Microsoft's Copilot trademark, you know, I don't want to get in trouble with my old company. Um, but, uh, but it's like that, you know, I, I, I have a right alongside of me. Um, and we use it for, you know, QA, you know, I mean, it goes through all of our user guides, all of our documentation. Uh, we use it to go through the code base, you know, as part of our release cycle. Um, and it's really, it's really good. Um, and it's especially good at, at things that humans find tedious.

Bill LamieSo when you go through, like as my, as my years of develop and development, I've gone, uh, you know, going through a user guide, for instance, you know, proofreading the user guide, you know, a human like myself, I go through 10 pages and I get kind of sleepy, you know, so it never gets sleepy, you know, it, it continues and cranks along and it can find the silliest little typos and things that would be, that would live in a user guide typically forever. Uh, so, uh, so it's really great at the, the tedious tasks. Um, and it also, you know, the new models, um, as opposed to maybe a couple of years ago, the new models understand concurrency, um, which is a real nice feature when you're in the, in the RTOS space, because, you know, basically everything we do is, is like a multitasking trick.

Bill LamieUh, so it involves concurrency and having, you know, having a, an automated, you know, function that can understand that, uh, and understand your code doing that is, is really remarkable. So we use it, we use it all the time. Uh, now we don't use it for pure code generation. Um, and, and I do, you know, even the latest models, even the, the very best of the best models, um, when it, when it makes suggestions, it gets some things right. And sometimes it comes up with surprising suggestions that you go are pretty good, but it also misses things. So it's not, you know, it's not foolproof. It's not, it's not better.

Bill LamieIt's an assist rather than a replacement, at least, at least right now. And hopefully it'll stay that way for a little while.

Jacob BeningoOh, absolutely. Yeah. I, I tend to look at it as it's a, it's a tool and that, you know, developers should experiment with where that tool works best in their development cycle. Right. But, you know, I've, I've talked to some managers who like the idea of, you know, push a button on some requirements and out pops a widget. Um, but I honestly, I, I find that to be, I mean, there's, I think there's a risk there, but I also think that's not very fun. Right. As engineers, you know, yeah, we can elevate ourselves to systems level thinking, but sometimes the fun is in, you know, where, where code meets hardware and, you know, getting all those interfaces to work properly.

Jacob BeningoSo, um, so I'm kind of with you, hopefully we don't get to that point where it's all just, you know, push the magic easy button and, uh, our, our, our work is done, but, um, yeah, I hope we're a long ways off from that.

Bill LamieYeah. It's, it is a great tool though. I really, and even like, you know, what, what's really cool is like, okay, exactly what bit in the CPSR is that you just type it in instantly. You don't have to go back to your, uh, you know, hard copy, you know, user guide, find the right page, you know, it's so fast. So, you know, just looking up information, aggregating information online, uh, you know, AI is just wonderful for that.

Jacob BeningoYeah, absolutely. I completely agree. So, so there, there's some additional ideas on how to use AI. I really appreciate that.

Bill LamieUm, maybe just, uh, Oh, sorry. We also do it on our, on the front end of our website. We have a little AI assistant for, you know, just, you know, helping customers find information. So we use it that way too. But, uh, you know, my, my daily activity is kind of working hand in hand with Claude.

Jacob BeningoAwesome. That's fantastic. And I, I found like, yeah, for development, Claude tends to be the, the one that I gravitate to as well. I've tried several of the others and that's the one I always keep being drawn back to, uh, which I think is a pretty good thing. So, um, maybe, maybe what we could do here toward, uh, you know, before we close things out, um, do you maybe have a couple of best practices that you could share with folks who are going to use, who are writing an application, uh, and are using an RTOS?

Jacob BeningoDo you have any tips or tricks that you've seen over the years that can help them architect their code, make sure that it's efficient, that it leverages the RTOS properly, things like that?

Bill LamieWell, the, the biggest thing in the RTOS world is, um, accidental overhead. So, and it's easy to generate, you know, if you're an application developer and I actually, I've been guilty of this in, in my early life as well, where, um, you look at a, you look at a set of, of tasks that you have to do, um, and you assign priorities and you sprinkle them out like, like a little, uh, you know, toppings on ice cream or something, right? Oh, this one's a little more important. I'll give it a higher priority. This one's a, that's bad.

Bill LamieUm, you know, using priorities, you should only use a priority that's higher when you absolutely want that thing to preempt the other stuff. So, you know, the goal, you know, for an application using an RTOS should be to have as many threads or tasks at the same priority as possible and only have higher priorities when it's absolutely 100% necessary. Um, that's, that's where I see most, most companies or most developers go astray in terms of the RTOS world where they, they just, you know, oh, this is more important. So it'll be a higher priority.

Bill LamieWell, no, don't do that unless you absolutely have to. So that's my, that's my number one, you know, advice to anyone using an RTOS. Um, and then, you know, maybe, you know, maybe trying to be, you know, savvy about the sheer number of, of system objects, you know, threads, you know, uh, a minimalist approach, uh, and again, reducing complexity at the end of the day, um, you know, that's, that's gonna, you know, save time, you know, keep more of your hair is not gray or, and in place, you know, so, you know, those are the, those are the big things, you know, when using an RTOS.

Jacob BeningoPerfect. That's, that's fantastic advice. And I know I've seen, I've seen the same thing where, um, you know, people have had, I've seen a hundred different threads in their application and it's like, my goodness, like, why do you have so many threads or so many semaphores or, you know, sometimes it feels weird. It's like, you got this powerful RTOS. It's like, yeah, I just, you know, I have three threads, you know, and that's, or five threads. Right. And it's, but that's enough to get the job done. Right. Kind of that minimal, minimalist approach. So, um, awesome. Fantastic. Well, I really appreciate you taking the time to, to chat real-time operating systems with us and share your experience and knowledge.

Jacob BeningoUm, is there anything, um, I guess, any final thoughts or advice that you want to share with the audience before we, uh, close, close things out?

Bill LamieWell, other than, you know, I commiserate with the audience in terms of how complex things are today. Um, you know, outside of my grief with Zephyr, um, you know, the development systems, the development tools from the semiconductor companies are also way so complex and they shouldn't be like, for instance, a typical, if I'm trying to do something on a, on a particular board, two thirds of my time is generally spent dealing with the tools or dealing with the BSP, you know, rather than the one third of my actual work.

Bill LamieAnd, and I imagine that's true for, you know, developers too, especially just starting out on a new platform. And so, you know, gosh, I wish the industry could do a little bit better, you know, the semi, especially the semis, the semi development tools and their, um, and their SDKs are, are just way too complex and, and kind of out of control. And it gets even worse when you, when you start adding in, you know, there's 10 cores in this new chip and, you know, I mean, you know, what, what was crazy complicated for a single core is now that much more.

Bill LamieSo it's growing exponentially complicated. Uh, and so I wish that, I wish that the industry could move a little bit forward and, and making things easier for developers because it's just, it's just crazy. That's my rant. That's my rant for today.

Jacob BeningoYep. Yeah. I think, yeah, it's definitely the complexity there. And I think it's the trying to provide, you know, support for so many things in, in one, you know, for one, you know, one chip, right. It's, it just makes it so that they just keep throwing another box in their library, another, this, and all we got configure for that. And too many use cases, right. Per, per solution, I guess you could say, but.

Bill LamieWell, and it's hard too, because you know, the, the semis are, they're hardware companies, you know, they're hardware people. And so, but yet, you know, they're, they're hugely important for software development, but they're not the right people for that. You know, so, so it's kind of the, the wrong people in charge. Now there's really good companies like IAR that are specialized in development tools, but you know, they're not free, you know, so customers have to go out there and license that, but the God, the free stuff is, you know, just kills me every day.

Jacob BeningoOh yeah. Yep. Absolutely. And I, I, this, this is an aside. Um, years ago, Renesas had their Synergy platform, which I thought was really cool because they tried to simplify and pre-certify all the software and everything. And that, but then they tried to build that into the, uh, the material costs of the actual hardware, but then it made this MCU so expensive that no one wanted to buy the MCU. And I think Synergy is still around, but I don't know that it got the qualified adoption that, you know, they were all hoping for originally, but that was an interesting, like I said, it's an interesting aside, but, um, I don't know where I was going with that, but

Bill LamieI was part of that project too, as you probably might know.

Jacob BeningoThat's right.

Bill LamieYep. Cause it was ThreadX-based underneath. Uh, and again, you know, the, uh, very well intentioned, you know, and it was a, you know, a good effort. Um, but you know, sometimes they, you miss the mark. Like for instance, there was a, there were in that particular project, this long since fixed. So I'm not giving away any secrets here, but, um, there was like a GPIO function that had a HAL layer than another layer, you know, a BSP above it. Um, and it took like, you know, like something like 300 or 400 cycles to set a GPIO pin with all this stuff, you know, and you're going, well, that's not going to work.

Bill LamieSo, so, uh, again, though, you know, it's companies that are not software companies doing software. Um, and it's, it's really software is not easy. And, and, uh, unfortunately, um, you know, the, the people that are doing it are maybe not the people that should be doing it.

Jacob BeningoAll right. Perfect. Well, Hey, uh, we really, really appreciate you stopping by to, um, share your knowledge and experiences with us today. Really appreciate it. Um, I'll put some links to everybody to, so you can check out some of the stuff that Bill's working on and, and, and certainly a link to PX5. Um, I've worked with it a fair amount, uh, between my benchmarking and some other things. And I, I find it to be a pretty good solution. So I definitely encourage you guys to check that out. Um, and then I'll try to add some other links to other best practices around real-time operating systems that I think you'll find, uh, to be interesting.

Jacob BeningoSo, um, with that, Bill, where's a good place for them? Actually, if they want to look you up, where can they, where can they find you at?

Bill LamieUh, px5rtos. com is the, uh, px5 thing. And you can find me on LinkedIn to build on me. Pretty easy to find me there as well.

Jacob BeningoAll right. Perfect. Thanks again. Really appreciate it, Bill. We'll talk with you soon.

Bill LamieThanks, Jacob. Appreciate it.

Jacob BeningoThanks. Happy coding, everyone.

Open the transcript file

Hosts and Guests

Nobody is credited on this episode yet.

Credit the people on this episode

Be the first to rate this episode

More episodes

All episodes
  1. #028 - From Coding Assistants to Autonomous Engineering

    Nov 5, 202626 minAudio

    Jacob Beningo explores the shift from using AI as a coding assistant to agentic firmware development, where AI agents autonomously build, debug, test, and verify embedded systems. He shares a real experiment using an...

    Credit the people on this episode

  2. #027 - Agentic Firmware Development is Here

    Oct 14, 202623 minAudio

    Jacob Beningo explains why agentic firmware development is already here and how embedded teams can move beyond ad hoc AI prompting. He covers skills, agents, RAG databases, and MCP servers, shows how NXP's new agentic...

    Credit the people on this episode

  3. #026 - Metrics Dashboards to the Rescue

    Mar 18, 202633 minAudio

    Jacob Beningo concludes his embedded software modernization framework series by discussing the establishment of metrics scoreboards for embedded systems development. He explores various metrics categories including code...

    Credit the people on this episode

  4. #025 - Modernize Your Embedded System with AI / ML

    Mar 4, 202633 minAudio

    Jacob Beningo explores how artificial intelligence and machine learning can modernize embedded systems development, sharing practical examples and dispelling myths about AI's applicability to embedded development. He...

    Credit the people on this episode

  5. #024 - Simulating Embedded Systems

    Feb 4, 202623 minAudio

    In this episode, Jacob explores simulation for embedded systems as the seventh step in modernizing embedded development. He discusses functional simulation, on-chip simulation, and software architecture simulation,...

    Credit the people on this episode