跳到正文
原文
Reddit · r/esp32· shahin_hashim·· 2026-10-21精选AI 评分58

ESP32 复位时如何避免丢失最后几行串口日志

How do you make sure you don't lose the last log lines when an ESP32 resets? Mine showed them on screen but lost them from the file

AI 导读

作者用自制串口监视器 WireTrace 复现了 ESP32 掉线时日志丢尾行的问题:发送约 20,000 行日志中途拔线,屏幕显示全部行而文件只存下 100 行,且仍提示已保存。

推荐理由

作者用一次可复现实验定位了串口日志丢尾行的原因,并给出端口直写文件的解决思路。

来源:Reddit · r/esp32 · reddit.com