| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
espp::CoreDump wraps the ESP-IDF flash core dump (espcoredump) in an idiomatic espp API: has_core_dump(), summary() (esp_core_dump_summary_t), format_report() (reset reason, panic reason, crashed task + PC, raw backtrace addresses / RISC-V stack dump, addr2line decode hint with the right toolchain prefix for CONFIG_IDF_TARGET, and brownout/watchdog hints for resets that write no dump), plus raw image access (image_size(), read_image(), erase()) for downloading the full ELF core dump over any transport. All failures via std::error_code; degrades gracefully when core-dump-to-flash is disabled. espp::CoreDumpService serves that over any byte stream by reusing the ota component's CRC-32 stream framing, with message types in a dedicated range (0x40..0x43 requests / 0xC0..0xC4 replies: GET_SUMMARY/GET_SIZE/READ/ERASE -> SUMMARY/SIZE/DATA/OK/ERROR). Construct with a send function; feed(bytes) runs a resynchronizing parser (so the stream can also carry console text) and handle_frame() supports an external parser. Unknown frame types are ignored so the service coexists with other protocols on one stream. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
…onsole) Composite espp::UsbDevice: a vendor/WebUSB interface carrying the framed core-dump protocol and a CDC port carrying the system console (tinyusb_console_init) plus the same protocol on one stream. A CoreDumpService instance is mounted on BOTH streams (shared CoreDump), with RX queued out of the TinyUSB task into a worker. Prints the previous-boot crash report at startup (re-logged on each CDC connect) and offers deliberate test crashes from the CDC console (crash / assert / divzero / hang / report / help) or the BOOT button: null-pointer write, failed assert, divide-by-zero (core dump + backtrace) and an interrupts-off hang (INT_WDT reset, reset-reason-only report). sdkconfig: CONFIG_ESP_COREDUMP_ENABLE_TO_FLASH=y + TinyUSB vendor/CDC on a 4MB flash; partitions.csv adds a 64K coredump data partition; main REQUIRES espcoredump explicitly for its header/Kconfig symbols on IDF 6. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Single-file, offline, dependency-free browser tool for the coredump stream service. Connects over WebUSB (vendor interface) or Web Serial (CDC): over serial the parser separates console text from protocol frames on the shared stream, so the app doubles as a serial monitor with a console input row (type 'crash' to exercise the flow). Features: crash summary display, chunked core-dump download saved as core.elf (ELF located inside the flash image; raw image download too), erase, copy-paste espcoredump.py / addr2line command lines (addresses filled in from the report), and client-side nearest-symbol backtrace resolution by parsing the user-picked app ELF's symtab/strtab (no DWARF; labelled as approximate). Dark/light aware; served automatically at esp-cpp.github.io/espp/apps/coredump_console.html by the docs workflow. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
- doc/en/coredump/{index,coredump,coredump_example}: component docs
following the ota pattern, wired into the Core & RTOS toctree
- web_apps.rst: Core Dump Console highlight
- Doxyfile: coredump headers + example inputs
- build.yml: build the coredump example for esp32s3
- upload_components.yml: publish components/coredump
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
There was a problem hiding this comment.
Warning
Copilot couldn't run its full agentic review because it didn't start before the timeout. Make sure your repository has a runner available, or add a copilot-code-review.yml file specifying one with the runs-on attribute. See the docs for more details.
Introduces a new coredump component (device-side crash dump access + framed stream service) along with a self-contained WebUSB/Web Serial browser console, plus documentation and CI wiring to build/publish the new component.
Changes:
Copilot reviewed 20 out of 20 changed files in this pull request and generated 13 comments.
Show a summary per file| File | Description |
|---|---|
| doc/en/web_apps.rst | Lists the new Core Dump Console web app in documentation highlights. |
| doc/en/index.rst | Adds coredump docs section to the main docs toctree. |
| doc/en/coredump/index.rst | New coredump docs index page and toctree. |
| doc/en/coredump/coredump_example.md | Includes the example README into the docs build. |
| doc/en/coredump/coredump.rst | New component documentation and API includes for CoreDump/CoreDumpService. |
| doc/Doxyfile | Adds coredump headers and example file to Doxygen input/example paths. |
| components/coredump/web/coredump_console.html | New single-file WebUSB/Web Serial crash inspector + serial monitor. |
| components/coredump/include/coredump_service.hpp | New transport-agnostic framed protocol service for core dump operations. |
| components/coredump/include/coredump.hpp | New CoreDump wrapper around ESP-IDF flash coredump APIs + report formatting. |
| components/coredump/idf_component.yml | New IDF component manifest for publishing/consumption. |
| components/coredump/example/sdkconfig.defaults | Example config enabling native USB + flash coredumps on ESP32-S3. |
| components/coredump/example/partitions.csv | Example custom partitions with a dedicated coredump partition. |
| components/coredump/example/main/coredump_example.cpp | New ESP32-S3 native USB example mounting protocol on vendor + CDC streams. |
| components/coredump/example/main/CMakeLists.txt | Example main component deps (explicit espcoredump, USB, GPIO, etc.). |
| components/coredump/example/README.md | Example usage instructions and typical crash→download→decode flow. |
| components/coredump/example/CMakeLists.txt | Example project wiring with narrowed EXTRA_COMPONENT_DIRS. |
| components/coredump/README.md | Component README describing APIs, protocol, and web console usage. |
| components/coredump/CMakeLists.txt | Component registration as header-only with required public deps. |
| .github/workflows/upload_components.yml | Adds components/coredump to component upload workflow. |
| .github/workflows/build.yml | Adds components/coredump/example to the CI build matrix. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
Sorry, something went wrong.
- coredump.hpp: explicitly include format.hpp (fmt::format is used in the header) and add the format component to REQUIRES - coredump.hpp: validate the core-dump image address range lies within the coredump partition before computing the partition-relative offset, so an inconsistent address cannot underflow or read the wrong flash region - coredump_service.hpp: normalize non-generic-category error codes to a std::errc value (default_error_condition, io_error fallback) so the on-wire ERROR code always matches the wire spec - web console: default WebUSB filter now matches VID and PID (the 'show all USB devices' checkbox still lifts the filter), removing the unused DEFAULT_PID - web console: extractAddresses() now includes the faulting PC first (deduplicated) alongside the backtrace addresses, matching its comment Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
|
✅Static analysis result - no issues found! ✅ |
Sorry, something went wrong.
…config-constant findings The static-analysis CI flagged: the example's INTENTIONAL crash triggers (null-pointer store, divide-by-zero - crashing is their purpose), two knownConditionTrueFalse findings that are constants only in the coredump-disabled configuration cppcheck analyzes, and the CONFIG_IDF_TARGET string-paste it cannot resolve. All suppressed inline with justifications; cppcheck now reports 0 findings on the component and the example still builds clean. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
…utside lock, README API names) - CoreDump::format_report(): report ALL abnormal reset reasons even when no core dump image is present (PANIC with a missing dump, UNKNOWN, power glitch, CPU lockup, ... in addition to the existing brownout/watchdog hints); empty string is now reserved for genuinely clean reasons (power-on / EXT / SW / deep-sleep / SDIO / USB / JTAG) via a new is_clean_reset_reason() helper, and the docs state precisely which. - CoreDumpService: never invoke the user send callback under the internal mutex. handle_frame_locked() now performs the flash access and BUILDS the reply frame under the lock (send_error -> build_error); feed()/ handle_frame() transmit the collected replies after unlocking, so a re-entrant transport (send path that triggers RX -> feed()) cannot deadlock. Documented the threading / send-callback contract. - READMEs: the example routes the console with tinyusb_console_init(TINYUSB_CDC_ACM_0), not esp_tusb_init_console. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
There was a problem hiding this comment.
Copilot reviewed 20 out of 20 changed files in this pull request and generated 3 comments.
Suppressed comments (1)Previously missed (1) — in code that hasn't changed since the last review.
components/coredump/web/coredump_console.html:267
<span class="muted">core.elf strips the flash header/checksum; the raw image is the whole stored blob.</span>
Sorry, something went wrong.
…B FIFO sizing, IDF >=5.2, webapp label) - CoreDump: serialize all flash-touching methods (has_core_dump / summary / format_report / image_size / read_image / erase) with an internal mutex so one CoreDump can be shared by several CoreDumpService instances / transports without a READ on one racing an ERASE on the other; documented on the class and in CoreDumpService's shared-CoreDump note. - example sdkconfig.defaults: size the TinyUSB vendor RX/TX and CDC TX FIFOs (4096) to hold a complete DATA reply frame (2,063 bytes with the web console's 2 KiB read chunks) so the stock write path cannot truncate replies; PR #742 additionally makes write_vendor wait-for-drain. - idf_component.yml: require idf >=5.2 (first release with esp_core_dump_get_panic_reason(), used for the ELF crash report). - example: replace the now-stale knownConditionTrueFalse inline suppression (which CI reports as unmatched since b7871e9) with a CONFIG_ESP_COREDUMP_ENABLE_TO_FLASH guard, robust across cppcheck versions. - CoreDumpService: make build_error() const (cppcheck functionConst). - webapp: correct the download-panel label — core.elf drops the flash header before the ELF magic; the trailing checksum bytes are retained. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
|
Addressing Copilot's suppressed comment on components/coredump/web/coredump_console.html:267 (the download-panel label said "core.elf strips the flash header/checksum", but extractElf() only slices off the bytes before the ELF magic and deliberately keeps the trailing padding/checksum, which ELF readers ignore since they follow the internal offsets): fixed in 2e02a9c by correcting the label to "core.elf drops the flash header before the ELF magic (trailing checksum bytes remain; ELF tools ignore them); the raw image is the whole stored blob." — the extraction behavior itself is intentional and unchanged. |
Sorry, something went wrong.
…ough marker, handle_frame doc) - webapp: navigator.usb.requestDevice() has no acceptAllDevices option (that's Web Bluetooth); use the required filters member with an empty list to show all devices - example: end the Assert case with an explicit __builtin_unreachable() so there is no implicit fallthrough into DivideByZero - coredump_service: handle_frame() @return doc now states the reply is only delivered when a send callback is configured (dropped otherwise) Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
There was a problem hiding this comment.
Copilot reviewed 20 out of 20 changed files in this pull request and generated 1 comment.
Suppressed comments (3)Previously missed (3) — in code that hasn't changed since the last review.
components/coredump/include/coredump.hpp:142
report = fmt::format("last reset: {} ({})", reason_name, static_cast<int>(reset_reason));
components/coredump/web/coredump_console.html:602
async send(bytes) {
const result = await device.transferOut(epOut, bytes);
if (result.status === "stall") {
try { await device.clearHalt("out", epOut); } catch (_) {}
throw new Error("OUT endpoint stalled");
components/coredump/include/coredump.hpp:231
if (!has_core_dump_locked() || esp_core_dump_image_get(&addr, &size) != ESP_OK) {
Sorry, something went wrong.
| void feed(std::span<const uint8_t> data) { | ||
| std::vector<std::vector<uint8_t>> replies; | ||
| { | ||
| std::lock_guard<std::mutex> lock(mutex_); | ||
| for (const auto &frame : parser_.feed(data)) { | ||
| std::vector<uint8_t> reply; | ||
| if (handle_frame_locked(static_cast<uint8_t>(frame.type), frame.payload, reply) && | ||
| !reply.empty()) | ||
| replies.push_back(std::move(reply)); | ||
| } | ||
| } | ||
| // send outside the lock so a re-entrant transport cannot deadlock | ||
| for (const auto &reply : replies) | ||
| send(reply); | ||
| } |
| Back | FazBrowse Home | New Git URL |
Summary
New coredump component: post-mortem crash inspection over USB (WebUSB vendor or CDC/Web Serial) with a self-contained browser inspector. Generalizes the crash reporting added to the bldc_haptics example (#742).
Needs hardware verification
Full crash → dump → next-boot report → download/erase flow on a real S3 (especially CDC console/frame interleaving under load); espcoredump.py acceptance of the extracted core.elf (raw-image fallback exists); the BOOT-button and INT_WDT (hang) paths; RISC-V report path compiles but was only built for Xtensa.
Testing
🤖 Generated with Claude Code