Home > On-Demand Archives > Talks >

Strategies for Developing Scalable Embedded Software for Microcontrolllers

Timothy Adu - Watch Now - Duration: 01:00:39

Strategies for Developing Scalable Embedded Software for Microcontrolllers
Timothy Adu

This talk will focus on useful strategies for developing embedded software - strategies that facilitate reuse, maintainability, ease of testing and scalability. Key topics that will be covered include:

  • Scalable Architecture/Design
  • CI/CD
  • Observability mechanisms
  • Virtualization
  • Rules of Engagement
  • Strategies for application (business logic) development

The talk will introduce a simple framework for implementing the strategies listed above.

M↓ MARKDOWN HELP
italicssurround text with
*asterisks*
boldsurround text with
**two asterisks**
hyperlink
[hyperlink](https://example.com)
or just a bare URL
code
surround text with
`backticks`
strikethroughsurround text with
~~two tilde characters~~
quote
prefix with
>

nathancharlesjones
Score: 1 | 1 day ago | 1 reply

I really enjoyed this talk! Great job, Timothy.

TimothySpeaker
Score: 0 | 9 hours ago | no reply

Hi Nathan,
Thanks for the feedback!

mck
Score: 1 | 4 days ago | 1 reply

Thanks for the excellent presentation. I have a question about the example slide. I am wondering why the notify client went directly out from the telemetry service. I would have expected the telemetry service to send to the connectivity service mailbox instead, and have the ble module send the notification to the client.

TimothySpeaker
Score: 0 | 3 days ago | no reply

Hi mck,
Thanks for the feedback.
It's a design choice. For each service, we define the "boundaries" of operation. In this case, I made the following design choices:

  • The connectivity service would only deal with setting up a connection, tearing it down and reporting updates in connection status.
  • The telemetry service would collect data from the sensors, analyze them and check with the connectivity service before nofifying the client.

The connectivity service exposes functions that the telemtetry service uses to send notifications.

In the end, there's many ways to do this. It all comes down to design choices. Your proposal works perfectly too. In the example case, I simply decided to let the telemetry service handle the sampling, analysis and transmission of sensor data, while the connectivity service handles the connection itself and keeps the system service updated if anything about the connection changes.

SimonSmith
Score: 1 | 5 days ago | 1 reply

Can you describe more about your logging and CLI? Just browsing your website - looks good!

TimothySpeaker
Score: 0 | 3 days ago | 1 reply

Hi SimonSmith,
What specifically about the CLI/logging do you want to focus on?

SimonSmith
Score: 0 | 2 days ago | no reply

I just watched it again, the logging is straightforward. What was used for the shell and command parser? That was very impressive. I've implemented one that parses commands and uses function pointers, so each performs a specific action and returns a string, but it was very clunky. Do shell commands run in another task, so they don't impact performance?

Also I heard that GitLab has a critical security vulnerability - see recent Ars Technica article.

Miro
Score: 3 | 5 days ago | 1 reply

Thank you for the nice presentation. Interestingly, your microADF architecture is (at the highest level) event-driven and asynchronous (posting messages to mailboxes without blocking and waiting for the processing). Also, you mention state machines that implement the internal event-driven behavior of your "entities". Such architecture seems to be a universal conclusion of experienced developers. The other name of this design pattern is "Active Object" (a.k.a., "Actor"). An "Active Object" typically has a mailbox and a thread of execution. However, your design has two threads: a "parent thread" and a "worker thread". It's unclear how these two interact (synchronously, asynchronously?). Wouldn't the design be cleaner with just one thread per "entity" (Active Object)?

TimothySpeaker
Score: 0 | 3 days ago | no reply

Hi Miro,
Thanks for the feedback.
Yes, in the specific example I provided there were two threads. This doesn't necessarily have to be the case. It depends on the feature being implemented.
The design principle is that there is one (and only one) parent thread (on the service layer). The presence of a worker thread (or absence thereof) is entirely at the designer's discretion. Ideally, the choice of having a worker thread depends almost entirely on how that feature itself is meant to work. Not every feature requires it own thread, hence the FSD matrix, where you have an overview/breakdown of which features use threads and which ones do not.

BarryR7
Score: 2 | 5 days ago | 1 reply

Very nice presentation. Would love to work in your environment or be able to more effectively convince management that it’s worth setting up the infrastructure you outline. Any tips for that conversation?

TimothySpeaker
Score: 0 | 3 days ago | no reply

Hi BarryR7,
Thanks for the feedback.
In my experience, the battle is convincing management that it is worth the TIME that is to be invested in infrastructure. To be a little blunt, in most cases, management rarely gives a damn about infrastructure. They key is pointing out that the infrastructure is critical to getting your job done.
My advice is to start by defining what infrastructure you deem relevant. Then determine what is critical and nice-to-have.
Then build a timeline for building the critical infrastructure and nice-to-have infrastructure. Find a way to embed the infrastructure development in the "actual work", in such a way that it does not take away significant time from the development work. Also when you're setting up project timelines, remember to account for time that needed to be spent on infrastructure as well.
If you're up for it, let's hop on a call and discuss this at length. You can message me on LinkedIn.

SimonSmith
Score: 2 | 6 days ago | 1 reply

Thanks Timothy. I really enjoyed your talk and it was very clear, with excellent examples. I hadn’t seen your FSD approach with simple spreadsheet used before. I find most projects jump to the scaffolding and all the foundation steps you showed are rarely done, as there is little time. Nice to see RTT and SystemView used as well for observabilty (I’ve been using these too).

TimothySpeaker
Score: 1 | 6 days ago | no reply

Hi SimonSmith,
Thanks for the feedback. Glad you found the presentation enjoyable.
The FSD approach provides a simple yet broad overview/breakdown of the system. I developed the approach to solve challenge of bridging the gap between requirements and code - something that has always frustrated me.
As for RTT and SystemView, I use them whenever I get the chance. I generally love using SEGGER's tools.
If you're interested, tune in to the live Q&A and I can show some code examples.

Theodor
Score: 0 | 6 days ago | 1 reply

Excellent lecture, thank you. It would be nice to see some code examples.

TimothySpeaker
Score: 2 | 6 days ago | no reply

Hi Theodor,
Thanks for the feedback. I had considered showing some code examples but it was tricky to fit so much material into a 1 hour presentation. I would be more than happy to give a one-on-one code walkthrough. Otherwise, feel free to join the live Q&A and I can show some code examples there.

OUR SPONSORS

OUR PARTNERS