<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Trouble using Apollo Lake GPIO in Windows in Embedded Intel Atom® Processors</title>
    <link>https://community.intel.com/t5/Embedded-Intel-Atom-Processors/Trouble-using-Apollo-Lake-GPIO-in-Windows/m-p/254289#M2602</link>
    <description>&lt;P&gt;Hello, scorbin&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks for sharing your solution with the rest of the community, your contribution is greatly appreciated.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Best Regards,&lt;/P&gt;&lt;P&gt;Adolfo Sanchez&lt;/P&gt;</description>
    <pubDate>Sat, 01 Dec 2018 01:56:53 GMT</pubDate>
    <dc:creator>Adolfo_S_Intel</dc:creator>
    <dc:date>2018-12-01T01:56:53Z</dc:date>
    <item>
      <title>Trouble using Apollo Lake GPIO in Windows</title>
      <link>https://community.intel.com/t5/Embedded-Intel-Atom-Processors/Trouble-using-Apollo-Lake-GPIO-in-Windows/m-p/254286#M2599</link>
      <description>&lt;P&gt;I've been following the &lt;A href="https://docs.microsoft.com/en-us/windows-hardware/drivers/gpio/"&gt;https://docs.microsoft.com/en-us/windows-hardware/drivers/gpio/&lt;/A&gt; Windows GPIO Driver Design Guide and have the Intel Controller Driver installed; which I downloaded from &lt;A href="https://www.intel.com/content/dam/www/public/us/en/zip/atom-e3900-board-support-package-iot-platforms.zip"&gt;https://www.intel.com/content/dam/www/public/us/en/zip/atom-e3900-board-support-package-iot-platforms.zip&lt;/A&gt; here.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I then followed the &lt;A href="https://github.com/Microsoft/Windows-driver-samples/tree/master/gpio/samples/simdevice"&gt;https://github.com/Microsoft/Windows-driver-samples/tree/master/gpio/samples/simdevice&lt;/A&gt; WDK GPIO simdevice sample making only changes to the inf to load for the new ACPI device I defined in a new BIOS build.  My new ACPI device shows up in the Windows device manager, my simdevice peripheral driver loads for it and &lt;I&gt;PrepareHardware &lt;/I&gt;hands me the 8 GpioIo I defined in ASL.  When calling &lt;I&gt;WdfCmResourceListGetDescriptor(ResourcesTranslated, index); &lt;/I&gt;for each resource their descriptor types are &lt;I&gt;CmResourceTypeConnection; &lt;/I&gt;as expected. Their connection class is &lt;I&gt;CM_RESOURCE_CONNECTION_CLASS_GPIO &lt;/I&gt;and their connection type is &lt;I&gt;CM_RESOURCE_CONNECTION_TYPE_GPIO_IO&lt;/I&gt;.  It seems like that part is working properly.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In order to send the &lt;I&gt;IOCTL_GPIO_READ_PINS&lt;/I&gt; to the controller driver the sample indicates I need to:&lt;/P&gt;&lt;OL&gt;&lt;LI&gt;Create an IoTarget with the &lt;I&gt;ParentObject&lt;/I&gt; set to the WDFDEVICE that my peripheral driver created.  Shown &lt;A href="https://github.com/Microsoft/Windows-driver-samples/blob/master/gpio/samples/simdevice/simdevice.c#"&gt;https://github.com/Microsoft/Windows-driver-samples/blob/master/gpio/samples/simdevice/simdevice.c#&lt;/A&gt; L704 here.&lt;/LI&gt;&lt;LI&gt;Open the IoTarget specifying a &lt;I&gt;RequestString&lt;/I&gt; and the desired access levels&lt;OL&gt;&lt;LI&gt;The &lt;I&gt;RequestString&lt;/I&gt; is created by using the &lt;I&gt;RESOURCE_HUB_CREATE_PATH_FROM_ID&lt;/I&gt; macro.  I provide the ConnectionId of the GPIO I want to target.  The ConnectionId was provided to my driver during &lt;I&gt;PrepareHardware&lt;/I&gt;.&lt;/LI&gt;&lt;/OL&gt;&lt;/LI&gt;&lt;LI&gt;Create a WdfRequest and WdfMemory object with the data to pass to the IOCTL.&lt;/LI&gt;&lt;LI&gt;Format the request for the IOCTL&lt;/LI&gt;&lt;LI&gt;Send the IOCTL&lt;/LI&gt;&lt;/OL&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;However, step 2 above is failing with a &lt;I&gt;STATUS_INVALID_PARAMETER&lt;/I&gt;.  This step is done at &lt;A href="https://github.com/Microsoft/Windows-driver-samples/blob/master/gpio/samples/simdevice/simdevice.c#"&gt;https://github.com/Microsoft/Windows-driver-samples/blob/master/gpio/samples/simdevice/simdevice.c#&lt;/A&gt; L741 line 741 of the sample.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Any help in making the &lt;I&gt;IOCTL_GPIO_READ_PINS&lt;/I&gt; and &lt;I&gt;IOCTL_GPIO_WRITE_PINS&lt;/I&gt; calls to the controller driver would be greatly appreciated.&lt;/P&gt;</description>
      <pubDate>Thu, 29 Nov 2018 20:40:54 GMT</pubDate>
      <guid>https://community.intel.com/t5/Embedded-Intel-Atom-Processors/Trouble-using-Apollo-Lake-GPIO-in-Windows/m-p/254286#M2599</guid>
      <dc:creator>SCorb</dc:creator>
      <dc:date>2018-11-29T20:40:54Z</dc:date>
    </item>
    <item>
      <title>Re: Trouble using Apollo Lake GPIO in Windows</title>
      <link>https://community.intel.com/t5/Embedded-Intel-Atom-Processors/Trouble-using-Apollo-Lake-GPIO-in-Windows/m-p/254287#M2600</link>
      <description>&lt;P&gt;Hello, scorbin,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks for contacting us, we are investigating your case, and we will provide more information as soon as possible.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Best Regards,&lt;/P&gt;&lt;P&gt;Adolfo Sanchez.&lt;/P&gt;</description>
      <pubDate>Sat, 01 Dec 2018 00:37:51 GMT</pubDate>
      <guid>https://community.intel.com/t5/Embedded-Intel-Atom-Processors/Trouble-using-Apollo-Lake-GPIO-in-Windows/m-p/254287#M2600</guid>
      <dc:creator>Adolfo_S_Intel</dc:creator>
      <dc:date>2018-12-01T00:37:51Z</dc:date>
    </item>
    <item>
      <title>Re: Trouble using Apollo Lake GPIO in Windows</title>
      <link>https://community.intel.com/t5/Embedded-Intel-Atom-Processors/Trouble-using-Apollo-Lake-GPIO-in-Windows/m-p/254288#M2601</link>
      <description>&lt;P&gt;AdolfoS,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I've been doing some follow-up testing to make sure I've addressed the issue.  It looks like the way I was requesting the ResourceString using the RESOURCE_HUB_CREATE_PATH_FROM_ID was incorrect.  It expects me to provide a UNICODE_STRING for the framework to populate.  I was doing this improperly.  I found 2 WDK samples that illustrate how to do this.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;1) This i2c example that shows how to get the ResourceString from the resource hub.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;A href="https://github.com/Microsoft/Windows-driver-samples/blob/master/usb/UcmTcpciCxClientSample/I2C.cpp#"&gt;https://github.com/Microsoft/Windows-driver-samples/blob/master/usb/UcmTcpciCxClientSample/I2C.cpp#&lt;/A&gt; L192 Windows-driver-samples/I2C.cpp at master · Microsoft/Windows-driver-samples · GitHub&lt;P&gt;It does it like so:&lt;/P&gt;&lt;P&gt;    // Create the device path using the connection ID.&lt;/P&gt;&lt;P&gt;    DECLARE_UNICODE_STRING_SIZE(ResourceString, RESOURCE_HUB_PATH_SIZE);&lt;/P&gt;&lt;P&gt;    RESOURCE_HUB_CREATE_PATH_FROM_ID(&lt;/P&gt;&lt;P&gt;        &amp;amp;ResourceString,&lt;/P&gt;&lt;P&gt;        DeviceContext-&amp;gt;I2CConnectionId.LowPart,&lt;/P&gt;&lt;P&gt;        DeviceContext-&amp;gt;I2CConnectionId.HighPart);&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;2) This &lt;A href="https://github.com/Microsoft/Windows-driver-samples/blob/master/gpio/samples/simdevice/simdevice.c#"&gt;https://github.com/Microsoft/Windows-driver-samples/blob/master/gpio/samples/simdevice/simdevice.c#&lt;/A&gt; L741 GPIO example that shows how to get the ResourceString from the resource hub.&lt;/P&gt;&lt;P&gt;UNICODE_STRING ResourceString;&lt;/P&gt;&lt;P&gt;WCHAR ResourceStringBuffer[100];&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;RtlInitEmptyUnicodeString(&lt;/P&gt;&lt;P&gt;     &amp;amp;ResourceString,&lt;/P&gt;&lt;P&gt;     ResourceStringBuffer,&lt;/P&gt;&lt;P&gt;     sizeof(ResourceStringBuffer));&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;RESOURCE_HUB_CREATE_PATH_FROM_ID(&lt;/P&gt;&lt;P&gt;     &amp;amp;ResourceString,&lt;/P&gt;&lt;P&gt;     SampleDrvExtension-&amp;gt;ConnectionIds[0].LowPart,&lt;/P&gt;&lt;P&gt;     SampleDrvExtension-&amp;gt;ConnectionIds[0].HighPart);&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I initially started with method 2.  That wasn't working so I switched to method 1; because it seems more logical.  It turns out I had an issue with my connectionID index first so it didn't matter which method I used.  Once I corrected that method 1 wasn't working.  Once I reverted to method 2 I was able to get past this issue.&lt;/P&gt;</description>
      <pubDate>Sat, 01 Dec 2018 01:00:06 GMT</pubDate>
      <guid>https://community.intel.com/t5/Embedded-Intel-Atom-Processors/Trouble-using-Apollo-Lake-GPIO-in-Windows/m-p/254288#M2601</guid>
      <dc:creator>SCorb</dc:creator>
      <dc:date>2018-12-01T01:00:06Z</dc:date>
    </item>
    <item>
      <title>Re: Trouble using Apollo Lake GPIO in Windows</title>
      <link>https://community.intel.com/t5/Embedded-Intel-Atom-Processors/Trouble-using-Apollo-Lake-GPIO-in-Windows/m-p/254289#M2602</link>
      <description>&lt;P&gt;Hello, scorbin&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks for sharing your solution with the rest of the community, your contribution is greatly appreciated.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Best Regards,&lt;/P&gt;&lt;P&gt;Adolfo Sanchez&lt;/P&gt;</description>
      <pubDate>Sat, 01 Dec 2018 01:56:53 GMT</pubDate>
      <guid>https://community.intel.com/t5/Embedded-Intel-Atom-Processors/Trouble-using-Apollo-Lake-GPIO-in-Windows/m-p/254289#M2602</guid>
      <dc:creator>Adolfo_S_Intel</dc:creator>
      <dc:date>2018-12-01T01:56:53Z</dc:date>
    </item>
  </channel>
</rss>

