LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

question about the "OpenCom()"

Solved!
Go to solution

首先,当用USB转串口线连接好STM32开发板和PC后,此时STM32是正常工作的,当打开我用CVI编写的串口测试软件后,我点击“搜索串口”控件(里面就只有一个OpenCom(5,"")函数),此时发现STM32开发板出现非正常状态,就像一直在复位一样。但是并没有复位,因为RESET引脚是高电平状态。

我怀疑,是不是OpenCom()函数背后究竟做了些什么?

 

i have a problem.

i connect a stm32 board via a usb-rs232 line to my pc.

then i open the rs232 terminal, when i click the "rs232 port search" control(in it is a simple function,Opencom(5,"");),the stm32 board become a reset-like status. 

if i closed the rs232 terminal, then the stm32 board become normal.

0 Kudos
Message 1 of 8
(3,908 Views)

maybe something about the DTR RTS signal.

when use OpenCom(), what is the default state of DTR and RTS ?

0 Kudos
Message 2 of 8
(3,880 Views)

OpenCom uses the default system configuration for the port you are opening: if in port configuration the hardware handshacking is enabled, this setting will be honoured by OpenCom. If you do not want to change system settings, you can change this by calling SetXMode or SetCtsMode. The help page on Handshaking describes in detail the behaviour of these functions.

Alternatively you may want to use OpenComConfig which disables the handshaking even if active in system settings.

 



Proud to use LW/CVI from 3.1 on.

My contributions to the Developer Community
________________________________________
If I have helped you, why not giving me a kudos?
Message 3 of 8
(3,868 Views)

circuit

111.png

 

circuit above,  during the time of operating rs232,i want RTS#=1,DTR#=0.

but ,when i used OpenCom(5,""), i found my STM32 board entering embed bootloader (BOOT1=1,boot0=1).

so ,what should i to do ?

0 Kudos
Message 4 of 8
(3,864 Views)

1. Have you checked serial port settings in Device Manager? Have you tried disabling handshaking if it's enabled?

2. Have you tried disabling the handshake with SetCtsMode?

3. Have you tried with openComConfig?



Proud to use LW/CVI from 3.1 on.

My contributions to the Developer Community
________________________________________
If I have helped you, why not giving me a kudos?
0 Kudos
Message 5 of 8
(3,850 Views)

ALL, tried!

0 Kudos
Message 6 of 8
(3,844 Views)

when i used closecom(), then ,i checked it, it done.

why?

0 Kudos
Message 7 of 8
(3,837 Views)
Solution
Accepted by topic author winter1970

Well I really don't know. I never used STM32 nor ch340 chip so I cannot say anything on the matter. I suppose you can find some documentation on ST of CH340 Producer sites.



Proud to use LW/CVI from 3.1 on.

My contributions to the Developer Community
________________________________________
If I have helped you, why not giving me a kudos?
0 Kudos
Message 8 of 8
(3,829 Views)