<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: hang-up</title>
    <description>The latest articles on DEV Community by hang-up (@k_y_98d85b6e1a0c5ccd80b34).</description>
    <link>https://dev.to/k_y_98d85b6e1a0c5ccd80b34</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F3659584%2F93b93110-6c47-4022-83d2-ab284ec6253b.png</url>
      <title>DEV Community: hang-up</title>
      <link>https://dev.to/k_y_98d85b6e1a0c5ccd80b34</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/k_y_98d85b6e1a0c5ccd80b34"/>
    <language>en</language>
    <item>
      <title>Enable Zephyr RTOS on STM32</title>
      <dc:creator>hang-up</dc:creator>
      <pubDate>Mon, 15 Dec 2025 09:11:35 +0000</pubDate>
      <link>https://dev.to/k_y_98d85b6e1a0c5ccd80b34/enable-zephyr-rtos-on-stm32-26ba</link>
      <guid>https://dev.to/k_y_98d85b6e1a0c5ccd80b34/enable-zephyr-rtos-on-stm32-26ba</guid>
      <description>&lt;p&gt;What is Zephyr RTOS?&lt;br&gt;
It is an open-source real-time operating system (RTOS) designed for resource-constrained embedded devices. The project is led by the Linux Foundation and is widely adopted in IoT edge devices and microcontroller-based systems.&lt;br&gt;
Zephyr Project&lt;br&gt;
&lt;a href="https://www.zephyrproject.org/" rel="noopener noreferrer"&gt;https://www.zephyrproject.org/&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Background&lt;br&gt;
I thought the name "Zephyr" sounded cool, and I had an STM32 microcontroller I received from an acquaintance that was just gathering dust. It felt like a waste, so I decided to try and put it to good use.&lt;/p&gt;

&lt;p&gt;Environment&lt;br&gt;
• STM32 Nucleo Board STM32F401&lt;br&gt;
• Ubuntu 24.04.2 LTS&lt;/p&gt;

&lt;p&gt;Note: Ubuntu 24.04.2 LTS is installed on a dedicated PC environment. I took an old Windows PC purchased about 5 years ago and used Rufus to install Ubuntu 24.04.2 LTS via a USB drive to serve as my development environment. Incidentally, since I already had a WSL2 environment set up, I tried the WSL2 method first, but communication with the STM32 via USB did not work well. I found out after trying that the official Getting Started Guide explicitly states "Flashing from WSL is not supported," so please be aware of this. Also, Rufus is a tool for writing OS ISO image files to USB drives to create installation media; if you use that, you can easily convert a Windows PC into a Linux PC. It is possible to set it up for dual-booting so you can use both Windows and Linux, which might be interesting to try. However, I found switching between Windows and Linux cumbersome, so I made it a dedicated Linux machine.&lt;/p&gt;

&lt;p&gt;Method&lt;br&gt;
I proceeded exactly as outlined in the official Getting Started Guide.&lt;br&gt;
&lt;a href="https://docs.zephyrproject.org/latest/develop/getting_started/index.html" rel="noopener noreferrer"&gt;https://docs.zephyrproject.org/latest/develop/getting_started/index.html&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Here are the points where I got stuck and how I resolved them:&lt;br&gt;
Unable to create Python virtual environment (venv)&lt;br&gt;
The official documentation names the virtual environment .venv, but any name is fine. I encountered issues activating the virtual environment when leaving it as .venv.&lt;br&gt;
Issues building the sample&lt;br&gt;
Although mentioned in the official documentation, sometimes the target board specification isn't recognized correctly. Running the following command listed the board names supported by Zephyr:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;west boards
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Replace  in the official documentation with the name of the board you are using (find it in the results of west boards) and run the build command. Below is the command I used for the STM32 this time:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;west build -p always -b nucleo_f401re samples/basic/blinky
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Flashing to the STM32 failed&lt;br&gt;
I was able to flash successfully by specifying OpenOCD.&lt;br&gt;
(Note: OpenOCD is an open-source tool for debugging and programming embedded devices using JTAG or SWD.)&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;west flash --runner openocd

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Testing it out&lt;br&gt;
For reference, I tried flashing the samples/basic/blinky program.&lt;br&gt;
Here is how it looks:&lt;br&gt;
&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fqkbc8eo89r4m469a55d7.jpeg" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fqkbc8eo89r4m469a55d7.jpeg" alt=" " width="800" height="450"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Reference: About the LEDs&lt;br&gt;
• LD1&lt;br&gt;
• Red&lt;br&gt;
• Indicates USB communication or ST-LINK status.&lt;br&gt;
• LD2&lt;br&gt;
• Green&lt;br&gt;
• For user control (used here for the LED blink).&lt;br&gt;
• LD3&lt;br&gt;
• Red&lt;br&gt;
• Indicates power is being supplied (Solid on is normal).&lt;br&gt;
Impressions&lt;br&gt;
I was able to try out the sample program much faster than I expected. If one continues to face issues with setting up the development environment, building sample programs, or flashing, there is a high chance of giving up, so I am glad I was able to reach a successful stopping point. In terms of setting up an OS development environment, I thought this was one of the easier ones. If the opportunity arises, I would like to try my hand at OS development in the future.&lt;/p&gt;

</description>
      <category>linux</category>
      <category>zephyr</category>
      <category>stm32</category>
    </item>
    <item>
      <title>Building a Linux OS with Yocto</title>
      <dc:creator>hang-up</dc:creator>
      <pubDate>Sat, 13 Dec 2025 08:06:49 +0000</pubDate>
      <link>https://dev.to/k_y_98d85b6e1a0c5ccd80b34/building-a-linux-os-with-yocto-3op8</link>
      <guid>https://dev.to/k_y_98d85b6e1a0c5ccd80b34/building-a-linux-os-with-yocto-3op8</guid>
      <description>&lt;p&gt;What is Yocto?&lt;br&gt;
It is a project that provides software tools—such as build systems, cross-development environments, and emulators—for the Linux OS.&lt;br&gt;
In the past, building a Linux OS was a manual process. You had to gather the necessary software packages one by one, build them, resolve dependencies, and install them yourself.&lt;br&gt;
Yocto is designed to solve this hassle. As long as you have an internet connection, it allows you to build a Linux OS automatically.&lt;/p&gt;

&lt;p&gt;Environment&lt;br&gt;
• OS: Ubuntu 22.04&lt;br&gt;
• Version: Ubuntu 22.04.5 LTS (Jammy Jellyfish)&lt;br&gt;
• Note: I attempted to use Ubuntu 24.04, but the setup failed because the modules for Bitbake are not supported yet.&lt;br&gt;
• Troubleshooting: I encountered an issue where the terminal wouldn't launch on 22.04, but I resolved it using the following guide: "Solved: Ubuntu 22.04 Terminal Won't Start! How to fix in VirtualBox."&lt;br&gt;
• Virtual Machine: VirtualBox 7.0.22&lt;br&gt;
• Source: Download_Old_Builds_7_0 – Oracle VirtualBox&lt;br&gt;
• System Requirements for Yocto:&lt;br&gt;
• Storage: Allocated 60GB or more to ensure sufficient disk space during the build process.&lt;br&gt;
• Memory (RAM): Allocated 16GB, as 8GB was not enough.&lt;/p&gt;

&lt;p&gt;Source.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;# Install Modules (Dependencies)
sudo apt update
sudo apt install -y chrpath diffstat gawk
sudo apt install python3.10-distutils

# Clone Repository
cd /home/user
mkdir poky
cd poky
git clone -b dunfell git://git.yoctoproject.org/poky.git

# Build
cd /home/user/poky/poky
source oe-init-build-env
bitbake core-image-base # The initial build may take 2-4 hours.

# Run QEMU (Emulator)
runqemu qemux86         # For 32-bit
runqemu qemux86-64      # For 64-bit

# Use the command below if you are on 64-bit and encounter the 
# "Request Major code 130 (MIT-SHM)" error:
runqemu qemux86-64 nographic

### Initial Login Credentials
# User: root
# Password: none (leave blank)

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Result&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fqu21il703bmk92uu99b8.jpeg" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fqu21il703bmk92uu99b8.jpeg" alt=" " width="722" height="743"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Thoughts&lt;br&gt;
It was harder than I expected, but I managed to complete the build by asking an AI for help.&lt;br&gt;
The video I referred to was very easy to understand. (It was in English, so I watched it using auto-translation.)&lt;/p&gt;

&lt;p&gt;&lt;a href="https://m.youtube.com/watch?v=G4ufLyCFovo" rel="noopener noreferrer"&gt;https://m.youtube.com/watch?v=G4ufLyCFovo&lt;/a&gt;&lt;/p&gt;

</description>
      <category>linux</category>
      <category>virtualmachine</category>
      <category>programming</category>
      <category>software</category>
    </item>
  </channel>
</rss>
