Presentation is loading. Please wait.

Presentation is loading. Please wait.

请点击以下链接下载WinHEC的演讲材料 Download WinHEC presentations here:

Similar presentations


Presentation on theme: "请点击以下链接下载WinHEC的演讲材料 Download WinHEC presentations here:"— Presentation transcript:

1 请点击以下链接下载WinHEC的演讲材料 Download WinHEC presentations here:

2 Accessing GPIO, I2C, and UART Devices
Devin Wong (Chinese Presenter) Fred Bhesania (English Presenter)

3 Windows provides a simplistic framework to communicate with devices on Low Power Buses (LPB).

4 Introduction and Agenda
Tech Ready 15 4/16/2017 Introduction and Agenda Session introduction Modern devices and sensors use a combination of low power buses (e.g. GPIO, SPI, I2C, UART, etc.) to connect and interact with each other. This session will introduce you to the different frameworks that Windows provides for you to write a sensor or device client driver on these low power buses. Session agenda An overview of Windows’ low power buses Walkthrough of an accelerometer sensor driver over the I2C bus Best Practices and Tips to Avoid Common Errors References and Call to Action © 2012 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product names are or may be registered trademarks and/or trademarks in the U.S. and/or other countries. The information herein is for informational purposes only and represents the current view of Microsoft Corporation as of the date of this presentation. Because Microsoft must respond to changing market conditions, it should not be interpreted to be a commitment on the part of Microsoft, and Microsoft cannot guarantee the accuracy of any information provided after the date of this presentation. MICROSOFT MAKES NO WARRANTIES, EXPRESS, IMPLIED OR STATUTORY, AS TO THE INFORMATION IN THIS PRESENTATION.

5 Overview of Windows Low Power Buses Architecture
4/16/2017 5:01 PM Overview of Windows Low Power Buses Architecture © 2014 Microsoft Corporation. All rights reserved. MICROSOFT MAKES NO WARRANTIES, EXPRESS, IMPLIED OR STATUTORY, AS TO THE INFORMATION IN THIS PRESENTATION.

6 Low power buses on Windows
4/16/2017 5:01 PM Low power buses on Windows GPIO Used as an interrupt or for general I/O Buttons, switches, lights, system wake, etc. Interrupts for SPB, serial, and other buses I2C, SPI Simple Peripheral Buses (SPB) = I2C, SPI I2C: 100Kbps-3.4Mbps, SPI: Up to 160Mbps Typically used for: Input / HID Radios Sensors Power management UART High Speed UART Up to 20Mbps No COM ports Bluetooth, GPS © 2014 Microsoft Corporation. All rights reserved. MICROSOFT MAKES NO WARRANTIES, EXPRESS, IMPLIED OR STATUTORY, AS TO THE INFORMATION IN THIS PRESENTATION.

7 Device connections with low power buses
4/16/2017 5:01 PM Device connections with low power buses System Chipset I2C 1 GPIO I2C 2 UART Accelerometer Ambient Light Sensor Touchpad Bluetooth Radio © 2014 Microsoft Corporation. All rights reserved. MICROSOFT MAKES NO WARRANTIES, EXPRESS, IMPLIED OR STATUTORY, AS TO THE INFORMATION IN THIS PRESENTATION.

8 Resource Hub Connects the Pieces Together
4/16/2017 5:01 PM Resource Hub Connects the Pieces Together Firmware ACPI I2C GPIO I2C UART Resource Hub IHV SoC Vendor Microsoft Accelerometer Ambient Light Sensor Touchpad Bluetooth Radio Firmware © 2014 Microsoft Corporation. All rights reserved. MICROSOFT MAKES NO WARRANTIES, EXPRESS, IMPLIED OR STATUTORY, AS TO THE INFORMATION IN THIS PRESENTATION.

9 Device manager representation
Resource Hub is the key piece that ties the right controllers with peripherals. Developers, IT Managers and enthusiasts can clearly identify the topology and manage the device just like any other Plug&Play device.

10 Typical device driver architecture
4/16/2017 5:01 PM Typical device driver architecture UMDF UMDF Class Extension Driver (e.g. Sensor Class Extension) Peripheral Device Driver KMDF KMDF Class Extension Bus Driver KMDF Class Extension Bus Driver Bus Controller Driver Bus Controller Driver IHV Peripheral Hardware SoC Vendor Microsoft © 2014 Microsoft Corporation. All rights reserved. MICROSOFT MAKES NO WARRANTIES, EXPRESS, IMPLIED OR STATUTORY, AS TO THE INFORMATION IN THIS PRESENTATION.

11 GPIO framework GPIO components GPIO framework benefits
4/16/2017 5:01 PM GPIO framework GPIO components GPIO controller driver: Manages hardware-specific operations for a GPIO controller. Driver provided by SoC silicon partner. GPIO class extension driver: Provides hardware-agnostic GPIO functionality for the device driver. Provided by Microsoft. GPIO framework benefits Device driver can use GPIO pins as I/O resources or interrupts. Framework abstracts GPIO physical interrupts as ordinary interrupts and helps route them to their respective interrupt service routines. Framework manages the I/O callbacks to the hardware on reads and writes. Device Driver GPIO Class Extension Driver (GpioClx.sys) GPIO Controller Driver Physical Hardware © 2014 Microsoft Corporation. All rights reserved. MICROSOFT MAKES NO WARRANTIES, EXPRESS, IMPLIED OR STATUTORY, AS TO THE INFORMATION IN THIS PRESENTATION.

12 SPB (I2C, SPI) framework SPB components Device Driver
4/16/2017 5:01 PM SPB (I2C, SPI) framework SPB components SPB controller driver: Manages hardware-specific operations for an I2C or SPI controller. Driver provided by SoC silicon partner. SPB framework extension: Abstracts bus-specific and controller-specific I/O handling from the device driver. Provided by Microsoft. SPB device driver: The driver that communicates with the peripheral attached to I2C/SPI. Driver provided by peripheral IHV or Microsoft. SPB framework benefits Single device driver can be used for different bus types (e.g. I2C, SPI) The framework is scalable to support other simple buses in the future Framework manages I/O requests to the hardware on reads and writes. Frameworks allows client drivers to perform complicated sequences via an atomic Sequence IOCTL. Handled by the Framework, not each client driver. Support for complex I/O requests, such as connection or controller locks. Full-duplex I/O operations are supported by controllers for buses such as SPI that can simultaneously read and write data. Device Driver SPB Framework Extension (SpbCx.sys) I2C or SPI Controller Driver Physical Hardware © 2014 Microsoft Corporation. All rights reserved. MICROSOFT MAKES NO WARRANTIES, EXPRESS, IMPLIED OR STATUTORY, AS TO THE INFORMATION IN THIS PRESENTATION.

13 SPB Client Driver - HID over I2C
Microsoft’s peripherals class driver over I2C. Industry standard supported by over 100 hardware partners. Common peripherals include touch, sensors, HID, etc. Characteristics Supports any I2C Speed (100K-1M recommended) Requires out-of-band interrupt mechanism (e.g. GPIO line) Supports wakeup from low power states Debugability (ETW & WPP) enabled in the driver.

14 Serial framework – SerCX V2
4/16/2017 5:01 PM Serial framework – SerCX V2 Serial components Serial controller driver: Manages hardware-specific operations for an serial controller (UART). Driver provided by SoC silicon partner. Serial framework extension: Abstracts controller-specific I/O handling from the device driver. Provided by Microsoft. Serial device driver: The driver that communicates with the peripheral attached to the UART. Driver provided by peripheral IHV or Microsoft. Serial framework benefits Version 2.0 provided in Windows 8.1. Simplifies controller driver creation, diagnosability and power management. Standardized client driver interface for V1 and V2. Hardware flowcontrol recommended/supported to prevent FIFO overflow. Device Driver Serial Framework Extension (SerCx2.sys) Serial (UART) Controller Driver Physical Hardware © 2014 Microsoft Corporation. All rights reserved. MICROSOFT MAKES NO WARRANTIES, EXPRESS, IMPLIED OR STATUTORY, AS TO THE INFORMATION IN THIS PRESENTATION.

15 4/16/2017 5:01 PM Example: Accelerometer sample driver lower edge and how it communicates over I2C & GPIO © 2014 Microsoft Corporation. All rights reserved. MICROSOFT MAKES NO WARRANTIES, EXPRESS, IMPLIED OR STATUTORY, AS TO THE INFORMATION IN THIS PRESENTATION.

16 Example: Accelerometer sensor
4/16/2017 5:01 PM Example: Accelerometer sensor ADXL345Acc accelerometer Simple low-power 3-axis accelerometer. UMDF V2.0 sensors driver Steps to success: Select and setup your development environments Adapt the driver to your Hardware Install the driver (via Plug&Play) Validate using the tools provided UMDF V2 Sensors Class Extension ADXL345Acc Driver (UMDF V2.0) SpbCx.sys GpioClx.sys I2C Controller Driver GPIO Controller Driver ADXL345Acc Peripheral © 2014 Microsoft Corporation. All rights reserved. MICROSOFT MAKES NO WARRANTIES, EXPRESS, IMPLIED OR STATUTORY, AS TO THE INFORMATION IN THIS PRESENTATION.

17 Qualcomm Reference Board
1. Setting up your Environments Hardware Capabilities on Development Platforms Sharkscove Minnowboard Max Qualcomm Reference Board Raspberry Pi 2 OS Architecture X86 X86, x64 ARM Operating System SKU Supported Desktop, IOT Mobile, IOT IOT GPIO Capabilities - # available GPIO Lines 2 dedicated GPIO, 6 assigned V 3 dedicated 3.3V Supported 40 Pins I2C Capabilities (# Controllers; Max Speed) 5 shared controllers 100Kbps - V Supported (Bitbang) SPI Capabilities (# Controllers; Max Speed) N/A 2 controllers 3.3V Supported (low speed bitbang) UART Capabilities - Max BAUD Rates 2 controllers, 1 header 3,686,400 3.3V Supported (1Mbps)

18 2. Adapt the Driver to Hardware
WinHEC 2015 2. Adapt the Driver to Hardware 4/16/2017 5:01 PM Goal Build a driver from a sample and adapt it to your specific hardware Key Tasks to perform Set up your Device Object / hardware Configure the device from driver Start the device activity Stop the device activity (standby) Disconnect hardware resources Resource Lists List of hardware resources the driver should use to communicate with the device IO Target WDF object used to send IO requests to another driver Device Power States (D0 – D3) D0 is powered. D1 – D3 are sleep states IRQL DPCs & Workitems © 2015 Microsoft Corporation. All rights reserved. MICROSOFT MAKES NO WARRANTIES, EXPRESS, IMPLIED OR STATUTORY, AS TO THE INFORMATION IN THIS PRESENTATION.

19 Visual Studio – I2C Accelerometer Code Sample

20 3. Install the driver Goal Secure Boot Required Steps Test Signing
WinHEC 2015 3. Install the driver 4/16/2017 5:01 PM Goal Load the driver on the ADXL345 accelerometer sensor. Required Steps Disable Secure Boot and turn on test signing (Done by WDK) Specify the hardware resources in ACPI Create an INF to match on the declared resource Secure Boot Leverages UEFI specification’s secure boot functionality to help prevent malicious software applications/OS from loading during the system start-up process. Test Signing Allows the driver developer to load test-signed kernel mode code/drivers. AutoACPI New in Windows 10 to enable developers to update ACPI using simple software constructs. Builds on ACPIGen and reduces the tax to developers to learn © 2015 Microsoft Corporation. All rights reserved. MICROSOFT MAKES NO WARRANTIES, EXPRESS, IMPLIED OR STATUTORY, AS TO THE INFORMATION IN THIS PRESENTATION.

21 3. Install the driver Specifying the hardware resources in ACPI
4/16/2017 5:01 PM 3. Install the driver Specifying the hardware resources in ACPI Device(SPBA)  { Name (_HID, "ADXL0345")   Name(_CRS, ResourceTemplate () { I2CSerialBus(0x53, ControllerInitiated, , AddressingMode7Bit, "\\_SB.I2C3", 0, ResourceConsumer) GpioInt(Edge, ActiveHigh, Exclusive, PullDown, 0, "\\_SB.GPO2") {0x17} }) } Hardware ID: “ADXL0345”. ACPI.sys will use this information I2C3, Address 0x53, 400kHz GPIO2, Edge interrupt on #17 © 2014 Microsoft Corporation. All rights reserved. MICROSOFT MAKES NO WARRANTIES, EXPRESS, IMPLIED OR STATUTORY, AS TO THE INFORMATION IN THIS PRESENTATION.

22 3. Install the driver ACPI Generation Framework (ACPIGenFx)
New in Win10 var platform = Platforms.Createx86Platform( "PWIE", "EDK2", "PWIE", 1, "SSDT"); var sensor = platform.AddGenericDevice( 1); sensor.AddI2CSerialBus( SlaveAddress: 0x53, Mode: SlaveMode.ControllerInitiated, ConnectionSpeed: 400 * 1000, addressmode: AddressMode._7Bit, sensor.AddGPIOInterrupt( Type: InterruptType.Level, ActiveLevel: InterruptActiveLevel.ActiveHigh, Shared: SharingLevel.Exclusive, PinConfiguration: PinConfiguration.Down, DebounceTimeout: 0, PinNumber: 1, platform.WriteAsl(); Step 1: Start with an x86 default platform Step 2: Add device’s HWID Step 3: Add an I2C serial bus resource address 0x53 on I2C controller 3 400 KHz clock Step 4: Add a GPIO interrupt line Pin 1 on GPIO controller 2 Active high, level triggered interrupt Enable pull-down resistors for line No debouncing Step 5: Write the source code for the ACPI table © 2010 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product names are or may be registered trademarks and/or trademarks in the U.S. and/or other countries. The information herein is for informational purposes only and represents the current view of Microsoft Corporation as of the date of this presentation. Because Microsoft must respond to changing market conditions, it should not be interpreted to be a commitment on the part of Microsoft, and Microsoft cannot guarantee the accuracy of any information provided after the date of this presentation. MICROSOFT MAKES NO WARRANTIES, EXPRESS, IMPLIED OR STATUTORY, AS TO THE INFORMATION IN THIS PRESENTATION.

23 3. Install the driver Value proposition of ACPI Generation Framework
C# library used to generate ACPI firmware tables for HW-reduced SoC-based platforms. Advantages: Software developer friendly – Devices, resources, and dependencies are descried as C# objects. Visual Studio’s Intellisense to make it easier to code. Framework is aware of Windows specific requirements. Catches errors at build time via static analysis of the platform. Samples and templates available to get started quickly. ASL is difficult to debug, but with ACPIGenFx developers will experience fewer bugs at runtime.

24 3. Install the driver Create an INF to match on the declared resources
[Version] Signature = "$Windows NT$" Class = Sensor ClassGuid= {5175D334-C B3BA-71FD53C9258D} Provider=%ManufacturerName% CatalogFile=ADXL345Acc.cat DriverVer= [Manufacturer] %ManufacturerName%=Standard,NT$ARCH$ [Standard.NT$ARCH$] %DeviceName%=MyDevice_Install, ACPI\ADXL0345 [Strings] ManufacturerName="Me" DeviceName="ADXL345Acc Device" Step1: Set Device Setup Class for embedded device. © 2010 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product names are or may be registered trademarks and/or trademarks in the U.S. and/or other countries. The information herein is for informational purposes only and represents the current view of Microsoft Corporation as of the date of this presentation. Because Microsoft must respond to changing market conditions, it should not be interpreted to be a commitment on the part of Microsoft, and Microsoft cannot guarantee the accuracy of any information provided after the date of this presentation. MICROSOFT MAKES NO WARRANTIES, EXPRESS, IMPLIED OR STATUTORY, AS TO THE INFORMATION IN THIS PRESENTATION.

25 3. Install the driver Create an INF to match on the declared resources
[Version] Signature = "$Windows NT$" Class = Sensor ClassGuid= {5175D334-C B3BA-71FD53C9258D} Provider=%ManufacturerName% CatalogFile=ADXL345Acc.cat DriverVer= [Manufacturer] %ManufacturerName%=Standard,NT$ARCH$ [Standard.NT$ARCH$] %DeviceName%=MyDevice_Install, ACPI\ADXL0345 [Strings] ManufacturerName="Me" DeviceName="ADXL345Acc Device" Step 2: Set Hardware ID Must match value from ACPI table entry © 2010 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product names are or may be registered trademarks and/or trademarks in the U.S. and/or other countries. The information herein is for informational purposes only and represents the current view of Microsoft Corporation as of the date of this presentation. Because Microsoft must respond to changing market conditions, it should not be interpreted to be a commitment on the part of Microsoft, and Microsoft cannot guarantee the accuracy of any information provided after the date of this presentation. MICROSOFT MAKES NO WARRANTIES, EXPRESS, IMPLIED OR STATUTORY, AS TO THE INFORMATION IN THIS PRESENTATION.

26 3. Install the driver Create an INF to match on the declared resources
[Version] Signature = "$Windows NT$" Class = Sensor ClassGuid= {5175D334-C B3BA-71FD53C9258D} Provider=%ManufacturerName% CatalogFile=ADXL345Acc.cat DriverVer= [Manufacturer] %ManufacturerName%=Standard,NT$ARCH$ [Standard.NT$ARCH$] %DeviceName%=MyDevice_Install, ACPI\ADXL0345 [Strings] ManufacturerName="Me" DeviceName="ADXL345Acc Device" Step 3: Set manufacturer & device name © 2010 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product names are or may be registered trademarks and/or trademarks in the U.S. and/or other countries. The information herein is for informational purposes only and represents the current view of Microsoft Corporation as of the date of this presentation. Because Microsoft must respond to changing market conditions, it should not be interpreted to be a commitment on the part of Microsoft, and Microsoft cannot guarantee the accuracy of any information provided after the date of this presentation. MICROSOFT MAKES NO WARRANTIES, EXPRESS, IMPLIED OR STATUTORY, AS TO THE INFORMATION IN THIS PRESENTATION.

27 Recap of What we Learnt So far, we successfully did the following:
Select and setup the development environment Adapted the driver to your device Install the driver (via Plug&Play) Validate using the tools provided

28 Best Practices and Tips to Avoid Common Errors
4/16/2017 5:01 PM Best Practices and Tips to Avoid Common Errors © 2014 Microsoft Corporation. All rights reserved. MICROSOFT MAKES NO WARRANTIES, EXPRESS, IMPLIED OR STATUTORY, AS TO THE INFORMATION IN THIS PRESENTATION.

29 Samples and Tools To Get Started
4/16/2017 5:01 PM Samples and Tools To Get Started Start with a pertinent MSDN samples GPIO: SimDevice – a sample driver that consumes GPIO interrupt and IO resources SPB: SpbTestTool driver and app for I2C, SPI; SpbAccelerometer sample sensor driver on I2C UART: UART controller driver for PCs; Bluetooth UART bus driver sample Validate with these test tools SpbTestTool driver and app for I2C, SPI – validates the resources are defined properly in ACPI MITT and HLK (controller testing only) © 2014 Microsoft Corporation. All rights reserved. MICROSOFT MAKES NO WARRANTIES, EXPRESS, IMPLIED OR STATUTORY, AS TO THE INFORMATION IN THIS PRESENTATION.

30 SpbTestTool Windows Sample Driver enabling the following developer scenarios: Opens a handle to the SPB controller, use the SPB interface from a KMDF driver, and employ GPIO passive-level interrupts. It implements a set of commands for communicating with a peripheral device to aid in debugging. References: wshardware/SpbTestTool- adda6d71#content Tips and Tricks Device you intend to load SpbTestTool driver on must be defined in ACPI (e.g ACPI\HWID1234). See spbtesttool.asl in the source code for a complete example.

31 Windows Apps and Low Power Buses
Provide Windows Apps access to low level I2C, SPI and GPIO devices for IOT scenarios and diagnosability. WinRT APIs in the Windows.Devices namespace that provide easy access to these devices to Windows Apps. Available first on Windows “Athens” (IoT) OS editions and then on other editions too.

32 WinRT APIs Details Windows.Devices.[GPIO|SPI|I2C]
APIs follow existing “Windows.Devices” API patterns and give direct access to these busses either in shared or exclusive access mode Samples available identifying the common use-cases.                 // Blink the LED 10 times.                 for (int i = 0; i < 10; ++i)                 {                     pin.Write(GpioPinValue.Low);                     await Task.Delay(200);                     pin.Write(GpioPinValue.High);                 }

33 Hardware Lab Kit Content
Tips and Tricks for OEMs HLK version targeted at SoC Vendors QA team. Simpler UI and streamlined MSDN provides headless versions (no UI / command line). Richer command line options Tests can be run individually No need for HLK server Device Testing – IHVs No LPB specific assessments needed. Each Device Class has its own requirements and associated assessments in HLK to exercise the code Controller testing – OEMs Primarily targeted for SOC silicon Vendors OEMs can optionally run the tests but need open chassis systems

34 Multiple Interface Test Tool (MITT)
GPIO Microsoft developed test tool for validating Hardware/Software Supported buses : I2C, GPIO, UART, SPI. Firmware and software provided by Microsoft Framework for additional development by the hardware developer available. Available at Diligent and JJG Technologies References: us/library/windows/hardware/dn919874%2 8v=vs.85%29.aspx New in Win10 I2C SPI

35 Troubleshooting INF Errors
Topic: Driver not loading correctly on hardware Design SetupAPI logs information about device installation. Use it to verify or troubleshoot device installation Filename: SetupAPI.dev.log (in %SystemRoot%\inf) References: us/library/windows/hardware/ff (v=vs.85).aspx

36 Troubleshooting I2C Removable Devices
ACPI tables must identify devices that may be “attached” in future. Device present at boot? Set _STA == 0x0F; else Set _STA == 0x00 Device removed/connected after boot: the platform triggers a Platform Event (GPIO interrupt or GPE Event). The handler (_Lxx/_Exx/_EVT) must: Change accordingly the value of _STA for each device that arrived/disappeared Signal the OS that a BUS CHECK event has occurred using the Notify() operator. Send the notification to the lowest parent of ALL CHANGED DEVICES in the table. ACPI will re-enumerate devices below the notified device (e.g. ALS,), removing or adding Windows device nodes as appropriate. Windows will load drivers, or ADD_DEVICE to already loaded drivers.

37 Troubleshooting WPP Tracing
Topic: How to debug loading and runtime errors in your driver Design Trace GUID (in SensorsTrace.h) Sensor device unique GUID (in device.cpp) Traceview: configures and controls trace sessions and displays formatted trace messages from real-time trace sessions

38 Demo : Debugging an issue in the SPB Peripheral Driver
Code 10, why? Demo : Debugging an issue in the SPB Peripheral Driver

39 Demo Script Load Accelerometer driver in VS14 Show the device registers in the .h files and sending the custom I2C commands during device initialization Show how to add IHV side errors ETW logging Throw a programmatic error Load the dump in VS (pre-recorded) Show the associated tracing

40 Common Errors & Best Practices
HID I2C Specific Errors: Hid I2C Class driver Code 10 – Errors in HID or Report Descriptor. Hid I2C Class driver Code 28 – Device failed the Set_power HID I2C command. Turn on ETW/WPP Tracing in HIDI2C to debug specifics issues. Best Practices for LPB drivers: Test your peripheral on a development board first. LPB Peripherals drivers should start with UMDF (ensure that Major Version is 2). Try to have dedicated GPIO line for peripheral reset. This helps “hard reset” a stuck device.

41 Call to action Get a jump-start on writing LPB peripheral drivers
Visit the sensors talk and lab at WinHEC to practice what you learned today. Attend the sensors booth to review our custom sensors demo Review our samples and documentation on MSDN. Send us feedback / questions Run HLK and validation tools

42 More information MSDN references Support Aliases
4/16/2017 5:01 PM More information MSDN references GPIO - SPB - UART - Spb cookbook - MITT - WPP Tracing - Support Aliases Developer support alias for Low Power Buses: microsoft.com Questions on MITT or HLK tools: microsoft.com © 2014 Microsoft Corporation. All rights reserved. MICROSOFT MAKES NO WARRANTIES, EXPRESS, IMPLIED OR STATUTORY, AS TO THE INFORMATION IN THIS PRESENTATION.

43 Lab: Getting Started with Driver Dev Lunch
Grand Ballroom III Mansion VIII 12:30 Introduction to Hardware Lifecycle 13:40 Tools for Windows Driver Development 15:00 Intro to Windows Driver Development 16:10 Writing Drivers with the WDF <Day 2> 10:30 Lab: Getting Started with Driver Dev 11:30 Lunch Accessing GPIO, I2C, and UART devices Lab: Driver Testing and Debugging Driver Testing and Debugging Lab: Sensor Driver on Sharks Cove Testing with the Hardware Lab Kit Intro to Driver Signing, Distribution, Servicing Lab: Testing with the Hardware Lab Kit 17:20 <Day 3> 09:00 10:10 WinHEC 2015 4/16/2017 5:01 PM © 2015 Microsoft Corporation. All rights reserved. MICROSOFT MAKES NO WARRANTIES, EXPRESS, IMPLIED OR STATUTORY, AS TO THE INFORMATION IN THIS PRESENTATION.

44 Tech Ready 15 4/16/2017 请对本会议进行评价 您的反馈对我们至关重要! Please Complete an Evaluation. Your input is important! 请通过以下链接访问评价表: Access Evaluation Forms: 加入Windows硬件社区 扫一扫,通过微信关注WinHEC © 2012 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product names are or may be registered trademarks and/or trademarks in the U.S. and/or other countries. The information herein is for informational purposes only and represents the current view of Microsoft Corporation as of the date of this presentation. Because Microsoft must respond to changing market conditions, it should not be interpreted to be a commitment on the part of Microsoft, and Microsoft cannot guarantee the accuracy of any information provided after the date of this presentation. MICROSOFT MAKES NO WARRANTIES, EXPRESS, IMPLIED OR STATUTORY, AS TO THE INFORMATION IN THIS PRESENTATION.

45 4/16/2017 5:01 PM (c) 2015 Microsoft Corporation.  All rights reserved.  This document is provided "as-is." Information and views expressed in this document, including URL and other Internet Web site references, may change without notice. You bear the risk of using it.  This document does not provide you with any legal rights to any intellectual property in any Microsoft product. You may copy and use this document for your internal, reference purposes. Some information relates to pre-released product which may be substantially modified before it’s commercially released. Microsoft makes no warranties, express or implied, with respect to the information provided here. © 2014 Microsoft Corporation. All rights reserved. MICROSOFT MAKES NO WARRANTIES, EXPRESS, IMPLIED OR STATUTORY, AS TO THE INFORMATION IN THIS PRESENTATION.

46 Appendix

47 Top 3 Most Common Errors for HID I2C: Driver Does Not Load
ISSUE: HIDI2C driver is not loaded in Device Manager for the DEVICE (I2C Peripheral), but I2C Controller driver is loaded REASON: Invalid ASL Code for HOST or DEVICE. Errors in ASL manifest as: The HIDI2C driver will not load (INF match failed - see setupapi.dev.log) The HIDI2C driver will load with Error Code 10. (More details to follow). OEM must ensure highlighted items are valid _HID (Vendor specific) and _CID ( fixed to “PNP0C50”) I2C Controller and Device characteristics are accurate HID Descriptor Address is correctly Identified for that specific DEVICE Please pay special attention to the following GPIO Interrupt is correctly identified and marked as Exclusive, Level, ActiveLow Please refer to Section 13 (Example Section) in the HID over I2C Specification for more details

48 Top 3 Most Common Errors for HID I2C: Driver comes up “Code 10”
ISSUE: HIDI2C driver is Error Code 10 in Device Manager REASON: If the DEVICE has an invalid HID Descriptor, the HIDI2C driver loads with Error Code 10. Did the HOST retrieve correct HID Descriptor from DEVICE. If not, focus on the following Validate HID Descriptor Address entry in ASL. Observe I2C traffic to DEVICE to see if HOST is requesting correctly. Did the HOST retrieve correct response to Reset (HIR) from the DEVICE. If not, focus on the following Validate entries in Byte Offset 16 and 18 of HID Descriptor Validate the DEVICE responded correctly to HIR request (asserted GPIO Interrupt + 0x00 0x00 in Input Register) <Continued on next page> Byte Offset Field VALUE (HEX) Notes wHIDDescLength 00 18 Fixed 2 bcdVersion 01 00 4 wReportDescLength TBD Device IHV must set correctly 6 wReportDescRegister 8 wInputRegister 10 wMaxInputLength 12 wOutputRegister 14 wMaxOutputLength 16 wCommandRegister 18 wDataRegister 20 RESERVED

49 Top 3 Most Common Errors for HID I2C: Driver Comes up “Code 10”
SAMPLE ACCELEROMETER REPORT DESCRIPTOR ====================================== USAGE_PAGE (Sensors) USAGE (Motion: Accelerometer 3D) COLLECTION (Physical) A1 00 //<FEATURES> USAGE (Property: Connection Type) 0A 09 03 LOGICAL_MINIMUM (0) LOGICAL_MAXIMUM (255) 26 FF 00 REPORT_SIZE (16) REPORT_COUNT (1) FEATURE (Data,Var,Abs) B1 02 //Shake Event Notification USAGE (Data: Motion Intensity) 0A 51 04 LOGICAL_MAXIMUM (64) REPORT_SIZE (8) INPUT (Data,Var,Abs) //</INPUT> END_COLLECTION C0 Did the HOST retrieve correct Report Descriptor from DEVICE and did HIDPARSE succeed in parsing the Report Descriptor. If not, focus on the following If Report Descriptor is NOT retrieved from the DEVICE, Ensure enumeration sequence has passed all steps before Report Descriptor retrieval. Ensure Byte Offset 4 and 6 in HID Descriptor are valid and correct (especially length). If the Report Descriptor is retrieved from the DEVICE but still fails Validate the wReportDescLength field to ensure that the entire Report Descriptor was retrieved. Validate HID Report is correctly formatted based on the device class driver specifications. Test on an alternative bus like USB to validate conformance.

50 Top 3 Most Common Errors for HID I2C: No Input Reports
ISSUE: HIDI2C driver is not receiving any input reports when device has data REASON: Please review the following in order Incorrect values in Byte Offset 8 and 10 of HID Descriptor. GPIO line not being asserted by the DEVICE or being acknowledged by the HOST driver. The Input Report is malformed (doesn’t conform to the Report Descriptor) and is being discarded by the operating system’s HID Parser The Input Report is not is accordance with the requirements of the class driver for that HID device class and hence is not being utilized.

51 Please Complete an Evaluation. Your input is important!
Tech Ready 15 4/16/2017 Please Complete an Evaluation. Your input is important! Access Evaluation Forms: © 2012 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product names are or may be registered trademarks and/or trademarks in the U.S. and/or other countries. The information herein is for informational purposes only and represents the current view of Microsoft Corporation as of the date of this presentation. Because Microsoft must respond to changing market conditions, it should not be interpreted to be a commitment on the part of Microsoft, and Microsoft cannot guarantee the accuracy of any information provided after the date of this presentation. MICROSOFT MAKES NO WARRANTIES, EXPRESS, IMPLIED OR STATUTORY, AS TO THE INFORMATION IN THIS PRESENTATION.

52 4/16/2017 5:01 PM (c) 2015 Microsoft Corporation.  All rights reserved.  This document is provided "as-is." Information and views expressed in this document, including URL and other Internet Web site references, may change without notice. You bear the risk of using it.  This document does not provide you with any legal rights to any intellectual property in any Microsoft product. You may copy and use this document for your internal, reference purposes. Some information relates to pre-released product which may be substantially modified before it’s commercially released. Microsoft makes no warranties, express or implied, with respect to the information provided here. © 2014 Microsoft Corporation. All rights reserved. MICROSOFT MAKES NO WARRANTIES, EXPRESS, IMPLIED OR STATUTORY, AS TO THE INFORMATION IN THIS PRESENTATION.


Download ppt "请点击以下链接下载WinHEC的演讲材料 Download WinHEC presentations here:"

Similar presentations


Ads by Google