赞
踩
主要用于芯片流片以后对uart ip的压力测试,也可以用于测试通信稳定性
创建两个线程,一发一收
python运行命令:-c后面输入串口号,-b后面输入波特率,-count后面输入测试次数
python xxx.py -c com5 -b 115200 -count 10000
'''
测试uart与python 串口收发数据压力测试
MCU端仅仅做一个转发操作
'''
#_*_ coding: utf-8
import serial
import time
import argparse
import threading
import sys
import os
exit_thread = False
SEND_DATA_COUNT = 1000
BAUDRATE = 115200
COM_PORT = "COM5"
global serial_info
global read_thread
global write_thread
w_data = []
r_data = []
send_sum = 0
rcv_sum = 0
def init_uart_port(uart_port, baudrate):
global serial_info
serial_info = serial.Serial(uart_port, baudrate)
def
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。