<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Raspberry PI SD Card Provisioning &#8211; Sibeesh Passion</title>
	<atom:link href="https://mail.sibeeshpassion.com/tag/raspberry-pi-sd-card-provisioning/feed/" rel="self" type="application/rss+xml" />
	<link>https://mail.sibeeshpassion.com</link>
	<description>My passion towards life</description>
	<lastBuildDate>Sat, 19 Jan 2019 10:54:11 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	<generator>https://wordpress.org/?v=6.9.4</generator>

<image>
	<url>/wp-content/uploads/2017/04/Sibeesh_Passion_Logo_Small.png</url>
	<title>Raspberry PI SD Card Provisioning &#8211; Sibeesh Passion</title>
	<link>https://mail.sibeeshpassion.com</link>
	<width>32</width>
	<height>32</height>
</image> 
	<item>
		<title>Raspberry PI SD Card Provisioning with Windows 10 IoT Core &#8211; Adding Packages to the Existing FFU Image</title>
		<link>https://mail.sibeeshpassion.com/raspberry-pi-sd-card-provisioning-with-windows-10-iot-core-adding-packages-to-the-existing-ffu-image/</link>
					<comments>https://mail.sibeeshpassion.com/raspberry-pi-sd-card-provisioning-with-windows-10-iot-core-adding-packages-to-the-existing-ffu-image/#disqus_thread</comments>
		
		<dc:creator><![CDATA[SibeeshVenu]]></dc:creator>
		<pubDate>Sun, 09 Dec 2018 12:44:17 +0000</pubDate>
				<category><![CDATA[IoT]]></category>
		<category><![CDATA[Raspberry PI]]></category>
		<category><![CDATA[Custom IoT Core FFU Image]]></category>
		<category><![CDATA[FFU]]></category>
		<category><![CDATA[IoT Core]]></category>
		<category><![CDATA[IoT Core OS]]></category>
		<category><![CDATA[Raspberry PI SD Card Provisioning]]></category>
		<category><![CDATA[Windows 10]]></category>
		<guid isPermaLink="false">https://sibeeshpassion.com/?p=13431</guid>

					<description><![CDATA[[toc] Introduction In my previous article, we have seen how to create a basic FFU image which can be flashed to SD cards. Today, we will see how we can package our application and add this to our existing IoT Core OS image. Doesn&#8217;t it sound good? If you haven&#8217;t read my previous articles on the same topic, I strongly recommend you to read so that we can make sure that we both are in the same boat. For now, let&#8217;s just start doing some amazing things. Let&#8217;s just start then. Background Wow, that&#8217;s cool that you have your own FFU [&#8230;]]]></description>
										<content:encoded><![CDATA[<p>[toc]</p>
<h2>Introduction</h2>
<p>In my previous article, we have seen how to <a href="https://sibeeshpassion.com/raspberry-pi-sd-card-provisioning-with-windows-10-iot-core-create-ffu-image-and-flash/">create a basic FFU image</a> which can be flashed to SD cards. Today, we will see how we can package our application and add this to our existing IoT Core OS image. Doesn&#8217;t it sound good? If you haven&#8217;t read my previous articles on the same topic, I strongly recommend you to read so that we can make sure that we both are in the same boat. For now, let&#8217;s just start doing some amazing things. Let&#8217;s just start then.</p>
<h2>Background</h2>
<p>Wow, that&#8217;s cool that you have your own FFU image in your SD card now, to make it more custom you may need to add your own application to it so that the same can be run in as many Raspberry Pi device as can, well that&#8217;s called Provisioning right? In this article,</p>
<ol>
<li>we will see how we can create an APPX package of a UWP application</li>
<li>how the APPX package can be added to our FFU image</li>
</ol>
<p>Let&#8217;s start doing the PowerShell commands now then.</p>
<h2>Prerequisites</h2>
<p>To do the wonderful things, we always need some prerequisites.  You can always see all the prerequisites from <a href="https://docs.microsoft.com/en-us/windows-hardware/manufacture/iot/set-up-your-pc-to-customize-iot-core">here</a>. But, in this part, we are going to be needed only the preceding tools.</p>
<ol>
<li>Windows Assessment and Deployment Kit (Windows ADK)</li>
<li>Windows Driver Kit (WDK) 10</li>
<li>IoT Core ADK Add-Ons</li>
<li>Windows 10 IoT Core Packages</li>
<li>The Raspberry Pi BSP</li>
<li>Custom FFU image we have created</li>
</ol>
<h2>Creating the UWP APPX</h2>
<p>For now, I am going to use the Microsoft HelloWorld application, which is already available in the <a href="https://github.com/Microsoft/Windows-iotcore-samples/tree/develop/Samples/HelloWorld">GitHub</a>. Let&#8217;s just clone that application and build the same. If you are getting an error as &#8220;Error Cannot resolve Assembly or Windows Metadata file &#8216;Windows.Foundation.UniversalApiContract.winmd'&#8221;, please make sure that you had set the target version in the application section, you can always see my detailed answer <a href="https://stackoverflow.com/questions/53691306/error-cannot-resolve-assembly-or-windows-metadata-file-windows-foundation-unive/53691307#53691307">here in StackOverflow</a>.</p>
<p>Now let&#8217;s just right click on the project and click on Store &#8211; &gt; Create App Packages.</p>
<div id="attachment_13433" style="width: 660px" class="wp-caption aligncenter"><a href="https://sibeeshpassion.com/wp-content/uploads/2018/12/Create-APPX-Menu.jpg"><img fetchpriority="high" decoding="async" aria-describedby="caption-attachment-13433" class="size-full wp-image-13433" src="https://sibeeshpassion.com/wp-content/uploads/2018/12/Create-APPX-Menu.jpg" alt="Create APPX Menu" width="650" height="380" srcset="/wp-content/uploads/2018/12/Create-APPX-Menu.jpg 650w, /wp-content/uploads/2018/12/Create-APPX-Menu-300x175.jpg 300w, /wp-content/uploads/2018/12/Create-APPX-Menu-400x234.jpg 400w" sizes="(max-width: 650px) 100vw, 650px" /></a><p id="caption-attachment-13433" class="wp-caption-text">Create APPX Menu</p></div>
<p>Now select the option &#8220;I want to create packages for sideloading&#8221; and click next. In the next screen, you can always automatically increment your application version. In the Generate app bundle option, select Never. And click Create. Now the app will get built and the APPX file will be generated for you.</p>
<div id="attachment_13434" style="width: 661px" class="wp-caption aligncenter"><a href="https://sibeeshpassion.com/wp-content/uploads/2018/12/Create-APP-Package.jpg"><img decoding="async" aria-describedby="caption-attachment-13434" class="size-full wp-image-13434" src="https://sibeeshpassion.com/wp-content/uploads/2018/12/Create-APP-Package.jpg" alt="Create APP Package" width="651" height="211" srcset="/wp-content/uploads/2018/12/Create-APP-Package.jpg 651w, /wp-content/uploads/2018/12/Create-APP-Package-300x97.jpg 300w, /wp-content/uploads/2018/12/Create-APP-Package-400x130.jpg 400w" sizes="(max-width: 651px) 100vw, 651px" /></a><p id="caption-attachment-13434" class="wp-caption-text">Create APP Package</p></div>
<h2>Adding APPX to the Existing FFU</h2>
<p>As we have our own package and FFU image ready, we can go ahead and add this package to our FFU now. To do that open the IoTCorePShell, if you are not sure about how to open this, please check my previous article. Now let&#8217;s create a package for our app.</p>
<pre class="EnlighterJSRAW" data-enlighter-language="null">newappxpkg "C:\Users\SibeeshVenu\source\repos\Windows-iotcore-samples.git\Samples\HelloWorld\CS\AppPackages\HelloWorld_1.0.0.0_ARM_Test\HelloWorld_1.0.0.0_ARM.appx" fga Appx.HelloWorld</pre>
<p>Please be noted that the &#8220;fga&#8221; is an indication that your application is a foreground application, if your application is a background application, you should use &#8220;bgt&#8221; instead of &#8220;fga&#8221;.</p>
<blockquote><p>Please make sure that your FFU image has at least one Foreground application in it. You will always see the blue spinning dots after connecting the monitor to the Raspberry Pi if you have only background application in your image.  So you should consider having a registered fgt as well in your image.</p></blockquote>
<p>You will not be able to understand what exactly happens if there any problems if you have only a background application in your image. Trust me, I had spent many hours looking at the blue screen hoping that my application will show up there.</p>
<p>The above command will create a new folder in your workspace, in our case it is at C:\OEE\Source-arm\Packages\Appx.HelloWorld. It will also copy the appx files and its dependencies from the folder we are specifying in the command and generates a customizations.xml file as well as a package xml file that is used to build the package.</p>
<div id="attachment_13435" style="width: 584px" class="wp-caption aligncenter"><a href="https://sibeeshpassion.com/wp-content/uploads/2018/12/newappxpkg-output.jpg"><img decoding="async" aria-describedby="caption-attachment-13435" class="size-full wp-image-13435" src="https://sibeeshpassion.com/wp-content/uploads/2018/12/newappxpkg-output.jpg" alt="newappxpkg output" width="574" height="433" srcset="/wp-content/uploads/2018/12/newappxpkg-output.jpg 574w, /wp-content/uploads/2018/12/newappxpkg-output-300x226.jpg 300w, /wp-content/uploads/2018/12/newappxpkg-output-400x302.jpg 400w" sizes="(max-width: 574px) 100vw, 574px" /></a><p id="caption-attachment-13435" class="wp-caption-text">newappxpkg output</p></div>
<p>This will also create a new entry as follows in the OEMFM.xml file.</p>
<pre class="EnlighterJSRAW" data-enlighter-language="null">&lt;PackageFile Path="%PKGBLD_DIR%" Name="%OEM_NAME%.Appx.HelloWorld.cab"&gt;
        &lt;FeatureIDs&gt;
          &lt;FeatureID&gt;APPX_HELLOWORLD&lt;/FeatureID&gt;
        &lt;/FeatureIDs&gt;
      &lt;/PackageFile&gt;</pre>
<p>Now let&#8217;s just build our package.</p>
<pre class="EnlighterJSRAW" data-enlighter-language="null">PS C:\OEE&gt;buildpkg Appx.HelloWorld
Processing Appx.HelloWorld.wm.xml
True
IoTCorePShell arm 10.0.0.0 Test</pre>
<p>Now you should be able to see your package.cab file in the build directory C:\OEE\Build\arm\pkgs.  Let&#8217;s add the feature APPX_HELLOWORLD to our product OEEIoTCore now.</p>
<pre class="EnlighterJSRAW" data-enlighter-language="null">PS C:\OEE&gt;addfid OEEIoTCore Test APPX_HELLOWORLD -OEM
IoTCorePShell arm 10.0.0.0 Test</pre>
<p>You can also remove any feature from any product by using &#8220;removefid&#8221; command. As we have added our feature, now it is time to build our image.</p>
<pre class="EnlighterJSRAW" data-enlighter-language="null">PS C:\OEE&gt;buildimage OEEIoTCore Test</pre>
<p>Please be noted that this may take some time, and once it is done, you will be getting an output as below.</p>
<div id="attachment_13436" style="width: 660px" class="wp-caption aligncenter"><a href="https://sibeeshpassion.com/wp-content/uploads/2018/12/buildimage.png"><img decoding="async" aria-describedby="caption-attachment-13436" class="size-full wp-image-13436" src="https://sibeeshpassion.com/wp-content/uploads/2018/12/buildimage.png" alt="buildimage" width="650" height="479" srcset="/wp-content/uploads/2018/12/buildimage.png 650w, /wp-content/uploads/2018/12/buildimage-300x221.png 300w, /wp-content/uploads/2018/12/buildimage-400x295.png 400w" sizes="(max-width: 650px) 100vw, 650px" /></a><p id="caption-attachment-13436" class="wp-caption-text">buildimage</p></div>
<p>The new image will be available in your build folder (C:\OEE\Build\arm\OEEIoTCore\Test). Now you can write this FFU image with your application as <a href="https://sibeeshpassion.com/raspberry-pi-sd-card-provisioning-with-windows-10-iot-core-create-ffu-image-and-flash/#writing-flashing-the-ffu-image-to-sd-card">mentioned in my previous article</a>.</p>
<p>Now that our OS is flashed and it is time to connect the SD card to the Raspberry Pi. Once that is done, you can see that your application is running in <a href="https://sibeeshpassion.com/setting-up-your-raspberry-pi-with-microsoft-windows-10-iot-core/#login-to-device-portal">your device portal</a>.</p>
<div id="attachment_13437" style="width: 660px" class="wp-caption aligncenter"><a href="https://sibeeshpassion.com/wp-content/uploads/2018/12/Custom-Package-in-Device-Portal.jpg"><img decoding="async" aria-describedby="caption-attachment-13437" class="size-full wp-image-13437" src="https://sibeeshpassion.com/wp-content/uploads/2018/12/Custom-Package-in-Device-Portal.jpg" alt="Custom Package in Device Portal" width="650" height="309" srcset="/wp-content/uploads/2018/12/Custom-Package-in-Device-Portal.jpg 650w, /wp-content/uploads/2018/12/Custom-Package-in-Device-Portal-300x143.jpg 300w, /wp-content/uploads/2018/12/Custom-Package-in-Device-Portal-400x190.jpg 400w" sizes="(max-width: 650px) 100vw, 650px" /></a><p id="caption-attachment-13437" class="wp-caption-text">Custom Package in Device Portal</p></div>
<p>Now let&#8217;s add a background application and follow the same procedure.</p>
<pre class="EnlighterJSRAW" data-enlighter-language="null">PS C:\OEE&gt;newappxpkg "C:\Users\SibeeshVenu\SourceCode\OEE\ml.OEE.Pi.Windows\ml.OEE.Pi.Windows.BeaconDetector\AppPackages\ml.OEE.Pi.Windows.BeaconDetector_1.0.3.0_ARM_Test\ml.OEE.Pi.Windows.BeaconDetector_1.0.3.0_ARM.appx" bgt Appx.Beacon</pre>
<p>I am sure you will be able to see your background application in your device portal, once you had followed the steps correctly.</p>
<div id="attachment_13442" style="width: 660px" class="wp-caption alignnone"><a href="https://sibeeshpassion.com/wp-content/uploads/2018/12/Background-Application-in-IoT-Device-Portal.jpg"><img decoding="async" aria-describedby="caption-attachment-13442" class="size-full wp-image-13442" src="https://sibeeshpassion.com/wp-content/uploads/2018/12/Background-Application-in-IoT-Device-Portal.jpg" alt="Background Application in IoT Device Portal" width="650" height="336" srcset="/wp-content/uploads/2018/12/Background-Application-in-IoT-Device-Portal.jpg 650w, /wp-content/uploads/2018/12/Background-Application-in-IoT-Device-Portal-300x155.jpg 300w, /wp-content/uploads/2018/12/Background-Application-in-IoT-Device-Portal-400x207.jpg 400w" sizes="(max-width: 650px) 100vw, 650px" /></a><p id="caption-attachment-13442" class="wp-caption-text">Background Application in IoT Device Portal</p></div>
<h2>Conclusion</h2>
<p>Wow!. Now we have learned,</p>
<ul>
<li>how we can generate APPX package of our UWP application</li>
<li>how to add the new feature to the existing IoT Core FFU image</li>
<li>how to write the same to an SD card</li>
<li>how to manage the new application in Device Portal</li>
</ul>
<h2><span id="your-turn-what-do-you-think">Your turn. What do you think?</span></h2>
<p>Thanks a lot for reading. Did I miss anything that you may think which is needed in this article? Could you find this post as useful? Kindly do not forget to share me your feedback.</p>
<p>Kindest Regards<br />
Sibeesh Venu</p>
]]></content:encoded>
					
					<wfw:commentRss>https://mail.sibeeshpassion.com/raspberry-pi-sd-card-provisioning-with-windows-10-iot-core-adding-packages-to-the-existing-ffu-image/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>Raspberry PI SD Card Provisioning with Windows 10 IoT Core &#8211; Create FFU Image and Flash</title>
		<link>https://mail.sibeeshpassion.com/raspberry-pi-sd-card-provisioning-with-windows-10-iot-core-create-ffu-image-and-flash/</link>
					<comments>https://mail.sibeeshpassion.com/raspberry-pi-sd-card-provisioning-with-windows-10-iot-core-create-ffu-image-and-flash/#disqus_thread</comments>
		
		<dc:creator><![CDATA[SibeeshVenu]]></dc:creator>
		<pubDate>Thu, 22 Nov 2018 08:41:04 +0000</pubDate>
				<category><![CDATA[IoT]]></category>
		<category><![CDATA[Raspberry PI]]></category>
		<category><![CDATA[diskpart]]></category>
		<category><![CDATA[DISM]]></category>
		<category><![CDATA[IoT Core]]></category>
		<category><![CDATA[powershell]]></category>
		<category><![CDATA[Raspberry PI SD Card Provisioning]]></category>
		<category><![CDATA[Windows 10 IoT Core]]></category>
		<category><![CDATA[Windows IoT core by DISM]]></category>
		<guid isPermaLink="false">https://sibeeshpassion.com/?p=13388</guid>

					<description><![CDATA[[toc] Introduction In my previous article, we have seen how to Set Up Your Raspberry PI with Microsoft Windows 10 IoT Core. Yes, we were successful in flashing the Microsoft Windows 10 IoT Core OS to our Raspberry PI, but let&#8217;s try something very handy this time. The main topic we are going to discuss here in this article is SD Card Provisioning. I understand that you have one Raspberry PI with a working OS in it, whether it is a Microsoft IoT  OS or Raspbian. And you might also have an application which runs in your Raspberry Pi. That&#8217;s good. But [&#8230;]]]></description>
										<content:encoded><![CDATA[<p>[toc]</p>
<h2>Introduction</h2>
<p>In my previous article, we have seen how to <a href="https://sibeeshpassion.com/setting-up-your-raspberry-pi-with-microsoft-windows-10-iot-core/">Set Up Your Raspberry PI with Microsoft Windows 10 IoT Core</a>. Yes, we were successful in flashing the Microsoft Windows 10 IoT Core OS to our <a href="https://sibeeshpassion.com/category/raspberry-pi/">Raspberry PI</a>, but let&#8217;s try something very handy this time. The main topic we are going to discuss here in this article is <em>SD Card Provisioning.</em> I understand that you have one Raspberry PI with a working OS in it, whether it is a Microsoft IoT  OS or Raspbian. And you might also have an application which runs in your Raspberry Pi. That&#8217;s good. But what if you have 100 Raspberry PI and you need to set up your Raspberry PIs for a production environment? Did you get the difficulties in your mind? In this article, we are going to start a series of articles on SD Card Provisioning. For now, let&#8217;s just start doing some amazing things. Let&#8217;s just start then.</p>
<h2>Background</h2>
<p>Yeah, I am glad that you have a Raspberry PI with Windows 10 IoT core OS. While setting up your OS, you might have downloaded the IoT Dashboard and flashed the IoT OS to your SD card manually. As I mentioned in the Introduction, this is not a normal scenario when you want to connect multiple (let&#8217;s say 100) Raspberry PIs. Flashing the OS by using the Dashboard application might not be a good idea in this case. What should we do then? That&#8217;s where PowerShell come into the play. Yes, we are going to try out some PowerShell commands to do all those mentioned jobs for us.</p>
<h2>Prerequisites</h2>
<p>To do the wonderful things, we always need some prerequisites.  You can always see all the prerequisites from <a href="https://docs.microsoft.com/en-us/windows-hardware/manufacture/iot/set-up-your-pc-to-customize-iot-core">here</a>. But, in this part, we are going to be needed only the preceding tools.</p>
<ol>
<li>Windows Assessment and Deployment Kit (Windows ADK)</li>
<li>Windows Driver Kit (WDK) 10</li>
<li>IoT Core ADK Add-Ons</li>
<li>Windows 10 IoT Core Packages</li>
<li>The Raspberry Pi BSP</li>
</ol>
<h2>Creating the Base Windows IoT FFU Image</h2>
<p>I assume that you had already gone through the Prerequisites and followed the instructions. If not, please check again.</p>
<h3>Create a Workspace</h3>
<p>To get started here, please go to the cloned location of the repository iot-adk-addonkit, where you will find a Windows Command Script IoTCorePShell.cmd. Double click on the same file will open a PowerShell with administrative privilege. Now, this is where the game starts. Once it opens it will do some initial process for us.</p>
<div id="attachment_13389" style="width: 661px" class="wp-caption aligncenter"><a href="https://sibeeshpassion.com/wp-content/uploads/2018/11/Running-IoTCorePShell.cmd_.png"><img decoding="async" aria-describedby="caption-attachment-13389" class="size-full wp-image-13389" src="https://sibeeshpassion.com/wp-content/uploads/2018/11/Running-IoTCorePShell.cmd_.png" alt="Running IoTCorePShell.cmd" width="651" height="230" srcset="/wp-content/uploads/2018/11/Running-IoTCorePShell.cmd_.png 651w, /wp-content/uploads/2018/11/Running-IoTCorePShell.cmd_-300x106.png 300w, /wp-content/uploads/2018/11/Running-IoTCorePShell.cmd_-400x141.png 400w" sizes="(max-width: 651px) 100vw, 651px" /></a><p id="caption-attachment-13389" class="wp-caption-text">Running IoTCorePShell.cmd</p></div>
<p>Now let&#8217;s create a workspace now.</p>
<pre class="EnlighterJSRAW" data-enlighter-language="null">New-IoTWorkspace C:\Workspacefolder oemname arm
(or) new-ws C:\workspacefolder oemname arm</pre>
<div id="attachment_13390" style="width: 661px" class="wp-caption aligncenter"><a href="https://sibeeshpassion.com/wp-content/uploads/2018/11/new-ws-command.png"><img decoding="async" aria-describedby="caption-attachment-13390" class="size-full wp-image-13390" src="https://sibeeshpassion.com/wp-content/uploads/2018/11/new-ws-command.png" alt="new-ws command" width="651" height="340" srcset="/wp-content/uploads/2018/11/new-ws-command.png 651w, /wp-content/uploads/2018/11/new-ws-command-300x157.png 300w, /wp-content/uploads/2018/11/new-ws-command-400x209.png 400w" sizes="(max-width: 651px) 100vw, 651px" /></a><p id="caption-attachment-13390" class="wp-caption-text">new-ws command</p></div>
<p>Now we have created a workspace successfully. Please be noted that the BSPPKG_DIR is &#8220;C:\Program Files (x86)\Windows Kits\10\MSPackages\retail\arm\fre&#8221;. I strongly recommend you to check that folder whether you have contents in it or not if there is no content you might haven&#8217;t installed the packages mentioned in the prerequisites.</p>
<h3>Build BSP</h3>
<p>Now it is time to think about the BSP aka Board Support Package. As we already know that we are using Raspberry PI, we can directly download the RPi_BSP.zip file from the <a href="https://github.com/ms-iot/iot-adk-addonkit/releases">GitHub release page</a>. Then you can perform the below commands.</p>
<pre class="EnlighterJSRAW" data-enlighter-language="null">Import-IoTBSP RPi2 C:\Downloads\RPi_BSP.zip
(or) importbsp RPi2 C:\Downloads\RPi_BSP.zip
buildpkg RPi2</pre>
<p>If everything is right, you should see an output as below.</p>
<div id="attachment_13391" style="width: 663px" class="wp-caption aligncenter"><a href="https://sibeeshpassion.com/wp-content/uploads/2018/11/Import-Raspberry-BSP.png"><img decoding="async" aria-describedby="caption-attachment-13391" class="size-full wp-image-13391" src="https://sibeeshpassion.com/wp-content/uploads/2018/11/Import-Raspberry-BSP.png" alt="Import Raspberry BSP" width="653" height="92" srcset="/wp-content/uploads/2018/11/Import-Raspberry-BSP.png 653w, /wp-content/uploads/2018/11/Import-Raspberry-BSP-300x42.png 300w, /wp-content/uploads/2018/11/Import-Raspberry-BSP-400x56.png 400w" sizes="(max-width: 653px) 100vw, 653px" /></a><p id="caption-attachment-13391" class="wp-caption-text">Import Raspberry BSP</p></div>
<h3>Build Packages</h3>
<p>Once you have created the workspace and extracted the BSP, it is time to build all of our packages.</p>
<pre class="EnlighterJSRAW" data-enlighter-language="null">New-IoTCabPackage All
(or) buildpkg all</pre>
<p>If you miss this step before you go to the next step, you will get an error as follows when you build your image.</p>
<pre class="EnlighterJSRAW" data-enlighter-language="null">info: Trying to load file 'C:\OEEWorkspace\Build\arm\InputFMs\OEMFMFileList.xml' as a FM file list ... fatal error : Error: Missing package: C:\OEEWorkspace\Build\arm\pkgs\test.OEM.Sample.cab
info: Trying to load file 'C:\OEEWorkspace\Build\arm\InputFMs\RPi2FMFileList.xml' as a FM file list ... fatal error : Error: Missing package: 
</pre>
<p>You will also end up in the similar <a href="https://github.com/ms-iot/iot-adk-addonkit/issues/139">GitHub issue</a>. Trust me, finding the root cause of this issue took me some hours and at the end, I answered my findings here in <a href="https://stackoverflow.com/questions/53414482/info-trying-to-load-file-oemfmfilelist-xml-as-a-fm-file-list-fatal-error/53414483#53414483">StackOverflow</a>.</p>
<div id="attachment_13392" style="width: 436px" class="wp-caption aligncenter"><a href="https://sibeeshpassion.com/wp-content/uploads/2018/11/Building-all-the-packages.png"><img decoding="async" aria-describedby="caption-attachment-13392" class="size-full wp-image-13392" src="https://sibeeshpassion.com/wp-content/uploads/2018/11/Building-all-the-packages.png" alt="Building all the packages" width="426" height="385" srcset="/wp-content/uploads/2018/11/Building-all-the-packages.png 426w, /wp-content/uploads/2018/11/Building-all-the-packages-300x271.png 300w, /wp-content/uploads/2018/11/Building-all-the-packages-400x362.png 400w" sizes="(max-width: 426px) 100vw, 426px" /></a><p id="caption-attachment-13392" class="wp-caption-text">Building all the packages</p></div>
<p>Once the build is successful, you should be able to see the cab files in your workspace location, in my case, it is C:\OEE\Build\arm\pkgs.</p>
<h3>Create a Product</h3>
<p>Now let&#8217;s create a new Product, consider this as the device for which we are building an image for. We will be using the BSP we have extracted for this step.</p>
<pre class="EnlighterJSRAW" data-enlighter-language="null">Add-IoTProduct ProductA RPi2
(or) newproduct MyProductA RPi2</pre>
<p>You will be asked the Manufacturer Name (OEM Name), Family, SKU, BaseboardManufacturer, and BaseboardProduct. You can get the BaseProductName from your Workspace location, in my case C:\OEE\Source-arm\BSP. You can see the sample command here in the preceding image.</p>
<div id="attachment_13393" style="width: 659px" class="wp-caption aligncenter"><a href="https://sibeeshpassion.com/wp-content/uploads/2018/11/Creating-a-new-Product.png"><img decoding="async" aria-describedby="caption-attachment-13393" class="size-full wp-image-13393" src="https://sibeeshpassion.com/wp-content/uploads/2018/11/Creating-a-new-Product.png" alt="Creating a new Product" width="649" height="210" srcset="/wp-content/uploads/2018/11/Creating-a-new-Product.png 649w, /wp-content/uploads/2018/11/Creating-a-new-Product-300x97.png 300w, /wp-content/uploads/2018/11/Creating-a-new-Product-400x129.png 400w" sizes="(max-width: 649px) 100vw, 649px" /></a><p id="caption-attachment-13393" class="wp-caption-text">Creating a new Product</p></div>
<p>The command shown in the image will generate a new Product in the Workspace location C:\OEE\Source-arm\Products\OEEIoTCore.</p>
<div id="attachment_13394" style="width: 564px" class="wp-caption aligncenter"><a href="https://sibeeshpassion.com/wp-content/uploads/2018/11/Add-IoTProduct-Output.png"><img decoding="async" aria-describedby="caption-attachment-13394" class="size-full wp-image-13394" src="https://sibeeshpassion.com/wp-content/uploads/2018/11/Add-IoTProduct-Output.png" alt="" width="554" height="412" srcset="/wp-content/uploads/2018/11/Add-IoTProduct-Output.png 554w, /wp-content/uploads/2018/11/Add-IoTProduct-Output-300x223.png 300w, /wp-content/uploads/2018/11/Add-IoTProduct-Output-400x297.png 400w" sizes="(max-width: 554px) 100vw, 554px" /></a><p id="caption-attachment-13394" class="wp-caption-text">Add-IoTProduct Output</p></div>
<h3>Build the Image</h3>
<p>We are almost done, let&#8217;s eject all the removable devices from the system and then run the below command.</p>
<pre class="EnlighterJSRAW" data-enlighter-language="null">New-IoTFFUImage &lt;product name&gt; Test
(or)buildimage &lt;product name&gt; Test</pre>
<p>This command will give you the FFU image with your base image.</p>
<div id="attachment_13396" style="width: 660px" class="wp-caption aligncenter"><a href="https://sibeeshpassion.com/wp-content/uploads/2018/11/Building-Image-and-Generate-FFU-File.png"><img decoding="async" aria-describedby="caption-attachment-13396" class="size-full wp-image-13396" src="https://sibeeshpassion.com/wp-content/uploads/2018/11/Building-Image-and-Generate-FFU-File.png" alt="Building Image and Generate FFU File" width="650" height="432" srcset="/wp-content/uploads/2018/11/Building-Image-and-Generate-FFU-File.png 650w, /wp-content/uploads/2018/11/Building-Image-and-Generate-FFU-File-300x199.png 300w, /wp-content/uploads/2018/11/Building-Image-and-Generate-FFU-File-400x266.png 400w" sizes="(max-width: 650px) 100vw, 650px" /></a><p id="caption-attachment-13396" class="wp-caption-text">Building Image and Generate FFU File</p></div>
<p>You can also see the logs in your workspace location in the build folder. The generated FFU image(Flash.ffu) will be available at C:\OEE\Build\arm\OEEIoTCore\Test folder.</p>
<h2>Writing/Flashing the FFU Image to SD Card</h2>
<p>Wow!, now we have a fully functional FFU image and the only thing pending is to write some bat commands to flash it to SD card, you can use the <a href="https://docs.microsoft.com/en-us/windows/iot-core/connect-your-device/dism">DISM</a>. Let&#8217;s create a text file called format.txt and write some commands as preceding.</p>
<pre class="EnlighterJSRAW" data-enlighter-language="null">select disk 1
clean
create partition primary
select partition 1
active
format fs=fat32 quick
assign
exit
</pre>
<p>As you can see that we are selecting the disk 1, considering the fact that only one removable disk is been connected to your machine.  Then we format the disk. This format.txt file will be used in our bat file write.bat.</p>
<pre class="EnlighterJSRAW" data-enlighter-language="null">echo off
REM Start formatting
diskpart /s format.txt &gt;log.txt

REM Start flashing
dism.exe /Apply-Image /ImageFile:Flash.ffu /ApplyDrive:\\.\PhysicalDrive1 /SkipPlatformCheck /Quiet

ECHO Finish
</pre>
<p>The logs will be added to the file called log.txt. The command ImageFile:Flash.ffu is the place where we assign our FFU image. Now let&#8217;s just go to the folder where these three files are been placed and open a command prompt in administrative power.</p>
<ul>
<li>write.bat</li>
<li>format.txt</li>
<li>flash.ffu</li>
</ul>
<div id="attachment_13399" style="width: 659px" class="wp-caption aligncenter"><a href="https://sibeeshpassion.com/wp-content/uploads/2018/11/Flash-IoT-Core-by-Commands.png"><img decoding="async" aria-describedby="caption-attachment-13399" class="size-full wp-image-13399" src="https://sibeeshpassion.com/wp-content/uploads/2018/11/Flash-IoT-Core-by-Commands.png" alt="Flash IoT Core by Commands" width="649" height="250" srcset="/wp-content/uploads/2018/11/Flash-IoT-Core-by-Commands.png 649w, /wp-content/uploads/2018/11/Flash-IoT-Core-by-Commands-300x116.png 300w, /wp-content/uploads/2018/11/Flash-IoT-Core-by-Commands-400x154.png 400w" sizes="(max-width: 649px) 100vw, 649px" /></a><p id="caption-attachment-13399" class="wp-caption-text">Flash IoT Core by Commands</p></div>
<h2>Connect SD Card to Raspberry PI and then Raspberry PI to the Network</h2>
<p>Now that our OS is flashed and it is time to connect the SD card to the Raspberry PI and connect a monitor, mouse, keyboard, ethernet to the Raspberry PI. You will see the default IoT core application running. You can also check in the device portal using the IoT Dashboard application, if you are not sure how, please read my previous post.</p>
<h2>Conclusion</h2>
<p>Wow!. Now we have learned,</p>
<ul>
<li>how we can generate the IoT core FFU image using PowerShell</li>
<li>how to write the same to an SD card.</li>
</ul>
<p>Is that all? No, in the next article we will learn</p>
<ul>
<li>how we can add our app package to this FFU image which can be used in many Raspberry PI</li>
<li>how to generate the FFU image on demand with some chained PowerShell commands.</li>
<li>how to use other mechanisms to write the FFU image to the disk</li>
</ul>
<h2><span id="your-turn-what-do-you-think">Your turn. What do you think?</span></h2>
<p>Thanks a lot for reading. Did I miss anything that you may think which is needed in this article? Could you find this post as useful? Kindly do not forget to share me your feedback.</p>
<p>Kindest Regards<br />
Sibeesh Venu</p>
]]></content:encoded>
					
					<wfw:commentRss>https://mail.sibeeshpassion.com/raspberry-pi-sd-card-provisioning-with-windows-10-iot-core-create-ffu-image-and-flash/feed/</wfw:commentRss>
			<slash:comments>1</slash:comments>
		
		
			</item>
	</channel>
</rss>
