Sibeesh Passion

Top Menu

  • Home
  • Search
  • About
  • Privacy Policy

Main Menu

  • Articles
    • Azure
    • .NET
    • IoT
    • JavaScript
    • Career Advice
    • Interview
    • Angular
    • Node JS
    • JQuery
    • Knockout JS
    • Jasmine Framework
    • SQL
    • MongoDB
    • MySQL
    • WordPress
  • Contributions
    • Medium
    • GitHub
    • Stack Overflow
    • Unsplash
    • ASP.NET Forum
    • C# Corner
    • Code Project
    • DZone
    • MSDN
  • Social Media
    • LinkedIn
    • Facebook
    • Instagram
    • Twitter
  • YouTube
    • Sibeesh Venu
    • Sibeesh Passion
  • Awards
  • Home
  • Search
  • About
  • Privacy Policy

logo

Sibeesh Passion

  • Articles
    • Azure
    • .NET
    • IoT
    • JavaScript
    • Career Advice
    • Interview
    • Angular
    • Node JS
    • JQuery
    • Knockout JS
    • Jasmine Framework
    • SQL
    • MongoDB
    • MySQL
    • WordPress
  • Contributions
    • Medium
    • GitHub
    • Stack Overflow
    • Unsplash
    • ASP.NET Forum
    • C# Corner
    • Code Project
    • DZone
    • MSDN
  • Social Media
    • LinkedIn
    • Facebook
    • Instagram
    • Twitter
  • YouTube
    • Sibeesh Venu
    • Sibeesh Passion
  • Awards
  • Linux Azure Function Isolated Dot Net 9 YAML Template Deployment

  • Build, Deploy, Configure CI &CD Your Static Website in 5 mins

  • Post Messages to Microsoft Teams Using Python

  • Get Azure Blob Storage Blob Metadata Using PowerShell

  • Deploy .net 6 App to Azure from Azure DevOps using Pipelines

IoTRaspberry PI
Home›IoT›Raspberry PI SD Card Provisioning with Windows 10 IoT Core – Create FFU Image and Flash

Raspberry PI SD Card Provisioning with Windows 10 IoT Core – Create FFU Image and Flash

By SibeeshVenu
November 22, 2018
1170
1
Share:
Windows 10 IoT Core After Installation

[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’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’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’s just start doing some amazing things. Let’s just start then.

Background

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’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’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.

Prerequisites

To do the wonderful things, we always need some prerequisites.  You can always see all the prerequisites from here. But, in this part, we are going to be needed only the preceding tools.

  1. Windows Assessment and Deployment Kit (Windows ADK)
  2. Windows Driver Kit (WDK) 10
  3. IoT Core ADK Add-Ons
  4. Windows 10 IoT Core Packages
  5. The Raspberry Pi BSP

Creating the Base Windows IoT FFU Image

I assume that you had already gone through the Prerequisites and followed the instructions. If not, please check again.

Create a Workspace

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.

Running IoTCorePShell.cmd

Running IoTCorePShell.cmd

Now let’s create a workspace now.

New-IoTWorkspace C:\Workspacefolder oemname arm
(or) new-ws C:\workspacefolder oemname arm
new-ws command

new-ws command

Now we have created a workspace successfully. Please be noted that the BSPPKG_DIR is “C:\Program Files (x86)\Windows Kits\10\MSPackages\retail\arm\fre”. I strongly recommend you to check that folder whether you have contents in it or not if there is no content you might haven’t installed the packages mentioned in the prerequisites.

Build BSP

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 GitHub release page. Then you can perform the below commands.

Import-IoTBSP RPi2 C:\Downloads\RPi_BSP.zip
(or) importbsp RPi2 C:\Downloads\RPi_BSP.zip
buildpkg RPi2

If everything is right, you should see an output as below.

Import Raspberry BSP

Import Raspberry BSP

Build Packages

Once you have created the workspace and extracted the BSP, it is time to build all of our packages.

New-IoTCabPackage All
(or) buildpkg all

If you miss this step before you go to the next step, you will get an error as follows when you build your image.

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: 

You will also end up in the similar GitHub issue. Trust me, finding the root cause of this issue took me some hours and at the end, I answered my findings here in StackOverflow.

Building all the packages

Building all the packages

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.

Create a Product

Now let’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.

Add-IoTProduct ProductA RPi2
(or) newproduct MyProductA RPi2

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.

Creating a new Product

Creating a new Product

The command shown in the image will generate a new Product in the Workspace location C:\OEE\Source-arm\Products\OEEIoTCore.

Add-IoTProduct Output

Build the Image

We are almost done, let’s eject all the removable devices from the system and then run the below command.

New-IoTFFUImage <product name> Test
(or)buildimage <product name> Test

This command will give you the FFU image with your base image.

Building Image and Generate FFU File

Building Image and Generate FFU File

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.

Writing/Flashing the FFU Image to SD Card

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 DISM. Let’s create a text file called format.txt and write some commands as preceding.

select disk 1
clean
create partition primary
select partition 1
active
format fs=fat32 quick
assign
exit

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.

echo off
REM Start formatting
diskpart /s format.txt >log.txt

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

ECHO Finish

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’s just go to the folder where these three files are been placed and open a command prompt in administrative power.

  • write.bat
  • format.txt
  • flash.ffu
Flash IoT Core by Commands

Flash IoT Core by Commands

Connect SD Card to Raspberry PI and then Raspberry PI to the Network

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.

Conclusion

Wow!. Now we have learned,

  • how we can generate the IoT core FFU image using PowerShell
  • how to write the same to an SD card.

Is that all? No, in the next article we will learn

  • how we can add our app package to this FFU image which can be used in many Raspberry PI
  • how to generate the FFU image on demand with some chained PowerShell commands.
  • how to use other mechanisms to write the FFU image to the disk

Your turn. What do you think?

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.

Kindest Regards
Sibeesh Venu

TagsdiskpartDISMIoTIoT CorepowershellRaspberry PIRaspberry PI SD Card ProvisioningWindows 10 IoT CoreWindows IoT core by DISM
Previous Article

Setting Up Your Raspberry PI with Microsoft ...

Next Article

Custom Vision AI – Building Your Own ...

0
Shares
  • 0
  • +
  • 0
  • 0
  • 0

SibeeshVenu

I am Sibeesh Venu, an engineer by profession and writer by passion. Microsoft MVP, Author, Speaker, Content Creator, Youtuber, Programmer.

Related articles More from author

  • Raspberry Pi 4, What is There for You, Worth Buying
    IoT

    Raspberry Pi 4, What is There for You, Worth Buying?

    August 11, 2019
    By SibeeshVenu
  • newappxpkg output
    IoTRaspberry PI

    Raspberry PI SD Card Provisioning with Windows 10 IoT Core – Adding Packages to the Existing FFU Image

    December 9, 2018
    By SibeeshVenu
  • AzureIoT

    Azure Stream Analytics Job and Tools for Visual Studio

    December 13, 2018
    By SibeeshVenu
  • Azure

    Change MFA Phone/Mobile Number Using PowerShell

    October 19, 2021
    By SibeeshVenu
  • Serverless Realtime MXChip Data Angular
    AzureIoT

    Realtime IoT Data using Azure SignalR and Functions in Angular

    December 31, 2018
    By SibeeshVenu
  • AzurePowerShell

    Get Azure Blob Storage Blob Metadata Using PowerShell

    May 20, 2022
    By SibeeshVenu
0

My book

Asp Net Core and Azure with Raspberry Pi Sibeesh Venu

YouTube

MICROSOFT MVP (2016-2022)

profile for Sibeesh Venu - Microsoft MVP

Recent Posts

  • Linux Azure Function Isolated Dot Net 9 YAML Template Deployment
  • Build, Deploy, Configure CI &CD Your Static Website in 5 mins
  • Easily move data from one COSMOS DB to another
  • .NET 8 New and Efficient Way to Check IP is in Given IP Range
  • Async Client IP safelist for Dot NET
  • Post Messages to Microsoft Teams Using Python
  • Get Azure Blob Storage Blob Metadata Using PowerShell
  • Deploy .net 6 App to Azure from Azure DevOps using Pipelines
  • Integrate Azure App Insights in 1 Minute to .Net6 Application
  • Azure DevOps Service Connection with Multiple Azure Resource Group

Tags

Achievements (35) Angular (14) Angular 5 (7) Angular JS (15) article (10) Article Of The Day (13) Asp.Net (14) Azure (65) Azure DevOps (10) Azure Function (10) Azure IoT (7) C# (17) c-sharp corner (13) Career Advice (11) chart (11) CSharp (7) CSS (7) CSS3 (6) HighChart (10) How To (9) HTML5 (10) HTML5 Chart (11) Interview (6) IoT (11) Javascript (10) JQuery (82) jquery functions (9) JQWidgets (15) JQX Grid (17) Json (7) Microsoft (8) MVC (20) MVP (9) MXChip (7) News (18) Office 365 (7) Products (10) SQL (20) SQL Server (15) Visual Studio (10) Visual Studio 2017 (7) VS2017 (7) Web API (12) Windows 10 (7) Wordpress (9)
  • .NET
  • Achievements
  • ADO.NET
  • Android
  • Angular
  • Arduino
  • Article Of The Day
  • ASP.NET
  • Asp.Net Core
  • Automobile
  • Awards
  • Azure
  • Azure CDN
  • azure devops
  • Blockchain
  • Blog
  • Browser
  • C-Sharp Corner
  • C#
  • Career Advice
  • Code Snippets
  • CodeProject
  • Cognitive Services
  • Cosmos DB
  • CSS
  • CSS3
  • Data Factory
  • Database
  • Docker
  • Drawings
  • Drill Down Chart
  • English
  • Excel Programming
  • Exporting
  • Facebook
  • Fun
  • Gadgets
  • GitHub
  • GoPro
  • High Map
  • HighChart
  • How to
  • HTML
  • HTML5
  • Ignite UI
  • IIS
  • Interview
  • IoT
  • JavaScript
  • JQuery
  • jQuery UI
  • JQWidgets
  • JQX Grid
  • Json
  • Knockout JS
  • Linux
  • Machine Learning
  • Malayalam
  • Malayalam Poems
  • MDX Query
  • Microsoft
  • Microsoft ADOMD
  • Microsoft MVP
  • Microsoft Office
  • Microsoft Technologies
  • Microsoft Windows
  • Microsoft Windows Server
  • Mobile
  • MongoDB
  • Monthly Winners
  • MVC
  • MVC Grid
  • MySQL
  • News
  • Node JS
  • npm
  • Number Conversions
  • October 2015
  • Office 365
  • Office Development
  • One Plus
  • Outlook
  • Page
  • PHP
  • Poems
  • PowerShell
  • Products
  • Q&A
  • Raspberry PI
  • React
  • SEO
  • SharePoint
  • Skype
  • Social Media
  • Software
  • Spire.Doc
  • Spire.PDF
  • Spire.XLS
  • SQL
  • SQL Server
  • SSAS
  • SSMS
  • Storage In HTML5
  • Stories
  • Third Party Software Apps
  • Tips
  • Tools
  • Translator Text
  • Uncategorized
  • Unit Testing
  • UWP
  • VB.Net
  • Videos
  • Virtual Machine
  • Visual Studio
  • Visual Studio 2017
  • Wamp Server
  • Web API
  • Web Platform Installer
  • Webinars
  • WebMatrix
  • Windows 10
  • Windows 7
  • Windows 8.1
  • Wordpress
  • Writing

ABOUT ME

I am Sibeesh Venu, an engineer by profession and writer by passion. Microsoft MVP, Author, Speaker, Content Creator, Youtuber, Programmer. If you would like to know more about me, you can read my story here.

Contact Me

  • info@sibeeshpassion.com

Pages

  • About
  • Search
  • Privacy Policy
  • About
  • Search
  • Privacy Policy
© Copyright Sibeesh Passion 2014-2025. All Rights Reserved.
Go to mobile version