• esp32 CoreDump使用


    esp32 CoreDump存储

    coredump介绍

    当esp32运行程序时出现异常,会进入异常中断,导致复位重启。若配置了coredump,则会将错误信息存储到flash中,或者打印到串口上。

    CSV文件配置分区信息表

    在这里插入图片描述

    执行menuconfig进入配置界面

    ![在这里插入图片描述](https://img-blog.csdnimg.cn/6a3cdbebcde9424a90ad978a4e2722a0.jpeg#pic_center
    在这里插入图片描述

    在这里插入图片描述
    在这里插入图片描述

    coredump打印到串口

    在这里插入图片描述
    在这里插入图片描述

    执行软件复位

    在这里插入图片描述

    串口打印如下:

    在这里插入图片描述
    ###将CORE DUMP START和CORE DUMP END之间的数据复制到文本中,命名为coredump.bin
    用于解析

    
    ================= CORE DUMP START =================
    ****将之间的数据复制到文本中,命名为coredump.bin***
    ================= CORE DUMP END =================
    
    • 1
    • 2
    • 3
    • 4

    coredump解析串口

    espcoredump.py info_corefile -t b64 -c </path/to/saved/base64/text> </path/to/program/elf/file> 或者 espcoredump.py dbg_corefile -t b64 -c </path/to/saved/base64/text> </path/to/program/elf/file>
    例:python E:/Esp32-SDK/SDK432/Gitee/esp-idf/components/espcoredump/espcoredump.py dbg_corefile -t b64 -c  E:/coredump.txt E:/Esp32-SDK/SDK432/Gitee/esp-idf/examples/protocols/http_server/file_servinguart/build/file_server.elf
    
    • 1
    • 2

    解析串口结果如下:
    在这里插入图片描述

    coredump存储到flash

    选择flash,并执行编译

    在这里插入图片描述

    在这里插入图片描述

    coredump读取flash并生成core.bin文件

    指令如下,在执行指令的时候,一定要先进入boot下载模式。

    python + esptool.py + 串口号 + read_flash + coredume存储的falsh地址 + 大小 + core.bin(最终要生成的文件,用于解析)
    例:python E:/SDK432/Gitee/esp-idf/components/esptool_py/esptool/esptool.py --p COM3  read_flash 0x110000 0xFA00 /tmp/core.bin
    
    • 1
    • 2

    下载之后如下图所示,会生成一个core.bin文件
    在这里插入图片描述
    在这里插入图片描述

    coredump解析core.bin文件

    python + espcoredump.py + info_corefile + --core + core.bin + --core-format raw + elf文件
    例:python E:/SDK432/Gitee/esp-idf/components/espcoredump/espcoredump.py info_corefile --core /tmp/core.bin --core-format raw  E:/SDK432/Gitee/esp-idf/examples/protocols/http_server/file_serving111/build/file_server.elf
    
    • 1
    • 2

    如下图所示,若解析错误,说明环境有问题,可以更新xtensa-esp32-elf文件

    在这里插入图片描述

    正确解析结果如下,包含一些堆栈寄存器信息,以及具体出现异常的位置:
    在这里插入图片描述

  • 相关阅读:
    单片机——将P1口状态送入P0、P2和P3口
    前端——一些js的代码
    2023-09-20 Android CheckBox 让文字显示在选择框的左边
    NPDP|作为产品经理,如何快速提升自身业务素养?
    Java虚拟机
    内网穿透的应用-使用eXtplorer本地搭建免费在线文件管理器并实现远程登录
    Torch基础(二)
    TDengine 入门教程⑦——数据库管理工具 | IDEA 连接 TDengine
    Web前端-元素显示和js引入
    性能问题从发现到优化一般思路
  • 原文地址:https://blog.csdn.net/weixin_42857472/article/details/125497284