07-07-2017 03:13 AM
首先,当用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.
Solved! Go to Solution.
07-07-2017 05:17 AM
maybe something about the DTR RTS signal.
when use OpenCom(), what is the default state of DTR and RTS ?
07-07-2017 07:39 AM
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.
07-07-2017 08:08 AM
circuit
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 ?
07-07-2017 09:20 AM
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?
07-07-2017 09:32 AM
ALL, tried!
07-07-2017 09:36 AM
when i used closecom(), then ,i checked it, it done.
why?
07-07-2017 10:43 AM
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.