Categories
IoT Zephyr

Zephyr Weekly Update – Aug. 23, 2024

As there were quite a few large and significant features that landed since the last time I posted, I will use a slightly different approach this week and won’t be going in details through all the new boards, drivers, or SoCs, but will rather spend time on presenting what these new features are and how they can be useful to you.

Manage your Zephyr SDK using West

I can’t believe we’ve lived all this years without such a command, but I am really glad it’s now available! While you typically don’t (re-)install the Zephyr SDK everyday, this is a task which can require quite a bit of work and be error-prone. And this is even more true for Zephyr newcomers, of course.

With the new west sdk command, one can now easily manage the download and installation of the Zephyr SDK. In most cases, it will just work™ and will, for example, automatically look for the latest version of the SDK.

The Zephyr Getting Started Guide should be updated shortly to take advantage of this new cool tool, but in the meantime I really encourage you to basically have a look at the various options documented via west sdk --help so that you keep the tool in mind for next time you need to tinker with your Zephyr SDK!

New performance profiling subsytem

We had two Zephyr Tech Talks in the recent past where we discussed tracing and profiling (check them out!) and the question that was asked first on both occasions was: what’s the performance impact on my application going to be if I enable tracing/profiling?

It is an important question since in most cases you don’t want the performance overhead to be such that it will completely change how your application behaves, for example due to tasks taking longer to do their job and causing changes in the scheduling.

A new profiling subsystem has recently been introduced with a first implementation of a very lightweight profiling mechanism that samples the stack trace at regular intervals.

Once a given configurable period has elapsed, you are able to retrieve the captured raw information, run it through a Python script, and then directly feed it into FlameGraph to get a visual representation of what your application has been busy doing during that time.

This provides you with a quick overview of what’s going on, and allows you to potentially spot unexpected bottlenecks, or a stack getting dangerously close to overflowing.

HTTP Server sample gets some nice improvements

The HTTP server sample has some new interesting features worth checking out, as it now serves new resources that demonstrates something closer to what you may be interested in doing for a real-life scenario.

    More specifically the sample now serves a “home page” that’s much more useful as before, as it exercises HTTP resource handlers that are doing more than the simple “echo” service from before. Namely, there is now:

    • a /led resource that can be POSTed to and will take JSON commands allowing to toggle an LED on or off. This is also a great way to get some concrete example of how JSON can be used in combination with the HTTP server library, as it’s definitely a common serialization format 🙂
    • an improved WebSocket showcase since the web page can now show network traffic statistics in real-time, directly streamed from the Zephyr device to the browser.
    • a new /uptime endpoint that serves the device uptime dynamically.

    Give the code sample a try, I am pretty confident this will give you some inspiration 🙂


    A big thank you to the 23 individuals who had their first pull request accepted since the last post 💙 🙌: @maxdog988, @lucien-nxp, @thenguyenyf, @Stan-Corellium, @Yagoor, @tot0rokr, @Terezvent, @johankraft, @epc-ake, @deGerard, @marek14, @cyberjupiter, @wearyzen, @xiaolusu, @bianik, @zin-HXQ, @haduongquang, @krzysztofgawrys, @KushnerovMikhail, @tunguyen4585, @GrygiriiS, @esoutham-lvt, and @morihisa-momona.

    As always, I very much welcome your thoughts and feedback in the comments below!

    If you enjoyed this article, don’t forget to subscribe to this blog to be notified of upcoming publications! And of course, you can also always find me on Twitter and Mastodon.

    Catch up on all previous issues of the Zephyr Weekly Update:

    By Benjamin Cabé

    Benjamin Cabé is a technology enthusiast with a passion for empowering developers to build innovative solutions. He has invented an award-winning open source and open hardware artificial nose that he likes to use as an educational platform for people interested in diving into the world of embedded development.
    He is currently a Developer Advocate for the Zephyr Project at the Linux Foundation and lives near Toulouse, France, where he enjoys baking sourdough bread with the help of his artificial nose.

    Leave a Reply

    Your email address will not be published. Required fields are marked *