<?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 Deepthi Nayak on Medium]]></title>
        <description><![CDATA[Stories by Deepthi Nayak on Medium]]></description>
        <link>https://medium.com/@deepthinayakwrites?source=rss-ac686d3b0d15------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*_dyYxBndSnblgPfUDGXkfg.jpeg</url>
            <title>Stories by Deepthi Nayak on Medium</title>
            <link>https://medium.com/@deepthinayakwrites?source=rss-ac686d3b0d15------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Sun, 06 Dec 2026 14:02:27 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@deepthinayakwrites/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[“Hello World” on Kria KV260 — Part 2: Building the Software in Vitis]]></title>
            <link>https://medium.com/@deepthinayakwrites/hello-world-on-kria-kv260-part-2-building-the-software-in-vitis-af32461397b0?source=rss-ac686d3b0d15------2</link>
            <guid isPermaLink="false">https://medium.com/p/af32461397b0</guid>
            <category><![CDATA[hello-world]]></category>
            <category><![CDATA[vitis]]></category>
            <category><![CDATA[fpga]]></category>
            <category><![CDATA[kv260]]></category>
            <category><![CDATA[vivado]]></category>
            <dc:creator><![CDATA[Deepthi Nayak]]></dc:creator>
            <pubDate>Sat, 11 Jul 2026 05:41:00 GMT</pubDate>
            <atom:updated>2026-07-11T15:52:20.245Z</atom:updated>
            <content:encoded><![CDATA[<p><em>This is Part 2 of a 3-part beginner’s guide to running your first bare-metal program on the Kria KV260. </em><a href="https://medium.com/@deepthinayakwrites/hello-world-on-kria-kv260-part-1-building-the-hardware-in-vivado-e96a8f3b5750"><em>Part 1</em></a><em> covered Vivado (hardware). This part covers Vitis (software). </em><a href="https://medium.com/@deepthinayakwrites/hello-world-on-kria-kv260-part-3-running-it-on-the-board-8ca070c8e9e5"><em>Part 3</em></a><em> covers running it on the board.</em></p><h3>Quick Recap</h3><p>In Part 1, we used Vivado to design a minimal hardware setup for the KV260 (just the processor and its basic peripherals), compiled it into a bitstream, and exported everything into a single file called design.xsa.</p><p>In this part, we’ll switch over to <strong>Vitis</strong> — the tool used to write and compile <em>software</em> — and use that XSA file to build a simple “Hello World” program that’s ready to run on the board’s processor.</p><p><strong>Quick terminology refresher:</strong></p><ul><li><strong>XSA</strong> — the file from <a href="https://medium.com/@deepthinayakwrites/hello-world-on-kria-kv260-part-1-building-the-hardware-in-vivado-e96a8f3b5750">Part 1</a> describing our hardware to Vitis</li><li><strong>BSP (Board Support Package)</strong> — auto-generated code that lets our program talk to the hardware</li><li><strong>Bare-metal</strong> — running code directly on the processor, with no operating system underneath it</li><li><strong>ELF</strong> — the compiled, ready-to-run version of our program.</li></ul><h3>Step 1: Launch Vitis</h3><p>Open Vitis. It will ask you to pick a <strong>workspace</strong> — this is just a folder on your computer where all your Vitis projects will be saved. Any folder works, for example:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*XzbXmU6bHKVh4gth3fMQLg.png" /></figure><h3>Step 2: Create a Platform Project</h3><p>A “Platform” in Vitis is basically Vitis’s understanding of your hardware — built from the XSA file Vivado gave us.</p><p><strong>File → New Component → Platform</strong> (in older versions: <strong>File → New → Platform Project</strong>)</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/679/1*EGtI3a7R32YpDU1lQ6u1UQ.png" /></figure><p>Give a name to the platform and browse the saving location.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*PxzDUnLY46BVAu6wBkFMnw.png" /></figure><p>Browse to and select the design.xsa file you exported in Part 1, then click <strong>Finish</strong>. Vitis will read the file and automatically generate a Board Support Package (BSP) — the glue code that lets our program talk to the hardware.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*7kiBpjqX4im1-3VBAtPvYg.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*_tLAe2lccVpsnamDOrTyZQ.png" /></figure><h3>Step 3: Create the Application Project</h3><p>Now we create the actual program. A list of examples is available in a section of left side of the window, you can find the hello_world application there.</p><p>It is a template program, create application component from template.</p><p>Go to:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*6jyEo3zuKTf9yBj8XRhuHQ.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*jOwoZdRrsSSAgKs4MJWrQw.png" /></figure><p>Walk through the wizard and configure:</p><ul><li><strong>Platform:</strong> the platform you just created in Step 2</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*v1kapGa6J9sr9i4X2lEMaQ.png" /></figure><ul><li><strong>Processor:</strong> psu_cortexa53_0 — this is the KV260&#39;s main ARM processor (the &quot;A53&quot; cores). There are other processor options too, but this is the one we want for this tutorial.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*KZgi2n2hRx1rvQ_IfJY9Lg.png" /></figure><ul><li><strong>Domain type:</strong> Standalone (this means “bare-metal,” i.e., no operating system)</li><li>Hello World — Vitis includes this template so you don’t have to write the code yourself. It’s a tiny C program that just prints “Hello World” using printf().</li></ul><p>Click <strong>Finish</strong>. Your left panel will look like this :</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/440/1*zF809UWf-VFVuTjVIo5WPQ.png" /></figure><h3>Step 4: Build the Project</h3><p>Right-click your application in the <strong>Explorer</strong> panel and choose <strong>Build Project</strong> (or click the hammer icon). This compiles your C code into an executable file — called an <strong>ELF</strong> — that the processor can actually run.</p><p>If you’re curious, you can open the helloworld.c file that was generated and see the code for yourself. It&#39;s short — just a few lines wrapped around a single print(&quot;Hello World\n\r&quot;) call.</p><h3>What’s Next</h3><p>At this point you have a compiled ELF file ready to run, and the bitstream from <a href="https://medium.com/@deepthinayakwrites/hello-world-on-kria-kv260-part-1-building-the-hardware-in-vivado-e96a8f3b5750">Part 1</a> ready to configure the FPGA. In <a href="https://medium.com/@deepthinayakwrites/hello-world-on-kria-kv260-part-3-running-it-on-the-board-8ca070c8e9e5"><strong>Part 3</strong></a>, we’ll connect the physical board, program it, and actually watch “Hello World” print out on a serial terminal.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=af32461397b0" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[“Hello World” on Kria KV260 — Part 1: Building the Hardware in Vivado]]></title>
            <link>https://medium.com/@deepthinayakwrites/hello-world-on-kria-kv260-part-1-building-the-hardware-in-vivado-e96a8f3b5750?source=rss-ac686d3b0d15------2</link>
            <guid isPermaLink="false">https://medium.com/p/e96a8f3b5750</guid>
            <category><![CDATA[kv260]]></category>
            <category><![CDATA[vitis]]></category>
            <category><![CDATA[fpga]]></category>
            <category><![CDATA[vivado]]></category>
            <dc:creator><![CDATA[Deepthi Nayak]]></dc:creator>
            <pubDate>Sat, 11 Jul 2026 05:41:00 GMT</pubDate>
            <atom:updated>2026-07-11T15:52:57.235Z</atom:updated>
            <content:encoded><![CDATA[<p><em>This is Part 1 of a 3-part beginner’s guide to running your first bare-metal program on the Kria KV260. Part 1 covers Vivado (hardware). </em><a href="https://medium.com/@deepthinayakwrites/hello-world-on-kria-kv260-part-2-building-the-software-in-vitis-af32461397b0"><em>Part 2</em></a><em> covers Vitis (software). </em><a href="https://medium.com/@deepthinayakwrites/hello-world-on-kria-kv260-part-3-running-it-on-the-board-8ca070c8e9e5"><em>Part 3</em></a><em> covers running it on the board.</em></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/355/0*S31VsHrTaEQjFbJ7" /><figcaption>Kria KV260 Vision AI starter Kit</figcaption></figure><p>If you just unboxed a Kria KV260 and opened Vivado for the first time, you’ve probably felt a little overwhelmed. There are a lot of new words — bitstream, XSA, BSP, JTAG — and it’s not obvious what order things happen in or why.</p><p>This series is written for exactly that stage. We’re not building anything fancy — just a simple program that prints “Hello World” to your screen, running directly on the board’s processor with no operating system involved (that’s what “bare-metal” means). But getting <em>that</em> working end-to-end teaches you the entire basic workflow you’ll reuse for every future project on this board.</p><p>By the end of this series, you’ll have:</p><ul><li>A basic hardware design built in Vivado</li><li>That design exported and handed off to Vitis</li><li>A simple C program compiled for the board’s ARM processor</li><li>That program running live on the KV260, with output showing up on your laptop screen</li></ul><p><strong>In this part specifically</strong>, we’ll just cover the Vivado side: designing the hardware and exporting it so Vitis can use it.</p><p><strong>What you’ll need installed:</strong></p><p>Tool version used here — Vivado2023.2, Vitis2023.2, Board: Kria KV260</p><blockquote><em>Don’t worry if you have a slightly different version (2022.x–2024.x). The steps are almost identical — a few menus might just look a little different. But all have to be of same version.</em></blockquote><h3>A Few Terms Explained First</h3><p>Before diving in, here’s a plain-English glossary for words you’ll see a lot across this series:</p><ul><li><strong>Vivado</strong> — the tool used to design the <em>hardware</em> side: what chips, connections, and processors your board will use.</li><li><strong>Vitis</strong> — the tool used to write and compile <em>software</em> that runs on that hardware.</li><li><strong>Bitstream</strong> — the final file that tells the FPGA part of the chip exactly how to configure itself. Think of it as “hardware, compiled.”</li><li><strong>XSA</strong> — a file that packages up your hardware design so Vitis knows what processor and peripherals it’s writing software for.</li><li><strong>BSP (Board Support Package)</strong> — auto-generated code that lets your program talk to the hardware (things like enabling the serial port).</li><li><strong>JTAG</strong> — a cable/interface used to load your program onto the board and debug it.</li><li><strong>UART</strong> — the serial connection used to see text output (like our “Hello World” message) on your computer.</li><li><strong>Bare-metal</strong> — running code directly on the processor, with no operating system (like Linux) underneath it.</li></ul><p>Keep this list handy — you’ll see these terms throughout the series.</p><h3>What You Need Before Starting</h3><p>Make sure you have:</p><ul><li>Vivado installed on your computer</li><li>A power supply for the KV260 (you don’t need to power it on yet for this part)</li></ul><h3>The Big Picture First</h3><p><strong>Vivado builds the hardware, Vitis builds the software that runs on it, and then we send both over to the board.</strong> This part covers just the Vivado part.</p><h3>Step 1: Create a Vivado Project</h3><p>Open Vivado and start a new project (<strong>File → New Project</strong>).</p><ul><li>Create a new project.</li><li>Check <strong>Do not specify sources at this time</strong> — we don’t have any files to add yet, so leave this blank for now</li><li>When it asks you to pick a device, don’t search for a chip part number — instead, switch to the <strong>Boards</strong> tab and search for:</li><li><strong>Kria KV260 Vision AI Starter Kit — </strong>Picking the board (instead of a raw chip) means Vivado already knows about the KV260’s specific wiring, so it can help automate a lot of the setup for you.</li></ul><h3>Step 2: Create a Block Design</h3><p>A “Block Design” is Vivado’s visual, drag-and-drop way of wiring hardware blocks together.</p><ul><li>Go to <strong>IP Integrator → Create Block Design</strong>, give it any name</li><li>In the empty canvas that appears, click the <strong>+</strong> button and search for <strong>Zynq UltraScale+ MPSoC</strong> — this is the KV260’s processor chip. Add it to the canvas.</li><li>Along the top of the canvas, you’ll see a green banner suggesting <strong>Block Automation</strong> — click it and accept the defaults.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/475/1*w_OqnnA0raDN-5UnDVb1aw.png" /></figure><p>Double Click the component and remove AXI, interrupt related ports in re-customize IP dialog box as shown below, and just keep the clock and reset enabled.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/659/1*EjkkXD0XASZT-25CGkpPLg.png" /><figcaption>AXI disabled</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/684/1*j_LQ962dy-aGcoSkjAiq6A.png" /><figcaption>IRQ disabled</figcaption></figure><p>Overall block design will look like this —</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/560/1*iHg3aKsCIg5sCDluvjuOew.png" /><figcaption>Block Design of Zynq US + MPSoC</figcaption></figure><h3>Step 3: Validate the Design</h3><p>Before moving on, it’s good practice to check for mistakes. Click <strong>Validate Design</strong> (or press F6). If everything is wired correctly, you’ll see a “validation successful” message with no errors.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/595/1*zHc1eFYbjZXGG9k44ElEuw.png" /></figure><h3>Step 4: Generate the HDL Wrapper</h3><p>Right now our design is just a visual diagram — we need to convert it into actual hardware description code that Vivado can build. In the <strong>Sources</strong> panel, right-click your block design and choose: <strong>Create HDL Wrapper</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/546/1*fYZgy_ZA2xUVVf0S_bqwkg.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/617/1*y5M2DHYo8RJoxnSk94nCdA.png" /></figure><p>Choose <strong>“Let Vivado auto update and manage wrapper”</strong> and click OK. Think of this as Vivado translating your diagram into a format it can actually compile.</p><h3>Step 5: Generate the Bitstream</h3><p>Now we compile everything into the file that configures the FPGA’s hardware. Click <strong>Generate Bitstream</strong> (found under <strong>Program and Debug</strong> in the Flow Navigator on the left).</p><p>This step runs synthesis and implementation — Vivado’s way of turning your design into an actual hardware layout. It can take few minutes depending on your computer, so this is a good time for a coffee break. When it’s done, click <strong>Cancel</strong> on the popup (we don’t need to open the implemented design).</p><h3>Step 6: Export Hardware</h3><p>Now we package everything up to hand off to Vitis. Go to:</p><p><strong>File → Export Hardware</strong></p><p>Make sure the <strong>Include bitstream</strong> option is checked (this bundles the compiled hardware in with the description, rather than just the description alone), then click through and finish.</p><p>This creates a design.xsa file. Think of this single file as &quot;everything Vitis needs to know about our hardware.&quot;</p><h3>What’s Next</h3><p>At this point you have a design.xsa file sitting on your computer — that&#39;s the finish line for the hardware side. In <a href="https://medium.com/@deepthinayakwrites/hello-world-on-kria-kv260-part-2-building-the-software-in-vitis-af32461397b0"><strong>Part 2</strong></a>, we&#39;ll switch over to Vitis, import this XSA, and write and compile the actual &quot;Hello World&quot; program that will run on the processor.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=e96a8f3b5750" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[“Hello World” on Kria KV260 — Part 3: Running It on the Board]]></title>
            <link>https://medium.com/@deepthinayakwrites/hello-world-on-kria-kv260-part-3-running-it-on-the-board-8ca070c8e9e5?source=rss-ac686d3b0d15------2</link>
            <guid isPermaLink="false">https://medium.com/p/8ca070c8e9e5</guid>
            <category><![CDATA[kv260]]></category>
            <category><![CDATA[vitis]]></category>
            <category><![CDATA[fpga]]></category>
            <category><![CDATA[hello-world]]></category>
            <category><![CDATA[vivado]]></category>
            <dc:creator><![CDATA[Deepthi Nayak]]></dc:creator>
            <pubDate>Sat, 11 Jul 2026 05:41:00 GMT</pubDate>
            <atom:updated>2026-07-11T15:50:53.961Z</atom:updated>
            <content:encoded><![CDATA[<p><em>This is Part 3 of a 3-part beginner’s guide to running your first bare-metal program on the Kria KV260. </em><a href="https://medium.com/@deepthinayakwrites/hello-world-on-kria-kv260-part-1-building-the-hardware-in-vivado-e96a8f3b5750"><em>Part 1</em></a><em> covered Vivado (hardware). </em><a href="https://medium.com/@deepthinayakwrites/hello-world-on-kria-kv260-part-2-building-the-software-in-vitis-af32461397b0"><em>Part 2 </em></a><em>covered Vitis (software). This part covers connecting the board and running the program.</em></p><h3>Quick Recap</h3><p>So far, we’ve:</p><ul><li><a href="https://medium.com/@deepthinayakwrites/hello-world-on-kria-kv260-part-1-building-the-hardware-in-vivado-e96a8f3b5750"><strong>Part 1</strong></a><strong>:</strong> Designed a minimal hardware setup in Vivado and exported it as a bitstream + design.xsa</li><li><a href="https://medium.com/@deepthinayakwrites/hello-world-on-kria-kv260-part-2-building-the-software-in-vitis-af32461397b0"><strong>Part 2</strong></a><strong>:</strong> Used that XSA in Vitis to build a compiled “Hello World” program (an ELF file)</li></ul><p>Now for the fun part — connecting the actual board and watching it run.</p><h3>What You Need Before Starting</h3><ul><li>Vivado and Vitis, both still open (or ready to reopen) with your Part 1/2 project</li><li>Xilinx/AMD USB cable drivers installed (these let your computer talk to the board)</li><li>A USB-UART cable connected between your computer and the KV260</li><li>A power supply for the KV260</li><li>(You do <strong>not</strong> need a microSD card for this tutorial — we’re loading the program directly over USB, not booting from SD.)</li></ul><h3>Step 1: Connect the Board</h3><p>Make sure the following are all connected:</p><ul><li>The <strong>USB-JTAG</strong> cable (usually the same micro-USB port used for JTAG and UART together on the KV260) — this is how Vitis loads your program onto the board</li><li>The <strong>USB-UART</strong> connection — this is how you’ll see your program’s text output</li><li><strong>Power</strong> — plug in the KV260’s power supply and switch it on</li></ul><p>On many KV260 setups, JTAG and UART share a single USB cable, so you may only need to plug in one cable here.</p><p>Now, on your computer, open the device manager and look at COM ports it is connected to.</p><p>If you see two, the UART one is usually the higher-numbered of the pair — if you pick the wrong one, don&#39;t worry, you can just try the other.</p><h3>Step 2: Open a Serial Terminal</h3><p>This is the “screen” where we’ll actually see our Hello World message. We’ll use a tool called PuTTY:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/590/1*texB4cQhgj2IhTM1hboFxQ.png" /></figure><p>Make sure these serial settings match :</p><ul><li><strong>Baud rate:</strong> 115200</li><li><strong>Data bits:</strong> 8</li><li><strong>Parity:</strong> None</li><li><strong>Stop bits:</strong> 1</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/585/1*4cnakHz8A9Z0NFrDGz9v4g.png" /></figure><p>Leave this terminal window open — we’ll come back to it in a moment.</p><h3>Step 3: Program the FPGA</h3><p>Back in Vitis, we need to configure the board’s hardware using the bitstream from Part 1. In the <strong>Xilinx</strong> menu (or the Hardware Manager toolbar icon):</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/816/1*9DxDFo_IOEbuGphA-EM6nw.png" /></figure><p><strong>Program Device</strong>, then select the generated bitstream file.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*_tKpI17XY_BtKIxhbRRSgw.png" /></figure><p>This step physically configures the FPGA logic on the chip to match the hardware design we built in Vivado. Without this, the processor wouldn’t be wired up correctly for our program to run.</p><h3>Step 4: Run the Application</h3><p>Almost there! Run your application project (from Part 2) in the Explorer panel:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/388/1*dgt8FdCu1jNMrhkuKu66UA.png" /></figure><p>Vitis will connect over JTAG, load your compiled program (the ELF) onto the processor, and start it running — all automatically.</p><h3>Expected Output</h3><p>Switch back to your PuTTY terminal window. You should see:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/452/1*wlyhJmII_q-EVykdPgERBg.png" /><figcaption>PuTTY terminal</figcaption></figure><p>🎉 That’s it — congratulations! You just built a hardware design from scratch, wrote and compiled a program for it, and watched it run live on real silicon. That’s genuinely the whole loop that every embedded project uses, just in miniature.</p><h3>What Actually Happened (For the Curious)</h3><p>It’s worth pausing to connect the dots across all three parts, since it makes the next project much easier:</p><ol><li>In Vivado, you described a piece of hardware — in this case, just “turn on the processor and its basic peripherals.”</li><li>Vivado compiled that description into a bitstream — the literal configuration data for the FPGA fabric.</li><li>The XSA file carried a description of that hardware over to Vitis, so Vitis knew things like “there’s a UART here” and “here’s the processor to compile for.”</li><li>Vitis used that information to auto-generate a BSP, which is the low-level code that knows how to talk to your specific hardware — including how to send data out the UART.</li><li>Your Hello World program called printf(), which under the hood used that UART driver from the BSP to send text out over the serial cable.</li><li>Programming the device configured the FPGA hardware, and launching the app loaded and started your compiled code on the processor.</li></ol><p>Once this clicks, every future project is really just “change the hardware in Vivado” and/or “change the code in Vitis,” repeating this same basic loop.</p><h3>Conclusion</h3><p>You’ve now done everything it takes to get a custom program running on the Kria KV260 from a completely blank project: designed hardware in Vivado, exported it, built a matching software platform in Vitis, compiled a bare-metal application, and run it live on the board.</p><p>This same loop is the foundation for everything else you’ll build on this board, whether that’s adding your own custom hardware logic, writing more complex bare-metal programs, or eventually moving up to a full Linux-based environment with PetaLinux.</p><p>If you made it this far and saw “Hello World” print out, you’re no longer a complete beginner with this toolchain — nice work.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=8ca070c8e9e5" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[How to Create Custom Partitions on an SD Card in WSL2]]></title>
            <link>https://medium.com/@deepthinayakwrites/how-to-create-custom-partitions-on-an-sd-card-in-wsl2-354e244a8e7a?source=rss-ac686d3b0d15------2</link>
            <guid isPermaLink="false">https://medium.com/p/354e244a8e7a</guid>
            <category><![CDATA[sd-card]]></category>
            <category><![CDATA[embedded]]></category>
            <category><![CDATA[wsl-2]]></category>
            <category><![CDATA[linux]]></category>
            <dc:creator><![CDATA[Deepthi Nayak]]></dc:creator>
            <pubDate>Mon, 29 Jun 2026 05:41:00 GMT</pubDate>
            <atom:updated>2026-06-29T05:41:00.831Z</atom:updated>
            <content:encoded><![CDATA[<p>If you’re developing for embedded Linux boards or SoC platforms, you know that setting up an SD card with the right partition layout is a foundational step. The good news: you don’t need a dedicated Linux machine for this. With <strong>WSL2 (Windows Subsystem for Linux 2)</strong> and usbipd-win, you can attach your SD card directly to a Linux environment on Windows and use fdisk to partition it exactly the way you need.</p><p>This guide walks you through the complete workflow — from attaching the SD card in WSL2 to formatting and verifying the final layout.</p><h3>Prerequisites</h3><p>Before you begin, make sure you have:</p><ul><li><strong>Windows 10 (build 19041+) or Windows 11</strong> with WSL2 enabled</li><li>A <strong>WSL2 distro</strong> installed (Ubuntu 22.04 recommended)</li><li>Your SD card already attached and visible inside WSL2 — if you haven’t done this yet, check out the previous post in this series on <strong>forwarding USB devices to WSL2 using </strong><strong>usbipd-win</strong> <em>[</em><a href="https://medium.com/@deepthinayakwrites/why-your-sd-card-is-ghosting-wsl2-and-the-fix-25db799c9ca5"><em>usbpid tutorial</em></a><em>]</em></li><li>An SD card with <strong>all important data backed up</strong> — the steps below will erase everything on it</li></ul><h3>Step 1: Identify the SD Card</h3><p>With the SD card already forwarded to WSL2, confirm it’s visible as a block device:</p><pre>lsblk</pre><p>You should see a new disk entry — typically /dev/sdb:</p><pre>NAME   SIZE TYPE MOUNTPOINT<br>sda    512G disk<br>├─sda1 500G part /<br>└─sda2  12G part<br>sdb     32G disk<br>└─sdb1  32G part</pre><p>You can also use sudo fdisk -l for more detail on each device.</p><blockquote><em>⚠️ </em><strong><em>Critical:</em></strong><em> Always double-check the device name before proceeding. Operating on the wrong disk can erase your WSL2 system drive.</em></blockquote><h3>Step 2: Launch fdisk</h3><p>With the device confirmed, start the fdisk partition editor:</p><pre>sudo fdisk /dev/sdb</pre><p>You’ll enter the interactive fdisk prompt. Type m and hit Enter to see all available commands.</p><h3>Step 3: Delete Existing Partitions</h3><p>If the SD card has existing partitions, clear them first:</p><pre>Command (m for help): d</pre><p>Repeat this command for each partition until none remain. Verify with p:</p><pre>Command (m for help): p</pre><p>No partitions should appear in the output at this point.</p><h3>Step 4: Create a New Partition Table</h3><p>For most embedded Linux projects, an MBR (DOS) partition table is the right choice — it’s widely supported by bootloaders like U-Boot and GRUB.</p><pre>Command (m for help): o</pre><p>This creates a fresh DOS partition table. If your project specifically requires UEFI or a GPT layout, use g instead. When in doubt, go with MBR.</p><h3>Step 5: Create the Boot Partition</h3><pre>Command (m for help): n</pre><p>Accept the defaults for partition number and first sector, then specify the size:</p><pre>Last sector: +512M</pre><p>This creates a 512 MB first partition that will hold your boot files (BOOT.BIN, image.ub, device tree blobs, etc.). 512 MB is generous — you can use as little as 256 MB for most boards.</p><h3>Step 6: Set the Boot Partition Type to FAT32</h3><p>Most embedded bootloaders expect the boot partition to be FAT32. Change the partition type:</p><pre>Command (m for help): t</pre><p>Enter c to select <strong>W95 FAT32 (LBA)</strong>:</p><pre>Hex code (type L to list all codes): c</pre><p>This is an important step that’s easy to skip — some boards will simply refuse to boot if this type flag isn’t set correctly.</p><h3>Step 7: Create the Root Filesystem Partition</h3><pre>Command (m for help): n</pre><p>Accept the defaults and set the size for your root filesystem:</p><pre>Last sector: +8G</pre><p>This 8 GB partition will hold your Linux root filesystem. Adjust the size based on your distro and application footprint — a minimal embedded rootfs can be as small as 2 GB, while a full desktop environment may need 16 GB or more.</p><h3>Step 8: Create an Optional Third Partition</h3><p>If you want a dedicated space for logs, user data, or application storage, create one more partition using the remaining space:</p><pre>Command (m for help): n</pre><p>Accept all defaults. This uses every remaining sector on the SD card — a sensible choice for a catch-all data partition.</p><h3>Step 9: Review the Layout Before Writing</h3><p>Before committing any changes, review the partition table:</p><pre>Command (m for help): p</pre><p>You should see something like:</p><pre>Device      Boot   Start      End  Sectors Size Id Type<br>/dev/sdb1           2048  1050623  1048576 512M  c W95 FAT32 (LBA)<br>/dev/sdb2        1050624 17827839 16777216   8G 83 Linux<br>/dev/sdb3       17827840 62333951 44506012 21G 83 Linux</pre><p>Verify the sizes and partition types match your intent. This is your last chance to make corrections without consequence.</p><h3>Step 10: Write the Partition Table</h3><p>Once you’re satisfied with the layout, write it to disk:</p><pre>Command (m for help): w</pre><p>fdisk commits the changes and exits. The kernel should auto-detect the new partition layout. If it doesn&#39;t, detach and reattach the SD card via usbipd.</p><h3>Step 11: Format the Partitions</h3><p>Creating partitions is only half the job — each one needs a filesystem before it can store files.</p><p>Format the boot partition as FAT32:</p><pre>sudo mkfs.vfat -F32 /dev/sdb1</pre><p>Format the root filesystem partition as ext4:</p><pre>sudo mkfs.ext4 /dev/sdb2</pre><p>Format the data partition as ext4:</p><pre>sudo mkfs.ext4 /dev/sdb3</pre><p>The -F32 flag ensures a proper FAT32 layout (as opposed to FAT16), which is what most bootloaders expect.</p><h3>Step 12: Verify the Result</h3><p>Check the final partition layout:</p><pre>lsblk</pre><p>Expected output:</p><pre>NAME   SIZE TYPE<br>sdb     32G disk<br>├─sdb1 512M part<br>├─sdb2   8G part<br>└─sdb3  21G part</pre><p>Inspect the filesystem types:</p><pre>sudo blkid</pre><p>Expected output:</p><pre>/dev/sdb1: TYPE=&quot;vfat&quot;<br>/dev/sdb2: TYPE=&quot;ext4&quot;<br>/dev/sdb3: TYPE=&quot;ext4&quot;</pre><p>If both outputs look correct, the SD card is ready to receive your boot images and root filesystem.</p><h3>Done? Run sync Before Removing the Card</h3><p>Before physically unplugging the SD card, always run:</p><pre>sync</pre><p>This flushes any buffered writes to disk -skipping it risks filesystem corruption, especially right after mkfs. Then detach the device cleanly via usbipd on Windows as covered in the previous post.</p><p>With the SD card partitioned and formatted, the next step is populating it. That means copying your bootloader binaries to /dev/sdb1, extracting a root filesystem tarball to /dev/sdb2, and optionally pre-populating /dev/sdb3 with application data.</p><p>WSL2 makes this entire workflow surprisingly smooth on a Windows machine — no dual-boot, no VM overhead, just a lightweight Linux environment doing exactly what it’s good at.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=354e244a8e7a" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Why Your SD Card Is Ghosting WSL2 — And the Fix]]></title>
            <link>https://medium.com/@deepthinayakwrites/why-your-sd-card-is-ghosting-wsl2-and-the-fix-25db799c9ca5?source=rss-ac686d3b0d15------2</link>
            <guid isPermaLink="false">https://medium.com/p/25db799c9ca5</guid>
            <category><![CDATA[wsl-2]]></category>
            <category><![CDATA[embedded]]></category>
            <category><![CDATA[linux]]></category>
            <category><![CDATA[sd-card]]></category>
            <category><![CDATA[card-reader]]></category>
            <dc:creator><![CDATA[Deepthi Nayak]]></dc:creator>
            <pubDate>Sun, 28 Jun 2026 03:52:12 GMT</pubDate>
            <atom:updated>2026-06-28T03:52:12.527Z</atom:updated>
            <content:encoded><![CDATA[<h4>A practical guide for embedded Linux developers who need reliable SD card access from WSL2</h4><p>Microsoft’s official recommendation is to use wsl --mount \\.\PHYSICALDRIVEx. It&#39;s elegant, it&#39;s built-in, and for internal drives it works beautifully. But the moment your SD card is plugged in through a USB card reader? Ugh! The disk may not appear, wsl --mount may throw a cryptic error, or the device shows up but can&#39;t be written to correctly.</p><p>I hit exactly this wall while setting up SD cards for a project. After spending more time than I’d like to admit, I switched to <strong>USB/IP via </strong><strong>usbipd-win</strong> — and it worked.</p><h3>Why <em>wsl --mount</em> fails for USB card readers ?</h3><p>Before diving into the solution, it’s worth understanding <em>why</em> the common approach breaks down.</p><p>wsl --mount works by exposing a Windows disk (identified by \\.\PHYSICALDRIVEx) to WSL2. This works well when Windows itself cleanly recognises the storage as a block device. But USB card readers introduce an extra layer of abstraction - the operating system sees a USB mass storage device first, and the disk inside it second. This indirection causes wsl --mount to either fail entirely or produce unreliable results.</p><p><strong>USB/IP takes a fundamentally different approach.</strong> Instead of letting Windows handle the USB device and then sharing the disk, it passes the <em>USB device itself</em> -at the USB protocol level-directly into the WSL2 kernel. From that point on, WSL2 owns the device completely and handles all the storage logic natively. No Windows driver intermediary, no abstraction mismatch.</p><h3>Prerequisites</h3><p>Before you begin, make sure you have:</p><ul><li><strong>Windows 11- </strong>I had it.</li><li><strong>WSL2</strong> installed and running (I am using Ubuntu)</li><li><strong>Administrator access</strong> on your Windows machine</li><li><strong>A USB card reader</strong> with your SD card inserted</li><li>A few minutes and a terminal</li></ul><h3>Step 1: Install usbipd-win</h3><p>usbipd-win is a small open-source Windows service that implements the USB/IP protocol, allowing USB devices to be shared with WSL2 (and even remote machines).</p><p>The quickest way to install it is via <strong>winget</strong>. Open PowerShell as administrator:</p><pre>winget install dorssel.usbipd-win</pre><p>After installation, <strong>restart your PowerShell session</strong> (or open a new window) so the usbipd command is available on your PATH.</p><h3>Step 2: List Connected USB Devices</h3><p>Plug in your USB SD card reader with the SD card already inserted.</p><p>Open <strong>PowerShell as Administrator</strong> (right-click → <em>Run as administrator</em> — this is required for the next steps).</p><p>Now list all USB devices visible to Windows:</p><pre>usbipd list</pre><p>You’ll see output similar to this:</p><pre>BUSID  VID:PID    DEVICE                                                        STATE<br>1-2    0bda:0129  Realtek USB3.0 Card Reader                                    Not shared<br>2-4    0951:1666  DataTraveler 3.0                                               Not shared<br>3-1    046d:c52b  USB Receiver                                                   Not shared</pre><p>Scan the <strong>DEVICE</strong> column for your SD card reader. Common names include terms like “Card Reader”, “Mass Storage Device”, or your reader’s brand name (Realtek, Transcend, etc.).</p><p>Note down the <strong>BUSID</strong> for your card reader. In this example it’s 1-2, but yours will likely differ.</p><blockquote><strong><em>Tip:</em></strong><em> If you’re unsure which entry is your card reader, unplug it, run </em><em>usbipd list, plug it back in, and run the command again. The new entry that appears is your device.</em></blockquote><h3>Step 3: Bind the Device</h3><p>Binding makes your USB device available for sharing with WSL. You only need to do this <strong>once per device</strong> — the binding persists across reboots.</p><pre>usbipd bind --busid 1-2</pre><p>Replace 1-2 with the BUSID from your output. If the command succeeds, you&#39;ll see no output — that&#39;s normal. Run usbipd list again and you should now see the device&#39;s state change to <strong>Shared</strong>:</p><pre>BUSID  VID:PID    DEVICE                          STATE<br>1-2    0bda:0129  Realtek USB3.0 Card Reader      Shared</pre><blockquote><strong><em>Why is this step needed?</em></strong><em> By default, Windows retains exclusive control over all USB devices. Binding explicitly marks a device as available for USB/IP sharing. Without it, the attach step in the next section will fail.</em></blockquote><h3>Step 4: Attach the Device to WSL2</h3><p>Now attach the shared device to your running WSL2 instance:</p><pre>usbipd attach --wsl --busid 1-2</pre><p>You’ll see a brief pause while usbipd establishes the connection, followed by a confirmation message. At this point, the USB device is <strong>detached from Windows</strong> and handed over to WSL2. Windows File Explorer will no longer show the SD card — that&#39;s expected and correct.</p><blockquote><strong><em>Note:</em></strong><em> You may need to run this command each time you reconnect the card reader, since physical reconnection resets the USB device state. The </em><em>bind step, however, only needs to be done once.</em></blockquote><h3>Step 5: Verify the Device Inside WSL2</h3><p>Switch to your WSL2 terminal and check that the device is visible:</p><pre>lsblk</pre><p>You should see a new block device — typically /dev/sdb or /dev/sdc depending on how many disks are already attached:</p><pre>NAME   MAJ:MIN RM  SIZE RO TYPE MOUNTPOINT<br>sda      8:0    0   1T  0  disk<br>└─sda1   8:1    0   1T  0  part /<br>sdb      8:16   1  29.7G  0  disk<br>├─sdb1   8:17   1   256M  0  part<br>└─sdb2   8:18   1  29.4G  0  part</pre><p>For more detail, including partition types and filesystem information:</p><pre>sudo fdisk -l /dev/sdb</pre><p>Your SD card is now fully accessible from WSL2. You can use standard Linux tools — fdisk, parted, mkfs, dd, mount-exactly as you would on a native Linux machine.</p><h3><strong>Step 6: Detach the Device When Done</strong></h3><p>When you’re finished working with the SD card, detach it from WSL2 so Windows can access it again, through powershell:</p><pre>usbipd detach --busid 1-2</pre><p>After detaching, Windows will re-detect the USB device and it will reappear in File Explorer as normal. You can now safely remove the card reader.</p><p><strong>Conclusion —</strong></p><p>If you’ve been fighting wsl --mount with a USB card reader and losing, USB/IP is the tool you&#39;ve been missing. It bypasses the entire Windows disk abstraction layer and gives WSL2 direct, native access to the USB device.</p><p>The setup is a one-time effort: install usbipd-win, bind your device once, and from then on it&#39;s a single usbipd attach command before each session.</p><p><em>Have a different approach that works for you? I’d love to hear about it in the comments.</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=25db799c9ca5" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>