none
accessing pure UART on Windows 10 IoT RRS feed

  • Question

  • Hi folks,

    I am currently evaluating if we can use Windows 10 IoT for a business project (industrial automation) we are developing right now ... designing and prototpying it right now and use the final Windows 10 IoT for small devices bits when they are "ready to use".

    To give you a real picture about my research : we would like to use a ZigBee Module that has an UART Interface directly in our "universal app" which will run on a Windows 10 IoT for small device.

    My question : which API can be used to access the "pure UART" on the Windows 10 IoT Editions - in my case it will be for time of prototyping a Windows 10 IoT for small device Edition on a Rasperbby Pi 2 in particular?

    Will it be the same API as the one for "built in COM Port" and "USB to Serial Adapters" which I found out is the SerialDevice class (in Namespace : Windows.Devices.SerialCommunication), the documenation can be found here : https://msdn.microsoft.com/en-us/library/windows.devices.serialcommunication.serialdevice.aspx?cs-save-lang=1&cs-lang=csharp#code-snippet-1) ... but is says nothing about a pure UART.

    (by the way : it's really great to have all the low Level buses right at our "virtual coding hands" even in the universal app plattform - and not only in the device driver layer ... this opens up quite a lot of scenarios !)

    Even the session at WinHEC "Accessing GPIO, I2C, and UART Devices" (http://channel9.msdn.com/Events/WinHEC/2015/DDF300) made a curve around UART regarding detail Information - mabye because at session time "things were still in motion" ;-).

    Another Piece of Information I found in the Namespace Documentation (https://msdn.microsoft.com/en-us/library/windows.devices.serialcommunication.aspx) : "In this release, the namespace supports devices that belong to the USB CDC device class. This includes ports exposed by Serial-to-USB adapters and internal USB to serial bridge chips like those used in Arduino Uno R3s."

    That's fine ... but the question is, which API will be used when "pure UART" will be supported in the "universal app plattform" (layer).

    I belive the design / architectual decision has been made already although the implementations still has to happen ... no problem.

    But knowing which API will be used, will help me to implement a prototype already in advance and we need to try it out as soon as possible in order to make the decision to get our product run on Windows 10 IoT for small devices (which is my favorit !) or on Linux.

    Concrete : if the pure UART will be accessible through SerialDevice class as well, I can hook up a dummy on a "USB to TTL Adapter" (like one from the Arduino or Adafruit or you name it) to small Micro-Controller Board and simulate all the real stuff that's coming up. Even .NET Micro-Framework could be used for the simulator, e.g. using the USB Serial Gadgeteer Module.

    thanks & cheers

    gebka

    Thursday, April 9, 2015 11:04 AM

Answers

All replies

  • Hi gebka,

    Can you provide a definition for "Pure" Universal Asynchronous Receiver/Transmitter as it would
    relate to your question.

    This would help me as I work with the appropriate team/s within Microsoft to address this question.

    Thanks!

    Raiford

    Thursday, April 9, 2015 5:04 PM
  • Are you still working on this project?  Did you get the bit timing resolved?

    Wednesday, July 13, 2016 10:59 PM
  • Hi Gebka,

    I asked a member of the IoT Team to review this thread and they have the following thoughts for you:

    •          Which API should be used to access hardware UARTs?
    •          The documentation for SerialDevice says it only works for USB-CDC devices. Does it also work for hardware UARTs?
      •    Yes
    •          What device capabilities should I put in my manifest?

      <Capabilities>
        <DeviceCapability Name="serialcommunication">
          <Device Id="any">
            <Function Type="name:serialPort" />
          </Device>
        </DeviceCapability>
      </Capabilities>

    •          How do I read with high performance?
      •    Performance could mean throughput or latency.
      •    SerialDevice.InputStream.ReadAsync() calls ReadFile() in overlapped mode, so has the same throughput as the Win32 API. We’ve tested throughput and there’s no issues.
    •           Can I talk Modbus over a serial port?

    I hope this helps and please let us know how your project is going.

    Sincerely,

    IoTGirl




    Wednesday, July 20, 2016 11:32 PM
    Moderator
  • Hi IoT Girl,

    the GitHub link for the SerialSample is empty. Any chance to get a working sample?

    I wonder if it could work at all because the object list of the "IoT extensions for the UWP" knows all the other low level devices as GPIO, I2C, SPI ... but not a UART. Accordingly the SerialDevice class in the Namespace Windows.Devices.SerialCommunication isn't able to list it. Something is missing obviously. devcon.exe in powershell is able to find a "ACPI\BCM2837\4 : ARM PL011 UART Device Driver", also to be seen in the Dashboard / Device Portal of the Raspberry.

    So what to do? I'm exploring IoT on a Raspberry Pi 2 and a missing serial port connectivity is a real drawback.

    Thanks, tajota


    • Edited by tajota Wednesday, November 23, 2016 12:25 PM
    Wednesday, November 23, 2016 10:09 AM
  • Hi Tajota,

    I have fixed the link in my original reply.  For all IoT Samples you can go to WindowsOnDevices.com and choose "Samples" on the menu.

    Sincerely,

    IoTGirl

    Wednesday, November 23, 2016 5:56 PM
    Moderator
  • Hi IoTGirl,

    thanks for the fixing the link. Unfortunately it leads to the redirection "Download the Visual Studio 2015 SerialSample source project" and again ends up at an empty GitHub page.

    After having rifled through lots of relevant web pages and samples I'm still conceive suspicion that something's incomplete on the way from the "ARM PL011 UART Device Driver" across the reference "IoT extensions for the UWP" and the missing UART object to the "SerialDevice class" so that the bottleneck method "SerialDevice.FromIdAsync(deviceId)" isn't able to deliver a valid connection to a serial port.

    I use the OS Version 10.0.14393.448

    Regards, tajota

    Wednesday, November 23, 2016 7:05 PM
  • Hi Tajota,

    The link takes me to https://github.com/ms-iot/samples/tree/develop/SerialUART and there are two projects a C & C++.  Not sure what is broken for you.

    There are some board level limitations to each UART, for example the Pi3 offers a mini UART, but those are specific to the boards themselves. 

    Sincerely,

    IoTGirl

    PS: there is another project for accessing the serial port from Nodejs that might interest you: https://github.com/ms-iot/node-serialport


    Wednesday, November 23, 2016 8:01 PM
    Moderator
  • Hi IoTGirl,

    the sample works perfectly. Thanks a lot.

    Saturday, November 26, 2016 1:39 PM
  • Hi Tajota,

    You are very welcome! Thank you for following up.

    Sincerely,

    IoTGirl

    Sunday, November 27, 2016 1:29 AM
    Moderator