Files
ESP32_COMM/serial_monitor.py
T
小龙虾 661ae54424 feat(ota): 优化 GD32 OTA 流程和 CAN 反馈机制
- 实现 GD32 主动推送 CAN 反馈架构,替代 ESP32 1Hz 轮询方式,
  减少 SPI 总线占用提升带宽效率

- 添加 GD32 Bootloader 就绪检测机制,通过 PB6 硬件信号等待
  保证 OTA 过程稳定可靠

- 集成 CREDIT 感知功能,当 GD32 写 Flash 缓冲时自动等待,
  避免数据包丢失提高传输成功率

- 重构 canFdPollFeedback 为 canFdParseFeedbackPage 函数,
  支持被动解析 GD32 主动推送的数据页

- 更新版本号从 0.37 到 0.3.38 并添加 Kconfig 配置选项支持
2026-07-08 02:51:38 +08:00

22 lines
668 B
Python

import serial, time, sys
port = 'COM15'
baud = 115200
outfile = r'G:\Robot_v2\DCU\ESP32_COMM\build\monitor_log.txt'
print('Monitoring %s at %d baud...' % (port, baud), flush=True)
try:
s = serial.Serial(port, baud, timeout=1)
with open(outfile, 'w') as f:
while True:
data = s.readline()
if data:
line = data.decode('utf-8', errors='replace').rstrip()
ts = time.strftime('%H:%M:%S')
msg = '[%s] %s' % (ts, line)
print(msg, flush=True)
f.write(msg + '\n')
f.flush()
except Exception as e:
print('Error: %s' % e, flush=True)