<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by Syed Ali Moajiz Rizvi on Medium]]></title>
        <description><![CDATA[Stories by Syed Ali Moajiz Rizvi on Medium]]></description>
        <link>https://medium.com/@alimoajiz999?source=rss-daa5f1a24d3e------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*bOlXMGnbqr2gEAOPOAUYNQ.jpeg</url>
            <title>Stories by Syed Ali Moajiz Rizvi on Medium</title>
            <link>https://medium.com/@alimoajiz999?source=rss-daa5f1a24d3e------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Sat, 28 Nov 2026 04:58:49 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@alimoajiz999/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[Practical Yocto Project Guide with Kas and Custom Yocto Layer]]></title>
            <link>https://medium.com/@alimoajiz999/practical-yocto-project-guide-with-kas-and-custom-yocto-layer-a020ea4cf8c7?source=rss-daa5f1a24d3e------2</link>
            <guid isPermaLink="false">https://medium.com/p/a020ea4cf8c7</guid>
            <category><![CDATA[embedded-linux]]></category>
            <category><![CDATA[linux]]></category>
            <category><![CDATA[version-control]]></category>
            <category><![CDATA[yoctoproject]]></category>
            <category><![CDATA[embedded-systems]]></category>
            <dc:creator><![CDATA[Syed Ali Moajiz Rizvi]]></dc:creator>
            <pubDate>Fri, 06 Feb 2026 10:34:58 GMT</pubDate>
            <atom:updated>2026-02-06T10:34:58.471Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="Practical Yocto Project Guide with Kas and Custom Yocto Layer" src="https://cdn-images-1.medium.com/max/1024/1*cT6NCAKwejADG-cTmB0VMA.jpeg" /></figure><p>The Yocto Project is one of the most prominent projects in Embedded Linux. It powers millions of embedded devices around the globe, which highlights its importance among embedded systems engineers.</p><p>Learning Yocto as a beginner often becomes difficult, especially when there is no access to real hardware, either a development kit or a custom board, that can run Linux. As a beginner, one may gain some theoretical knowledge of Yocto, but often gets confused about where to actually start developing. Eventually, most beginners end up cloning Poky and running bitbake core-minimal-image to generate a minimal Linux image. This is a good starting point, but it does not provide a clear idea about how an actual Yocto project is handled in the real world. Questions like: How are layers added? How does the complete Yocto project structure look? How are real products built using Yocto? Often remain unanswered.</p><p>When I started learning Yocto, the same thing happened to me. I began with great enthusiasm, typing Linux commands in the terminal, waiting for the build to complete after a couple of hours, and finally seeing the image ready. But many questions kept wandering through my mind: How is Yocto actually used in professional projects? Is it enough to just clone Poky and generate a core-minimal-image? Is this really how professional engineers work on real-world products?</p><p>While searching for answers to these questions, I started exploring the Yocto Project in more detail. I learned about BSPs (Board Support Packages) for specific embedded system boards when I began working on Xilinx Zynq-7000 SoC-based boards in a real-world, large-scale project. Later, I also worked with virtualization and running bare-metal firmware on Zynq-A9 using QEMU. One day, I spoke with a professional who had extensive experience with Yocto, and he told me that the main work in Embedded Linux using Yocto revolves around writing and maintaining BSPs. That conversation helped me connect many dots and reshaped my understanding. I realized that Yocto is far bigger and more complex than I had initially imagined.</p><p>I am writing this article with the intention of helping beginners start learning Yocto in a more practical and structured way.</p><blockquote><strong>Note:</strong> If you are completely new to Yocto, it is recommended to first try building a <strong>core-image-minimal</strong> from this <a href="https://epteck.com/getting-started-with-yocto-qemu/">example</a> before moving ahead.</blockquote><h3>Yocto Terminologies:</h3><p>There are a few terminologies that you need to be familiar with before going deeper. I am not going to explain each term word-for-word, as they are already well-documented in the official Yocto <a href="https://docs.yoctoproject.org/overview-manual/concepts.html#yocto-project-components">documentation</a>.</p><h4><strong>Poky:</strong></h4><p>Poky is the reference distribution of the Yocto Project (a starting point). Think of it as a starter kit that contains everything needed to build a custom Linux system from scratch.</p><p>It is the Yocto layer that contains the fundamental Linux system utilities, core software packages, and basic components required to build a working Linux system.</p><h4><strong>Layers:</strong></h4><p>Layers are organized collections of related configurations and software in Yocto. They allow you to keep different parts of a project, such as board support, applications, and custom features, separate and manageable.</p><p>Layers make it easier to work with already existing projects. For example, if a vendor has provided a layer for a specific SoC and you are using that SoC in your own hardware board, you can simply clone that vendor layer and reuse all the SoC-specific configurations and components in your project. In this way, layers help maintain project modularity while also allowing developers to reuse previously developed and tested software in their custom projects.</p><h4><strong>Recipes:</strong></h4><p>Recipes are build instructions for individual software components. For example, if you want to add an application or library to a Linux image, you write or use a recipe for it.</p><h4><strong>BitBake:</strong></h4><p>BitBake is the build tool that drives the entire Yocto Project. It reads all the recipes and layers and automatically compiles everything to generate the final Linux image for a target device.</p><p>Remember, as a yocto project developer, we use the <strong>bitbake</strong> command for everything once the environment is set up.</p><h3>Example project:</h3><p>I have worked on a minimal Yocto project in which I built a Linux image for the <strong>qemuarm64</strong> machine. In this project, I completed the following tasks:</p><ol><li>Added a custom layer named <strong>meta-mylayer</strong> to the Yocto project.</li><li>Developed a simple custom application called <strong>hello</strong> and included it in that layer.</li><li>Created recipes in the custom layer to compile and package the application.</li><li>Added an image recipe in <strong>meta-mylayer</strong> to include the application in the final Linux image.</li><li>Used <strong>kas</strong> to automate the project setup, manage layers, and simplify the build process.</li></ol><p>While going through this article, we will understand things gradually.</p><p>You can find the project at <a href="https://github.com/Ali-Moajiz/yocto-custom-layer-project">yocto-custom-layer-project</a>. Cloning and running guide is provided in the README file.</p><h4>Custom Layer</h4><p>When you clone the project, you will see the following project:</p><pre>~/yocto-custom-layer-project$ ls<br> meta-mylayer project-kas.yml  README.md</pre><p>Where <strong>meta-mylayer </strong>is the example custom layer added in the project, which could be the <em>meta-BSP</em> layer if we are developing the board support package, it could be a <em>meta-app</em> if we need to add some application that our embedded board will be running, or whatever layer you want to add with whatever name. There could be many custom layers added in the project based on the requirements.</p><p>If we dive into the meta-mylayer, we can see:</p><pre>~/yocto-custom-layer-project$ cd  meta-mylayer/<br>~/yocto-custom-layer-project/meta-mylayer$ tree<br>.<br>├── conf<br>│   └── layer.conf<br>├── COPYING.MIT<br>├── README<br>├── recipes-core<br>│   └── images<br>│       └── my-image.bb<br>└── recipes-example<br>    ├── example<br>    │   └── example_0.1.bb<br>    └── hello<br>        ├── files<br>        │   └── hello.c<br>        └── hello.bb<br><br>7 directories, 7 files</pre><p>In our custom layer, we have two directories of recipes, as shown above:</p><ol><li>recipes-core</li><li>recipes-example</li></ol><h4>recipes-example</h4><p>recipes-example directory contains the application “hello.c” whose compilation recipe is “hello/hello.bb”. <em>hello.bb </em>contains the method or recipe that tells bitbake how to compile this application.</p><pre>SUMMARY = &quot;Simple Hello World Application&quot;<br>LICENSE = &quot;MIT&quot;<br>LIC_FILES_CHKSUM = &quot;file://${COMMON_LICENSE_DIR}/MIT;md5=0835ade698e0bcf8506ecda2f7b4f302&quot;<br><br>SRC_URI = &quot;file://hello.c&quot;<br><br>S = &quot;${WORKDIR}&quot;<br><br>do_compile() {<br>    ${CC} ${CFLAGS} ${LDFLAGS} hello.c -o hello<br>}<br><br>do_install() {<br>    install -d ${D}${bindir}<br>    install -m 0755 hello ${D}${bindir}<br>}</pre><p>In short, the above recipe is compiling just a simple C code and installing it into the <em>usr/bin </em>directory of the targeted building Linux image. The details of the above recipe, which is a separate topic, are not in the scope of this article. However, I am giving an overview of each line of the recipe to make things a bit clearer. The following is a short overview of the above recipe file:</p><ul><li><strong>SUMMARY variable </strong>provides a one-line description of the recipe’s purpose, making it easy to identify what the recipe builds</li><li><strong>LICENSE declaration</strong> specifies the software license (MIT) under which the code is distributed, essential for legal compliance in products</li><li><strong>LIC_FILES_CHKSUM</strong> Contains the path to the license file and its MD5 checksum to ensure license integrity.</li><li><strong>SRC_URI definition </strong>tells BitBake where to locate source files. file:// protocol indicates the source is in the recipe&#39;s local files directory</li><li><strong>S variable</strong> Sets the source directory to ${WORKDIR}, which is BitBake&#39;s temporary working space during the build process.</li><li><strong>do_compile() task:</strong> Defines the compilation steps of the source code.</li><li><strong>do_install() task: </strong>Handles installation of the compiled binary. It copies the binaries from the compilation directory into the destination holding area. This holding acts as a staging root filesystem later used by some other task to create final, deployable packages (e.g., .ipk, .rpm, .deb).</li></ul><h4>recipes-core</h4><p>The “recipe-core” directory contains the main image recipe, which is responsible for building the <strong>final Linux image</strong>.</p><p>This recipe is the <strong>entry point </strong>for BitBake when generating the image. It decides:</p><ul><li>Which packages and applications are included.</li><li>Which other recipes must be built as dependencies.</li><li>What content goes into the final root filesystem.</li></ul><p>The following is the my-image.bb recipe file:</p><pre>SUMMARY = &quot;My Custom Test Image&quot;<br><br>require recipes-core/images/core-image-base.bb<br><br>IMAGE_INSTALL += &quot; \<br>    packagegroup-core-boot \<br>    hello \<br>&quot;</pre><ul><li><strong>SUMMARY</strong>: Provides a short description of the image.</li><li><strong>require</strong>: Imports and extends the standard Yocto core-image-base recipe, which already defines the kernel, BusyBox, init system, and base root filesystem.</li><li><strong>IMAGE_INSTALL +=</strong>: Adds extra packages to the image:</li><li>packagegroup-core-boot: Essential boot components and runtime utilities.</li><li>hello: custom application is defined in hello.bb.</li></ul><h4>Summary of Recipes</h4><ul><li><strong>Application recipes</strong> (like hello.bb) define how to build and install programs.</li><li><strong>Image recipes</strong> (like my-image.bb) define the complete Linux image and assemble multiple packages.</li><li>BitBake automatically resolves dependencies, compiles applications, and produces the final bootable image.</li><li>This separation of <strong>application logic</strong> and <strong>image assembly</strong> is standard practice in Yocto development.</li></ul><h4>Learnings from the Project</h4><p>In the above project, we explored what a standard Yocto project looks like. The key takeaway is that if you want to build a custom Linux image for an embedded project, Yocto layers are the fundamental building blocks. Within a Yocto layer, recipes make it much easier to manage different software components in a structured and modular way. This approach makes Yocto a powerful tool for scalable and long-term embedded projects.</p><p>We also saw how simple it is to create a custom Yocto layer and integrate it into the project. By doing this, we avoided making direct changes to the core Linux image or the standard Yocto layers. Instead, we only needed to add our own custom layers as required, and BitBake handled the rest of the complexity for us.</p><h3>KAS and Version Control in a Yocto Project</h3><p>The Yocto Project is a powerful tool for building custom Linux images. Its layer-based architecture makes it highly flexible and well-suited for version control and collaborative development. In a typical development environment, multiple team members work on different parts of the project. For example, one developer may focus on user-space applications, a few may work on the Board Support Package (BSP), and another may be responsible for customizing the Linux distribution. Each developer can create and maintain their own Yocto layer to handle their specific tasks independently.</p><p>However, as the project grows, integrating all these layers into a single build environment can become complex and difficult to manage. Several approaches exist to simplify this process, such as using Git submodules or Google’s Repo tool. While these methods help to some extent, they still require manual effort and careful coordination.</p><p>This is where <strong>KAS (Setup Tool for Yocto Projects)</strong> becomes extremely useful. KAS provides a structured and automated way to manage multi-repository Yocto projects. It uses simple YAML configuration files to define project components, repositories, layers, and build settings. With a single KAS configuration file, the entire process of cloning repositories, setting up the build environment, configuring layers, and starting the build can be fully automated.</p><p>Instead of manually setting up and maintaining multiple repositories or multiple layers within the same repository, developers only need to maintain a KAS YAML file. KAS then handles the rest, making project setup reproducible, consistent, and much easier to manage across teams and machines.</p><p>Please refer to the <a href="https://kas.readthedocs.io/en/latest/"><em>KAS documentation</em></a> for more info.</p><h4>Understanding How KAS Was Used in This Project</h4><p>In this project, the main goal was to keep the repository clean and lightweight. I only wanted to version-control my <strong>custom Yocto layer and project configuration</strong>, not the full Yocto ecosystem, such as poky or openembedded layers. This is exactly where <strong>KAS</strong> played a key role.</p><p>Following is the project-kas.yml file of my project:</p><pre>header:<br>  version: 14<br><br>machine: qemuarm64<br>distro: poky<br><br>target:<br>  - my-image<br><br>repos:<br>  poky:<br>    url: https://git.yoctoproject.org/git/poky<br>    branch: kirkstone<br>    path: poky<br>    layers:<br>      meta:<br>      meta-poky:<br>      meta-yocto-bsp:<br><br>  meta-mylayer:<br>    path: meta-mylayer<br><br>local_conf_header:<br>  standard: |<br>    CONF_VERSION = &quot;2&quot;<br>    PACKAGE_CLASSES ?= &quot;package_rpm&quot;<br>    EXTRA_IMAGE_FEATURES ?= &quot;debug-tweaks&quot;<br>    USER_CLASSES ?= &quot;buildstats&quot;<br>    PATCHRESOLVE = &quot;noop&quot;</pre><ul><li><strong>Header</strong>: Specifies kas tool version 14 for compatibility</li><li><strong>Machine</strong>: qemuarm64 targets ARM 64-bit emulated hardware for testing</li><li><strong>Target</strong>: my-image is the image recipe that will be built</li><li><strong>Poky Repository</strong>: Clone the official Poky repository and checkout to the branch kirkstone</li><li><strong>Layers</strong>: Includes meta, meta-poky, and meta-yocto-bsp from poky</li><li><strong>Custom Layer</strong>: meta-mylayer is the local layer for custom recipe</li></ul><h4>Why KAS Was Needed</h4><p>A normal Yocto project setup usually requires developers to:</p><ul><li>Manually clone multiple repositories (poky, meta-openembedded, etc.)</li><li>Configure bblayers.conf and local.conf</li><li>Set up environment variables</li><li>Maintain all those repositories in sync</li></ul><p>If I had followed the traditional approach, I would have needed to push large standard repositories to GitHub along with my project. That would make the repository huge, hard to maintain, and unnecessary.</p><h4>How KAS Solved the Problem</h4><p>Instead of pushing everything to GitHub, I used KAS to separate:</p><ul><li><strong>Project logic (my custom layer + config) -&gt; </strong>stored in GitHub</li><li><strong>Standard Yocto layers (poky, meta-openembedded, etc.) -&gt; </strong>fetched automatically by KAS</li></ul><p>This allowed me to keep the repository focused only on what I actually developed.</p><h4>Conceptual Workflow</h4><p>Using KAS, the project workflow becomes simple and streamlined:</p><ol><li>Create and maintain the custom Yocto layer (meta-mylayer).</li><li>Define all project details in a single project-kas.yml file.</li><li>Push only the custom layer and YAML file to GitHub.</li><li>Clone the repository on any machine.</li><li>Run one command to build the project with KAS.</li><li>KAS automatically fetches required layers, configures the environment, and starts the Yocto build.</li></ol><h4>Importance for Real Projects</h4><p>This small project clearly demonstrates why KAS is so important in professional Yocto development:</p><ul><li>It keeps Git repositories small and clean</li><li>It avoids duplicating standard Yocto sources</li><li>It makes the project reproducible on any machine</li><li>It simplifies collaboration between multiple developers</li><li>It automates environment setup completely</li></ul><p>Even though this example project is simple, the same concept scales perfectly to large industrial Yocto projects with many layers and teams.</p><h3>Conclusion</h3><p>In this article, I have tried to help beginners approach Yocto in a more practical and realistic way, instead of just building Poky and experimenting randomly inside it. I shared a minimal project that I personally worked on while learning Yocto, with the aim of providing a hands-on and structured starting point.</p><p>Although there is a large amount of excellent Yocto documentation available online, getting started can still feel overwhelming. A simple and focused project guide like this can help beginners build an initial mental model and understand the core concepts more effectively.</p><p>By cloning and running the provided project, readers can gain a clearer understanding of how custom layers are added to a Yocto project and how KAS simplifies project setup and management. The goal is to make Yocto more approachable and to provide a practical foundation for further learning and experimentation.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=a020ea4cf8c7" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Exploring TCP Duplicate Acknowledgments (DUPACK) and Fast Retransmit: Insights from a Recent MQTT…]]></title>
            <link>https://medium.com/@alimoajiz999/exploring-tcp-duplicate-acknowledgments-dupack-and-fast-retransmit-insights-from-a-recent-mqtt-863a9d8c4cb8?source=rss-daa5f1a24d3e------2</link>
            <guid isPermaLink="false">https://medium.com/p/863a9d8c4cb8</guid>
            <category><![CDATA[mqtt]]></category>
            <category><![CDATA[networking]]></category>
            <category><![CDATA[tcp-ip]]></category>
            <category><![CDATA[wireshark]]></category>
            <category><![CDATA[embedded-systems]]></category>
            <dc:creator><![CDATA[Syed Ali Moajiz Rizvi]]></dc:creator>
            <pubDate>Fri, 30 Aug 2024 14:52:12 GMT</pubDate>
            <atom:updated>2024-08-30T14:52:12.610Z</atom:updated>
            <content:encoded><![CDATA[<h3>Exploring TCP Duplicate Acknowledgments (DUPACK) and Fast Retransmit: Insights from a Recent MQTT Over TCP/IP Project</h3><p>Recently, while working on MQTT over TCP/IP using the TCP LwIP stack with Ethernet, I encountered “TCP DUPACK” during analysis with Wireshark. This highlighted some interesting learning opportunities in networking and protocol optimization. The scenario was that two telemetries were of size 1024 bytes each and were sent to the broker with a delay of 9 ms at QoS = 1, which is quite quick w.r.t. the size of the telemetries. TCP causes some packet loss due to congestion, resulting in out-of-order packet delivery. This triggers Duplicate Acknowledgments (DUPACKs) from the receiver, which inform the sender about the missing packets and prompt it to resend them quickly.</p><p>The TCP Duplicate Acknowledgment (DUPACK) occurs when a receiver acknowledges the same data packet more than once. This happens when packets arrive out of order or if packets are lost. These DUPACKs are crucial for TCP congestion control and loss recovery mechanisms.</p><h4>Causes of DUPACKs:</h4><p>1. <strong>Out-of-Order Packets</strong>: When packets are received out of order, the receiver sends DUPACKs for the last in-sequence packet received.</p><p>2.<strong> Packet Loss</strong>: If a packet is lost, subsequent packets will generate DUPACKs until the missing packet is retransmitted and successfully received.</p><h4>TCP Fast Retransmit and Fast Recovery:</h4><p>Fast Retransmit: If a sender receives three consecutive DUPACKs, it infers that a packet has likely been lost and retransmits the missing packet without waiting for the retransmission timer to expire.</p><p>Fast Recovery: After performing a fast retransmit, the sender enters fast recovery mode. Instead of entering congestion avoidance immediately, it reduces the congestion window and continues to send new data, aiming to quickly recover from packet loss and avoid significant performance degradation.</p><h4>Benefits of TCP DUPACKS:</h4><p><strong>Quick Loss Detection</strong>: It helps in quickly identifying lost packets without waiting for a timeout.</p><p><strong>Maintains Flow</strong>: Keeps data flowing by retransmitting lost packets and adjusting the congestion window accordingly.</p><h4>Example Scenario:</h4><p>1. Normal Transmission: Packets 1, 2, 3, 4, and 5 are sent.<br>2. Packet Loss: Packet ‘3’ is lost.<br>3. DUPACKS: The receiver gets packets 4, 5, and sends DUPACKs for packet ‘3&#39;<br>4. Fast Retransmit: The sender gets three DUPACKS and retransmits packet ‘3’<br>5. Fast Recovery: The sender halves the congestion window, sends new packets, and waits for ACKs.</p><h4>My Observations on Wireshark:</h4><p>In the following snapshot from my Wireshark instance, it can be seen that multiple “TCP DUPACK” entries alongside MQTT Publish Messages clearly demonstrate the scenario of dealing with high-frequency data transmission and the importance of understanding TCP/IP dynamics for efficient network communication. The capture also includes “TCP Fast Retransmission” packets, which occur when the sender quickly retransmits the lost packet before the timeout, reducing the overall delay in the communication.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/800/1*rCY_1etFNyTbCWBdcfidkw.jpeg" /></figure><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=863a9d8c4cb8" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[“clk_ignore_unused” Bootarg in OpenAMP Framework and Shared Peripherals Issue (Bare-Metal and…]]></title>
            <link>https://medium.com/@alimoajiz999/clk-ignore-unused-bootarg-in-openamp-framework-and-shared-peripherals-issue-bare-metal-and-b75a986bc995?source=rss-daa5f1a24d3e------2</link>
            <guid isPermaLink="false">https://medium.com/p/b75a986bc995</guid>
            <category><![CDATA[heterogeneous-multi-core]]></category>
            <category><![CDATA[embedded-linux]]></category>
            <category><![CDATA[openamp-ramework]]></category>
            <category><![CDATA[petalinux]]></category>
            <category><![CDATA[xilinx-zynq]]></category>
            <dc:creator><![CDATA[Syed Ali Moajiz Rizvi]]></dc:creator>
            <pubDate>Sat, 25 May 2024 17:36:41 GMT</pubDate>
            <atom:updated>2024-08-20T15:24:30.437Z</atom:updated>
            <content:encoded><![CDATA[<h3>“clk_ignore_unused” Bootarg in OpenAMP Framework and Shared Peripherals Issue (Bare-Metal and PetaLinux Running On Two Cores of the CPUs — Xilinx Zynq 7000 SoC)</h3><h4><strong>Integrating Petalinux with Bare-Metal Firmware: Lessons Learned</strong></h4><p>In this article, I’ll share my recent experience working with the OpenAMP framework, specifically integrating Petalinux (running on core1) with an already-developed bare-metal application firmware. This firmware was quite large, encompassing many features of the application, including several interrupts and the initialization of peripherals such as I2C, SPI, and QSPI. These need to be initialized in the bare-metal firmware rather than in the Petalinux environment. Linux was booting first, and then it was booting the bare-metal firmware.</p><h4>The Challenge: Peripheral Clocks Initialization</h4><p>Initially, the integration seemed successful. Petalinux was running smoothly alongside the bare-metal application. However, during testing, I encountered a critical issue: SPI and I2C were not being initialized in the bare-metal application.</p><p>To understand why this was happening, it’s important to know that the Linux kernel has the default behavior of disabling unused clocks to handle power management efficiently. This particularly happens when the device drivers are not able to claim clocks properly during boot time.</p><p>In an Asymmetric Multiprocessing (AMP) system, this behavior becomes critical since if the clocks are already disabled by the kernel initially, it will be impossible for the non-Linux firmware (that is booting after Linux and by Linux) to access or initialize peripherals like SPI that need clocks for communication.</p><p>That was the issue in my case. The clocks for these peripherals were not enabled by the kernel during the boot process and this was causing the inaccessibility of the application firmware to initialize these peripherals</p><h4>Kernel Bootargs Explained</h4><p>Kernel boot arguments, or bootargs, are parameters passed to the Linux kernel at the time of booting. These parameters can configure various aspects of the kernel’s behavior, such as hardware initialization settings, debugging options, and performance tweaks. By adjusting the bootargs, users can modify how the kernel interacts with the system’s hardware and software components.</p><h4>What is `clk_ignore_unused`?</h4><p>The `clk_ignore_unused` parameter is a kernel boot argument used in the Linux operating system. When included in the kernel command line configuration, it ensures that any clocks not explicitly in use remain enabled, rather than being disabled by the device tree settings. This is particularly useful in scenarios where non-Linux firmware or applications need access to hardware peripherals that are otherwise disabled by default in the device tree. By keeping these clocks enabled, `clk_ignore_unused` prevents issues with peripheral accessibility and allows seamless operation of integrated bare-metal firmware and Petalinux environments.</p><h4>The Solution: Kernel Bootarg Configuration</h4><p>To resolve this, we included the kernel bootarg `clk_ignore_unused` in the kernel command line configuration and added `status = “disabled”` for the SPI and I2C in the system user.dtsi file. This addition ensures that any unused clocks remain enabled rather than being disabled by the device trees. Disabling SPI in the device tree ensures that SPI is completely deactivated since I need to initialize the SPI and I2C in the non-Linux firmware running on core 1 of the CPU.</p><p>In Petalinux, you can set this Bootarg by adding it to the last line of the `config` file located at `<strong>&lt;path_to_your_petalinux_project&gt;/project-spec/meta-user/configurations/config</strong>`.</p><h4>Conclusion</h4><p>Integrating Petalinux with a substantial bare-metal application firmware can present challenges, especially concerning peripheral initialization. Understanding the kernel’s approach to device driver initialization and clock management is vital. The inclusion of the `clk_ignore_unused` boot argument can mitigate issues related to peripheral accessibility in the AMP system, thereby facilitating a smoother integration process..</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=b75a986bc995" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>