<!DOCTYPE article PUBLIC "-//NLM//DTD JATS (Z39.96) Journal Archiving and Interchange DTD v1.0 20120330//EN" "JATS-archivearticle1.dtd">
<article xmlns:xlink="http://www.w3.org/1999/xlink">
  <front>
    <journal-meta />
    <article-meta>
      <title-group>
        <article-title>Migrating an embedded systems lab to Zephyr - an experience report</article-title>
      </title-group>
      <contrib-group>
        <contrib contrib-type="author">
          <string-name>Olaf Hagendorf</string-name>
          <email>olaf.hagendorf@hs-wismar.de</email>
          <xref ref-type="aff" rid="aff0">0</xref>
        </contrib>
        <contrib contrib-type="author">
          <string-name>Niklas Huhs</string-name>
          <email>niklas.huhs@hs-wismar.de</email>
          <xref ref-type="aff" rid="aff0">0</xref>
        </contrib>
        <aff id="aff0">
          <label>0</label>
          <institution>Hochschule Wismar</institution>
          ,
          <addr-line>Philipp-Müller-Str. 14 23966 Wismar</addr-line>
          ,
          <country country="DE">Germany</country>
        </aff>
      </contrib-group>
      <pub-date>
        <year>2026</year>
      </pub-date>
      <abstract>
        <p>With the deprecation of Mbed OS and increasing demands from both industry and students for modern, scalable embedded education, an embedded development lab, formerly based on Mbed OS had to be migrated to a new framework. Existing hardware based on STM32 Nucleo-144 boards and a customdeveloped extension shield was retained, while the software stack was transitioned to Zephyr, supplemented by Arduino and MATLAB/Simulink for introductory and model-based development. The hardware features enable a comprehensive set of hands-on lab exercises, from basic GPIO control to realtime data acquisition and networked applications. The paper outlines the structure and progression of the labs, the technical and pedagogical rationale behind tool choices, and the process of customizing Zephyr device tree overlays to support diverse peripherals. PlatformIO was adopted to facilitate seamless switching between frameworks, enhancing the learning experience. The migration demonstrates how Zephyr can serve as a sustainable and industry-relevant foundation for embedded systems education, effectively bridging academic and practical skill development.</p>
      </abstract>
      <kwd-group>
        <kwd>Zephyr</kwd>
        <kwd>education</kwd>
        <kwd>Mbed OS</kwd>
        <kwd>embedded systems 1</kwd>
      </kwd-group>
    </article-meta>
  </front>
  <body>
    <sec id="sec-1">
      <title>1. Introduction</title>
      <p>The information and electrical engineering course at Wismar University of Applied Sciences has
included a basic microcontroller module for several decades. In addition to the internal structures
and function blocks, the microcontroller module includes programming in assembler and C at
register and bit level. The basic knowledge required to work with this technology is taught.</p>
      <p>Another module in the field of embedded systems, long time existing, is real-time and network
programming. This module is based on universal and real time operating system, mainly Linux.</p>
      <p>During a redesign of the curriculum of the Information and Electrical Engineering degree course
and the introduction of Mechatronics, 11 years ago, the need from industry to strengthen training in
the field of embedded systems was addressed. The two modules Embedded Control Systems I (ECS)
Bachelor and ECS II Master were introduced in these degree courses mentioned above.</p>
      <p>At that time, the Arduino Environment [1] was known to both students and teachers and was
used in projects by both. One of the authors successfully used it in research projects to set up a
measuring and test stand for an air heat pump and to develop a houseboat with electric motors, solar
panels and joystick control. The hardware basis at that time was the microcontroller Atmega328,
with relatively low memory resources and processor performance (32kB Flash, 2kB RAM, 8Bit CPU
with max. 20MHz). The low available resources often became a problem in these projects. A major
advantage, however, was the simplicity of use, the commissioning of the Arduino Integrated
Development Environment (IDE) and the numerous tutorials, examples, field reports, etc.</p>
      <p>Learning with Matlab/Simulink [2] plays an essential role in the education of the
abovementioned degree courses from the first semester onwards, from the introduction to numerical
mathematics in the basic mathematics course to the C code generation of Simulink models and
execution as a real-time system in the control and automation technology modules.</p>
      <p>The Embedded Coder Target for Arduino was published as an open source project on the Matlab
File Exchange platform ([3] project deleted 2024.07.11, copy [4]). This made it very easy to start
generating C code with the Matlab Embedded Encoder Toolboxes and low-cost hardware.</p>
      <p>For the design of the ECS modules, a modern and future-proof laboratory environment was to be
created that would enable something from simple microcontroller programming through to C code
generation. Due to resource constraints, the Arduino environment was not chosen. In control and
automation technology, floating point calculations are important and software implementation on
an 8-bit platform is memory and computing time intensive. The main argument against the Arduino
hardware was the resource constraints. Around the same time of decision making, a new platform
was introduced by STM, the Nucleo-64 family, starting with the two microcontrollers STM32F401
and STM32F411 [5]. The form factor and the connections for extensions corresponded to the Arduino
UNO, but with a compatible extension of significantly more pins. Both microcontrollers have a
32bit Cortex-M4 with FPU. Programming with the Arduino IDE was not possible at that time, but STM
advertised the two Nucleo boards with mbed compatibility. The mbed library, or with the current
naming Mbed OS, turned out to be the ideal environment. Simple C/C++ programming comparable
to Arduino but with an extended functionality was possible. Both an online and various conventional
offline IDEs, commercial and free, were available. Based on the Embedded Coder Target (for Arduino)
[4], the MbedTarget was created [6] [7] [8], a Matlab/Simulink Embedded Coder target for Mbed OS.
In order to make student labs more diverse and interesting than would have been possible with the
pure Nucleo board, the Mbed Application Shield [9] was implemented in a separate, largely
functionally compatible version in a cost-optimized manner. The current version is presented in the
next chapter.</p>
      <p>Since Mbed OS was first used in teaching, the project has been continuously developed. In 2016,
there was a significant increase in commits, maybe as a result of the IOT hype [10], as can be seen
in fig. 1. In 2021, the number of commits then decreased significantly to reach 0 commits in 2025 up
to the end of May.</p>
      <p>The end of the project was announced by ARM on August 30, 2024, with archiving taking place
in July 2026 [11].</p>
      <p>Since the winter semester 2023, the curriculum in the Master's in Applied Computer Science and
since the winter semester 2024 in the Bachelor's in Applied Computer Science has also been expanded
to include the compulsory elective modules Embedded Systems I and II. In this case, the request to
introduce these modules came from the student body. The module content was based on the
experience of the Information and Electrical Engineering and Mechatronics degree programs.</p>
      <p>Due to the discontinuation of the further development of Mbed OS, another redesign is required.
Continued use of Mbed OS is only acceptable for a brief moment of redesign; in the medium term, a
reorientation is unavoidable and is the current work in progress, described in this paper.</p>
      <p>
        No hardware changes are planned. The use of the Arduino IDE is being reconsidered for
programming. A test run in the winter semester 24/25 with students of Applied Computer Science
was very promising. However, the library seems too simplified, well suited for introducing students
without microcontroller experience, but there is neither real-time, general device driver nor general
network functionality. STM32duino open source community is responsible not only for the STM32
Arduino core library but also for extensions for FreeRTOS and Ethernet [
        <xref ref-type="bibr" rid="ref2">12</xref>
        ]. But it is limited to the
microcontrollers of the STM32 families. Broader hardware support would be desirable.
      </p>
      <p>
        The development of Zephyr has been observed by the authors for several years. Many features of
the project seem to meet the requirements very well. A master thesis examined various open source
implementations of (D)TLS libraries in different environments: MbedOS, Zephyr and Micropython
[13] [
        <xref ref-type="bibr" rid="ref3">14</xref>
        ]. Regardless of the results concerning the security libraries, the support of (D)TLS
environments with the investigated protocols (http, mqtt, coap) was most extensive in Zephyr.
      </p>
      <p>For these reasons, the decision was made to use Zephyr in the various embedded modules.</p>
    </sec>
    <sec id="sec-2">
      <title>2. Hardware</title>
      <p>
        The hardware used in our laboratories is divided into two parts: the commercial available
microcontroller platform Nucleo-144 STM32F767ZI from STM [
        <xref ref-type="bibr" rid="ref4">15</xref>
        ] with an expansion shield
developed in-house [
        <xref ref-type="bibr" rid="ref5">16</xref>
        ]. The Nucleo-144 board uses a 32-bit Cortex®-M7 CPU with DP-FPU, a
maximum clock frequency of 216 MHz, an Ethernet interface, 2 MBytes of flash memory and 512 KB
of SRAM. Further features can be found in the data sheet [
        <xref ref-type="bibr" rid="ref4">15</xref>
        ].
      </p>
      <p>The extension shield is based on the Mbed Application Shield from ARM [9], which was originally
slightly modified to optimize costs and later developed further with functional enhancements. The
current version has been adapted from Nucleo-64 for the Nucleo-144 format. This means that all labs
can be implemented with the same hardware. Before Nucleo-64 together with the Application shield
and Nucleo-144 with its ethernet port were used.</p>
      <p>The current Application shield version offers the following hardware components, as shown in
the schematic in fig. 2:
•
•
•
•
•</p>
      <p>
        Buses: UART, I2C and SPI
5 digital inputs for 5-way navigation switch
2 analog inputs for potentiometers
3 digital outputs for an RGB LED
1 digital output for a serial NeoPixel LED [
        <xref ref-type="bibr" rid="ref6">17</xref>
        ]
      </p>
      <p>
        The hardware offers the possibility to implement a comprehensive set of laboratory tasks, starting
with a flashing LED, a button input, the implementation of various sensors, display and sensor
control via SPI and I2C buses through to the implementation of Ethernet communication for sending
data to an IOT cloud application [
        <xref ref-type="bibr" rid="ref7">18</xref>
        ] using various unsecured and secured protocols.
      </p>
      <p>The Nucleo-144 board is officially supported by STM for Zephyr. But the device tree only defines
rudimentary hardware blocks, the 16 standard digital Arduino-Uno pins, one SPI and I2C interface,
one ADC and DAC pin. The pin definitions fall far short of the definitions in the Mbed OS and
Arduino environments.</p>
      <p>The device tree for these missing functions and everything for the expansion shield will be
implemented by the authors and students as part of the preparations for all the available modules.</p>
      <sec id="sec-2-1">
        <title>Some of this work is presented in the following chapters.</title>
      </sec>
    </sec>
    <sec id="sec-3">
      <title>3. Software</title>
      <p>This goal of the software written for these labs was to optimize the learning curve for the students,
who might bring some experience in embedded systems as hobbyists and those might have not had
any contact with embedded system development. This meant, that the introduction into the
frameworks, in this case Arduino, Zephyr and model based development in Matlab Simulink should
quickly introduce all the necessary basics and then move on to more advanced topics. The spot in
the labs, that was before taken my Mbed OS, was now occupied by Zephyr.</p>
      <sec id="sec-3-1">
        <title>PlatformIO</title>
        <p>
          PlatformIO is a cross-platform and cross-architecture tool for multiple frameworks [
          <xref ref-type="bibr" rid="ref8">19</xref>
          ]. It is
distributed as an extension for the VSCode editor which was installed by over 5 million users around
the world. As the labs progress through different embedded frameworks, the multi-framework
functionality of PlatformIO offers significant advantages by being able to quickly switch between
the frameworks and by handling the installation of those frameworks in the background. The version
of PlatformIO used in this work is 3.3.4 which uses the Zephyr version 4.1 for the STM32 platform.
3.2.
        </p>
      </sec>
      <sec id="sec-3-2">
        <title>Hardware test program</title>
        <p>To validate the capabilities of the updated application shield and demonstrate the integration of the
different peripherals within a Zephyr environment, a comprehensive hardware test program was
developed. This program systematically exercises all major components of the shield, including
analog-to-digital converters (ADC), PWM-controlled RGB LEDs, a Neopixel LED, a navigation
switch and an LCD display. The core architecture of the program is built around a user-navigated
menu, implemented through a global menuIndex variable and controlled using GPIO interrupts
triggered by the directional navigation switch. Each menu item corresponds to a specific hardware
feature and is presented on the LCD display using the Zephyr character frame buffer API. To enable
the use of the C12832 Display, a driver was written for the ST7565 controller.</p>
        <p>In the ADC test mode (case 0 in the main switch statement), the application iterates through the
ADC channels and reads their values using the adc_read_dt() function. These values are converted
to millivolts and displayed on the LCD. The RGB-LED is used with three PWM-channels and shows
fading effects for all the colors. The Neopixel is driven by a manually implemented bit-banging
function. Other menu items include the buzzer, the LM75 temperature sensor and an external
connected SGP40 air quality sensor.</p>
        <p>This program not only serves a hardware testing purpose but also served as a valuable educational
resource. It provided students with a cohesive and practical example of how to structure embedded
applications using Zephyr’s APIs, device tree bindings, interrupt management, and peripheral
interaction. The complete source code for this test and all lab exercises is available on GitHub for
reference and reuse.
3.3.</p>
      </sec>
      <sec id="sec-3-3">
        <title>Structure of the labs</title>
        <p>The labs for the students are structured as shown in table 1. As a general introduction to embedded
software development, the Arduino framework is chosen because of its relatively easy learning curve
and compact code. The first lab in each framework was meant to teach the basic concepts like GPIOs,
Interrupts or, in Zephyr’s case the device tree. After teaching the students about the library
management and how to use external devices over I²C and SPI, they were able to complete a small
project, consisting of a simulated bang-bang temperature controller using the LM75 sensor, the
RGBLED and the display with the navigation switch to adjust switching values of the controller.</p>
        <p>After being introduced to the basic concepts of Zephyr, the students added nodes to a basic
implementation of the device tree for this hardware, while learning about pinmaps, drivers and how
to use them in a device tree overlay. This way the use of the potentiometers was implemented the
complete way from creating the device tree, based on the schematic, to writing the c-code to read
the ADC values and displaying them on the LCD-display. In the final Zephyr-lab, a multi-thread
example was introduced.</p>
        <sec id="sec-3-3-1">
          <title>The overall last lab introduces model-based development in Matlab Simulink.</title>
        </sec>
      </sec>
    </sec>
    <sec id="sec-4">
      <title>4. Learnings and difficulties</title>
      <p>The initial implementation of Zephyr into this embedded system lab was heavily influenced by
earlier courses that included Mbed OS in its structure and general approach to teaching. Adaptions
were made to highlight the differences of the operating systems as some students were familiar with
Arduino and Mbed OS.
4.1.</p>
      <sec id="sec-4-1">
        <title>How to approach Zephyr as an educator</title>
        <p>The main focus of this course was to provide an understanding of the most basic concepts of Zephyr
like the device tree, drivers and configurations. Like in the labs, based on the Arduino framework,
the goal was to enable the students to approach a new project, based on simple specifications, and
fulfil the set goals, even if the hardware is new to them. The extensive documentation and examples,
provided by the Zephyr project were a good basis for the students’ independent work. While the
contributors of this work were familiar with concepts like the device tree because of a Yocto-based
project, the students however had some difficulties in developing an intuitive understanding of the
device tree. To better convey the concept, it was useful to not only teach the students to write the
code for their program but also let them write a part of the device tree overlay for the hardware used
in the labs, starting with a custom led and continuing with configuring two ADC channels as shown
in figure 3.</p>
        <p>Parallel to writing the necessary nodes for the device tree, the students learned how to activate
specific drivers in the the proj.conf, in this case the ADC and STM-specific ADC drivers as shown in
figure 4.</p>
        <p>After setting up these preparatory tasks, the students were able to start programming the c-code.
The most important steps, that are repeated in all of the labs are the referencing of the device tree
nodes via the aliases, the initialization of the different components and then the main functionality
of the program.</p>
        <p>The use and programming of drivers for Zephyr was also an essential part of the labs and the
advantages of the way Zephyr handles device drivers were easily conveyed. As there was no device
driver for the C12832 Display with an ST7565 controller, a driver was written to support this
hardware which was an excellent opportunity to learning more about the Zephyr’s device driver
API.
4.2.</p>
      </sec>
      <sec id="sec-4-2">
        <title>What to improve for the next course</title>
        <p>One of the most challenging aspects of teaching zephyr in a group was the high potential for
mistypes due to the initial amount of steps to be taken to create a functioning zephyr program. To
streamline some of the more repetitive code. Functions were written to handle things like GPIO
initialization and error handling as seen in figure 5.</p>
        <p>These functions could be provided to the students to create another layer of abstraction and
simplify some of the code, therefore eliminating some sources of error that might hinder the progress
of the labs.</p>
        <p>Furthermore, it might be advantageous to dedicate a whole ninety-minute lab to the device tree
and debugging errors in the device tree as the error messages are not as easy to debug for new users.</p>
      </sec>
    </sec>
    <sec id="sec-5">
      <title>5. Conclusion</title>
      <p>Migrating the embedded systems lab to Zephyr turned out to be the right choice considering the
virtual end of Mbed OS. Students engaged with key concepts such as the device tree, driver
configuration and multi-threaded programming. While the learning curve proved steep, especially
in understanding device tree syntax and configuration, the hands-on approach, supported by
practical excercises and a custom driver significantly improved their confidence and competence in
embedded development. The fact that a good part of the participating students chose a Zephyr-based
project for their final project shows their confidence. Future iterations of the course will benefit from
improved abstraction layers and more focused sessions on Zephyr’s configuration and debugging,
ensuring a smoother and more effective learning experience.</p>
      <p>Declaration on Generative AI</p>
      <sec id="sec-5-1">
        <title>The author(s) have not employed any Generative AI tools.</title>
        <p>Embedded Coder Target for Arduino,
EmbeddedCoderTarget4Arduino, (access 2025.05.31)
https://github.com/cea-wismar/
STM32 Nucleo Boards, https://www.st.com/en/evaluation-tools/stm32-nucleo-boards/
products.html?querycriteria=productId=LN1847$$1574=Nucleo-64, (access 2025.05.31)</p>
      </sec>
      <sec id="sec-5-2">
        <title>MbedTarget, https://github.com/cea-wismar/mbed_target, (access 2025.05.31) [7] [8] [9]</title>
        <p>O. Hagendorf: MbedTarget - A Simulink Target for high level Embedded Programming for Cyber
Physical Systems, 2nd IFAC Conference on Cyber-Physical &amp; Human Systems, December
1415, 2018, Miami USA
O. Hagendorf: MbedTarget - A Simulink Target for Cortex-M Microcontrollers. ASIM Fachtagung
STS und GMMS 8./9.03.2018, Hochschule Heilbronn, Germany</p>
        <p>W. Lord, Important Update on Mbed.
https://os.mbed.com/blog/entry/Important-Update-onMbed/, (access 2025.05.31)
Excellence
–</p>
        <p>PlatformIO,</p>
      </sec>
    </sec>
  </body>
  <back>
    <ref-list>
      <ref id="ref1">
        <mixed-citation>
          <string-name>
            <surname>Arduino - Home</surname>
          </string-name>
          , https://www.arduino.cc/, (access
          <year>2025</year>
          .
          <volume>05</volume>
          .31) Mathworks, https://de.mathworks.com/, (access
          <year>2025</year>
          .
          <volume>05</volume>
          .31) Mathworks File Exchange, https://de.mathworks.com/matlabcentral/, (access
          <year>2025</year>
          .
          <volume>05</volume>
          .31) [10]
          <string-name>
            <surname>Gartner</surname>
          </string-name>
          <article-title>'s 2016 Hype Cycle for Emerging Technologies Identifies Three Key Trends That Organizations Must Track to Gain Competitive Advantage</article-title>
          , https://www.gartner.com/en/ newsroom/press-releases/2016-08-16-gartners-2016
          <string-name>
            <surname>-</surname>
          </string-name>
          hype
          <article-title>-cycle-for-emerging-technologiesidentifies-three-key-trends-that-organizations-must-track-to-gain-competitive-</article-title>
          <string-name>
            <surname>advantage</surname>
          </string-name>
          , (access
          <year>2025</year>
          .
          <volume>05</volume>
          .31)
        </mixed-citation>
      </ref>
      <ref id="ref2">
        <mixed-citation>
          [12]
          <article-title>STM32duino open source community</article-title>
          , https://github.com/stm32duino, (access
          <year>2025</year>
          .
          <volume>05</volume>
          .31)
        </mixed-citation>
      </ref>
      <ref id="ref3">
        <mixed-citation>
          [14]
          <string-name>
            <given-names>O.</given-names>
            <surname>Hagendorf</surname>
          </string-name>
          ,
          <string-name>
            <given-names>P.</given-names>
            <surname>Bomball</surname>
          </string-name>
          ,
          <article-title>Survey of Open Source (D)TLS Libraries for Bare Metal Microcontroller Programming</article-title>
          ,
          <source>The 11th IEEE World Forum on Internet of Things (WF-IoT)</source>
          ,
          <year>2025</year>
          , Chengdu/China, (submitted
          <year>2025</year>
          .
          <volume>03</volume>
          .31, not yet accepted)
        </mixed-citation>
      </ref>
      <ref id="ref4">
        <mixed-citation>
          [15]
          <string-name>
            <surname>NUCLEO-F767ZI - STM32</surname>
          </string-name>
          Nucleo-
          <article-title>144 development board with STM32F767ZI MCU, https</article-title>
          ://www.st.com/en/evaluation-tools/nucleo-f767zi.
          <fpage>html</fpage>
          , (access
          <year>2025</year>
          .
          <volume>05</volume>
          .31)
        </mixed-citation>
      </ref>
      <ref id="ref5">
        <mixed-citation>
          <source>[16] Application</source>
          <year>2025</year>
          .
          <volume>05</volume>
          .31) Shield,
        </mixed-citation>
      </ref>
      <ref id="ref6">
        <mixed-citation>
          [17]
          <string-name>
            <given-names>P.</given-names>
            <surname>Burgess</surname>
          </string-name>
          , The Magic of NeoPixels. https://learn.adafruit.com/adafruit-neopixel-uberguide, (access
          <year>2025</year>
          .
          <volume>05</volume>
          .31)
        </mixed-citation>
      </ref>
      <ref id="ref7">
        <mixed-citation>
          [18]
          <string-name>
            <surname>Thingsboard - Open Source</surname>
          </string-name>
          IoT Platform, https://thingsboard.io/ , (access
          <year>2025</year>
          .
          <volume>05</volume>
          .31)
        </mixed-citation>
      </ref>
      <ref id="ref8">
        <mixed-citation>
          [19] Your Gateway to Embedded Software Development https://docs.platformio.org/en/latest/, (access
          <year>2025</year>
          .
          <volume>05</volume>
          .31)
        </mixed-citation>
      </ref>
    </ref-list>
  </back>
</article>