Host_port_open = (pInformation->USBwValues.bw. Test DTR state to determine if host port is open Return bDeviceState = CONFIGURED & host_port_open Ģ) Modified Virtual_Com_Port_NoData_Setup() handling of SET_CONTROL_LINE_STATE thus: else if (RequestNo = SET_CONTROL_LINE_STATE) Regarding ST's VCP example code specifically I have made the following changes to usb_prop.c:ġ) Added the following function: #include In this case there is no means of detecting closure but at least it will not prevent an unconventional application from working with my device, even if it then causes it to crash when it disconnects. However there is a back-up plan that implicitly assumes the port to be open if the line-coding (baud, framing) are set. It is possible for an application to change the behaviour of DTR, but this should not happen in any of the client applications that are likely to connect to this device in this case. This information is passed to a CDC class device, so I can use this to achieve my aim. Conventionally, when a port is opened the DTR modem control line is asserted. When in DFU mode, I can see it as Universal Serial Bus Device/STM32 BOOTLOADER on Device Manager. My PC identifies it as mass storage and portable devices on Windows 10 Pro. Part (1) - preventing the interrupt lock-up - was facilitated by a USB library bug fix from ST support it was not correctly clearing the T圎mpty interrupt.Īfter some research and assistance from ST Support, I have determined a solution to part (2) - detecting whether the host port is open. I found this question 1 where Device Manager reads the STM as Disk drives/STM32. Memcpy(pbuf, lineCoding, sizeof(lineCoding)) Memcpy(lineCoding, pbuf, sizeof(lineCoding)) USB Device viewer information: : STMicroelectronics Virtual COM PortĬompanion Hub Symbolic Link Name: USB#ROOT_HUB30#4&2f29167c&0&0# Īnd adjusted CDC_Control_FS function: static int8_t CDC_Control_FS(uint8_t cmd, uint8_t* pbuf, uint16_t length) In my C# program and in terminal programs I use same parameters Same message writes me program Realterm, PuTTY do nothing and "Tera Term" program works correct – I can send and receive data to my MCU program. Port.Open() // System.IO.IOException: 'The parameter is incorrect.' My C# program write me "The parameter is incorrect" when I try open it: SerialPort port = new SerialPort("COM8", 9600, Parity.None, 8, StopBits.One) "Virtual COM port" appearances in Windows 10 (I tried default Windows driver and ST driver) but I can not open port. I'm using CubeMX HAL (I tried several versions) and TrueStudio.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |