Main Site Documentation

UartController.FromName( )


#1

Using a UCM Dev Board Rev E with a UC5550
I want to use
UCM Dev Board USB connector (x6)
USB<->Serial UART A (USB VCOM1)
Device Manager shows this as Ports(COM&LPT) - USB Serial Port(COM4)

var SerialDevice = UartController.FromName(“name”);

I have not been able to find information on what “some name” is expected.
I have tried everything I can think of but all return null.

Thank you!


#2

I think from GHIElectronics.TinyClr.Pins Nuget packge, you would have your uart id (string) for your board.


#3

The string is something like that:
“GHIElectronics.TinyCLR.NativeApis.STM32F7.UartProvider\0“

Where the last number is usart number - 1


#4

Probably better to use something like that : STM32F4.UartPort.Usart1 , just in case the underlying string is changing at some time ?


#5

Yes right. But sometime can be useful to know how it works…


#6

Thanks to all!

var SerialDevice = UartController.FromName(UC5550.UartPort.Usart1);

Did not return null so I can now get in more trouble…


#7

Indeed ! And that’s how I was doing in my first programs with TinyCLR :wink:
But this string was too long to remember for me :flushed:


#8

Not that we have discovered a memory leak in uart. Sadly I really needed it for a project I am working on. Crossing fingers for a soon fix.