Home > Software engineering >  Serial debugging assistant problem (CSerialPort and Windows API to write a serial port application c
Serial debugging assistant problem (CSerialPort and Windows API to write a serial port application c

Time:11-02

The younger brother using CSerialPort class wrote a serial test program, as shown in the figure below


I use virtual serial port, set up two virtual serial port COM3, and COM4, then use the ready-made online serial assistants to test, test the effect is very good, but...


+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

However, my goal is to eventually and lower machine STM32 testing, failed!!!!!!
I write a serial port assistant, received no problem, but click send, the program will kneel (if using virtual serial port communication, didn't have this kind of phenomenon)
[=hardware no problem, because I used online mature serial assistant test no problem=]

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

Finally, I downloaded some people use the Internet Windows API to write serial program, the result is the same, (CSerialPort class also calls the Windows API, receive special good, send on his knees, and in view of the machine), with a virtual serial port test no problem, but with single-chip microcomputer testing, will encounter all sorts of problems , don't know what to write a serial port application should pay attention to the problem, request a great god give some guidance, thanks,



CodePudding user response:

It is recommended to use portmon auxiliary software debugging serial communication program,

CodePudding user response:

reference 1st floor zhao4zhong1 response:
recommended portmon auxiliary software debugging serial communication program,

Thanks a lot, but I am going to write a serial port application...

CodePudding user response:

When sending data, the return value of the error information such as what, you want a specific correspondence analysis

CodePudding user response:

reference oyljerry reply: 3/f
send data, the return value of the error information such as what, you want to specific correspondence analysis the

Debugging directly collapses, can undertake, but the use of virtual serial port test without any problem, it's really a beep the dog

CodePudding user response:

reference 4 floor humanking7 response:
Quote: reference oyljerry reply: 3/f

When sending data, the return value of the error information such as what, you want to specific correspondence analysis the

Debugging directly collapses, can undertake, but the use of virtual serial port test without any problem, it's really a beep the dog

Check whether there is test program fragment has not gone to?

CodePudding user response:

I think most is your source of problems cause memory error, no source code, it will be very hard to help you ~

CodePudding user response:

It is recommended to use CxSerial class
http://www.cnblogs.com/EdmundDwyane/p/3161524.html
  • Related