|
| 1 | +# 64-bit IoT Core |
| 2 | + |
| 3 | +This repo currently provides experimental ARM64 IoT Core support for Raspberry Pi 3 and 4. |
| 4 | + |
| 5 | +The supported version is 1809 (Build 17763). |
| 6 | + |
| 7 | +## 64-bit firmware |
| 8 | + |
| 9 | +A 64-bit UEFI firmware for the corresponding platform is required to export the BSP. |
| 10 | + |
| 11 | +### Raspberry Pi 4 |
| 12 | + |
| 13 | +For the Raspberry Pi 4, firmware from the [Pi Firmware Task Force](https://rpi4-uefi.dev) is used, which provides UEFI and ACPI support. It is available at https://github.com/pftf/RPi4/releases. |
| 14 | + |
| 15 | +Place the firmware files in `bspfiles/RPi4.ARM64/Packages/RPi.BootFirmware`, the following files are required. |
| 16 | + |
| 17 | +```text |
| 18 | +config.txt |
| 19 | +fixup4.dat |
| 20 | +RPI_EFI.fd |
| 21 | +start4.elf |
| 22 | +bcm2711-rpi-4-b.dtb |
| 23 | +bcm2711-rpi-400.dtb |
| 24 | +bcm2711-rpi-cm4.dtb |
| 25 | +``` |
| 26 | + |
| 27 | +### Raspberry Pi 3 |
| 28 | + |
| 29 | +For the Raspberry Pi 3, the Pi Firmware Task Force provides firmware at https://github.com/pftf/RPi3/releases, which provides UEFI and ACPI support. |
| 30 | + |
| 31 | +Place the firmware files in `bspfiles/RPi3.ARM64/Packages/RPi.BootFirmware`, the following files are required. |
| 32 | + |
| 33 | +```text |
| 34 | +bootcode.bin |
| 35 | +config.txt |
| 36 | +fixup.dat |
| 37 | +RPI_EFI.fd |
| 38 | +start.elf |
| 39 | +bcm2710-rpi-3-b.dtb |
| 40 | +bcm2710-rpi-3-b-plus.dtb |
| 41 | +bcm2710-rpi-cm3.dtb |
| 42 | +``` |
| 43 | + |
| 44 | +### 64-bit EFI Customisations |
| 45 | + |
| 46 | +[SMBIOS requirements of Windows 10 IoT Core OEM Licensing](https://docs.microsoft.com/en-us/windows-hardware/manufacture/iot/license-requirements#smbios-support) requires a custom version of RPI_EFI.fd with the proper SMBIOS values. |
| 47 | + |
| 48 | +See [PlatformSmbiosDxe.c](https://github.com/tianocore/edk2-platforms/blob/master/Platform/RaspberryPi/Drivers/PlatformSmbiosDxe/PlatformSmbiosDxe.c) to update the SMBIOS data. Steps to build the RPI_EFI.fd is provided in the [edk2-platforms Github](https://github.com/tianocore/edk2-platforms). |
| 49 | + |
| 50 | +## Export the 64-bit BSP |
| 51 | + |
| 52 | +We provide a `binexport.ps1` script to scrape the BSP components together into a zip file for easy use with the IoT ADK AddonKit. |
| 53 | +1. Open Powershell |
| 54 | +2. Navigate to rpi-iotcore\tools |
| 55 | +3. Run `binexport.ps1` with the appropriate arguments. |
| 56 | + ```powershell |
| 57 | + # Platform: |
| 58 | + # RPi - Raspberry Pi 2/3 32-bit BSP |
| 59 | + # RPi3.ARM64 - Raspberry Pi 3 64-bit BSP (experimental) |
| 60 | + # RPi4.ARM64 - Raspberry Pi 4 64-bit BSP (experimental) |
| 61 | +
|
| 62 | + # OutputDir |
| 63 | + # The output directory for the BSP zip file. |
| 64 | +
|
| 65 | + # IsDebug |
| 66 | + # Specify to package debug binaries. Default is Release binaries. |
| 67 | + .\binexport.ps1 [Platform] [OutputDir] [-IsDebug] |
| 68 | +
|
| 69 | + # Samples |
| 70 | + # 64-bit BSP for Raspberry Pi 3, release binaries |
| 71 | + .\binexport.ps1 RPi3.ARM64 C:\Release |
| 72 | +
|
| 73 | + # 64-bit BSP for Raspberry Pi 4, debug binaries |
| 74 | + .\binexport.ps1 RPi4.ARM64 C:\Debug -IsDebug |
| 75 | + ``` |
| 76 | +4. The script will generate a zip file **RPix.ARM64.BSP.xx.zip** that can be imported into the IoT-ADK-Addonkit shell using [Import-IoTBSP](https://github.com/ms-iot/iot-adk-addonkit/blob/master/Tools/IoTCoreImaging/Docs/Import-IoTBSP.md). |
| 77 | + ```powershell |
| 78 | + Import-IoTBSP RPi3.ARM64 C:\Temp\RPi3.ARM64.BSP.xx.zip |
| 79 | + (or) |
| 80 | + Import-IoTBSP RPi4.ARM64 C:\Temp\RPi4.ARM64.BSP.xx.zip |
| 81 | + ``` |
| 82 | +## Additional Drivers |
| 83 | +
|
| 84 | +Some additional drivers are required for a usable image. |
| 85 | +
|
| 86 | +You'll need the INF-style driver packages. For each INF file, use the following command to create a IoT driver package: |
| 87 | +
|
| 88 | +```powershell |
| 89 | +Add-IoTDriverPackage sample_driver.inf Drivers.Sample |
| 90 | +``` |
| 91 | + |
| 92 | +To add driver packages to your IoT Core image, refer to [Add a driver to an image](https://docs.microsoft.com/en-us/windows-hardware/manufacture/iot/add-a-driver-to-an-image) of the IoT Core manufacturing guide. |
| 93 | + |
| 94 | +**WARNING:** If you are going to commercialize your IoT device, please make sure you have valid licenses for the drivers you use. |
| 95 | + |
| 96 | +### USB Driver for Raspberry Pi 3 |
| 97 | + |
| 98 | +The DWCUSBOTG USB controller driver for Raspberry Pi 2 and 3 is included in the ARM32 IoT Core packages, but not the ARM64 ones. |
| 99 | + |
| 100 | +The original author of this driver, MCCI, released an ARM64 version of the same driver under a **non commercial** license. The driver is available at https://pi64.win/download-usb-drivers/. |
| 101 | + |
| 102 | +Download the standalone driver EXE, run the EXE file to extract the driver files. You'll need to add both `mcci_dwchsotg_hub.inf` and `mcci_dwchsotg_hcd.inf`. |
| 103 | + |
| 104 | +### Drivers for LAN adapters |
| 105 | + |
| 106 | +The ARM64 IoT Core has drivers for the ASIX AX88772 USB 2.0 to Fast Ethernet Adapter builtin, for other adapters, you'll need to provide your own driver. |
| 107 | + |
| 108 | +**WARNING:** The bcmgenet driver in this repo, for the GENET Gigabit LAN adapter on Raspberry Pi 4, is currently **NOT** supported on IoT Core. |
| 109 | + |
| 110 | +- For the builtin adapter on Rasberry Pi 2/3, ARM64 drivers are available from Microchip. \ |
| 111 | +To download, go to https://www.microchip.com/en-us/software-library, search for LAN9500 (for Pi 2/3B) or LAN78xx (for Pi 3B+), and select the one listed as "LANxxxx Windows (OneCore) Device Drivers".\ |
| 112 | +Download the zip package, and extract the files at `ndis650/arm64`. |
| 113 | + |
| 114 | +- For Realtek USB LAN adapters (RTL8152, RTL8153, etc), ARM64 drivers are available on Realtek website at https://www.realtek.com/component/zoo/category/network-interface-controllers-10-100-1000m-gigabit-ethernet-usb-3-0-software. \ |
| 115 | +Download the "Win10 Auto Installation Program", open the install EXE with 7-zip, and extract the files at `WIN10/arm64`. |
| 116 | + |
| 117 | +- **For testing purposes,** you may also extract drivers from a Windows 10 ARM64 v1809 (Build 17763) Desktop image. \ |
| 118 | +You can get drivers for these adapters in the following locations: \ |
| 119 | +Realtek USB adapters: `Windows\System32\DriverStore\FileRepository\rtuarm64w10.inf_arm64_15e06ca8abe46b2a` \ |
| 120 | +ASIX AX88179: `Windows\System32\DriverStore\FileRepository\netax88179_178a.inf_arm64_c5dc3d41b0e4583b` |
| 121 | + |
| 122 | +## User Interface and App Compatibility |
| 123 | + |
| 124 | +ARM64 IoT Core does not contain the default graphical user interface. By default, the resulting image will boot to a blank screen and have to be managed via the Device Portal web interface or SSH. |
| 125 | + |
| 126 | +The UI App, IoTCoreDefaultApp, is available in source at https://github.com/Microsoft/Windows-iotcore-samples/tree/master/Samples/IoTCoreDefaultApp. To add this app to your image, refer to [Add an app to your image](https://docs.microsoft.com/en-us/windows-hardware/manufacture/iot/deploy-your-app-with-a-standard-board) of the IoT Core manufacturing guide. |
| 127 | + |
| 128 | +IoT Core does not support WOW (Windows on Windows), so only ARM64 apps run on ARM64 IoT Core. |
| 129 | + |
| 130 | +## GPIO, I2C, SPI Access via WinRT API |
| 131 | + |
| 132 | +GPIO should work out of the box via the `Windows.Device.Gpio` API. |
| 133 | + |
| 134 | +I2C and SPI access will **not** work on PFTF / upstream TianoCore firmware, since upstream TianoCore has updated the pin muxing declaration from the Microsoft-proprietary `MsftFunctionConfig` to the new standardized `PinFunction`. |
| 135 | + |
| 136 | +Windows support for `PinFunction` is added in v1903 (Build 18362), therefore I2C and SPI will not work on IoT Core unless this change is reverted. |
| 137 | + |
| 138 | +For more information, check out https://edk2.groups.io/g/devel/message/56396, https://github.com/andreiw/RaspberryPiPkg/issues/132, and https://github.com/andreiw/RaspberryPiPkg/commit/87f3611f9da37f594421bbaf513b9aaccee72176. |
0 commit comments