Logo: Esp Bist Skill

Esp Bist Skill

Communautéit
JasonYANG170
esp-bist-skill

AI Skill for Espressif ESP-BIST (Built-In Self Test) safety library development. Used when users need to create, integrate, or debug IEC 60730 Class B self-test firmware on Espressif RISC-V SoCs, including CPU/CSR/PC integrity tests, RAM March A/X, Flash CRC, clock monitoring, stack overflow detection, and watchdog/windowed-WDT integration. Trigger words: "ESP-BIST", "BIST", "IEC 60730", "Class B", "自检", "内置自测", "安全关键", "safety-critical", "March A", "March X", "windowed watchdog", "CRC32", "ESP32-C3", "ESP32-C6", "ESP32-H2", "ESP32-C5"

Iwwersiicht

EditeurJasonYANG170
Repositoryesp-dev-skill
Skill-Nummesp-bist-skill
Stären
32
Forks
3
Matgeliwwert Dateien
18
LizenzLGPL-3.0-or-later
Linken
  • Instruktiounen am Markdown-Format

    Eng SKILL.md-Datei, déi de Modell bei Bedarf luet, soudatt nëmmen Token ufalen, wann eng Ufro tatsächlech dozou passt.

  • Funktionéiert mat all LLM

    KI-Skills si reng Markdown, keen ubidderspezifesche Code. Dofir funktionéiert dëse Skill mat GPT, Claude, Gemini, Grok oder engem lokale Modell.

  • 18 matgeliwwert Dateien

    Skripten, Virlagen a Referenzen, déi de Modell beim Schaffe liese kann. D'Dateie kënnen nëmme gelies ginn a ginn ni ausgeféiert.

  • Open Source

    JasonYANG170 huet de Skill op GitHub verëffentlecht. Liest de Quelltext, ier Dir de Skill installéiert.

Installatioun

Installéiert de KI-Skill Esp Bist Skill an TypingMind, fir e mat all LLM ze benotzen, oder setzt en an en anere KI-Agent an, deen SKILL.md liest.

1

An TypingMind installéieren

TypingMind installéiert e Skill direkt aus sengem GitHub-Dossier — dobäi gëtt SKILL.md gelies, d'Ressourcedateie gi gebëndelt an d'Resultat gëtt lokal gespäichert.

  1. Maacht d'App op a gitt op Plugins → Skills.
  2. Wielt „Vu GitHub installéieren“.
  3. Pecht d'URL vum Skill-Dossier, déi hei drënner steet, an a bestätegt d'Installatioun.
    https://github.com/JasonYANG170/esp-dev-skill/tree/main/repos/esp-bist
  4. Aktivéiert de Skill an all Chat, an deem Dir e benotze wëllt.
Plugins → Skills → Skill derbäisetzen → Iwwer eng GitHub-URL. Pecht dann d'URL vum Dossier an a klickt op Weider.
2

An engem anere KI-Agent installéieren

All KI-Agent, deen d'Format Agent Skills liest, kann dëse Skill benotzen — kopéiert den Dossier an d'Skill-Verzeechnes vun deem KI-Agent.

Claude Code — .claude/skills
git clone --depth 1 https://github.com/JasonYANG170/esp-dev-skill.git /tmp/esp-dev-skill
mkdir -p .claude/skills
cp -r /tmp/esp-dev-skill/repos/esp-bist .claude/skills/esp-bist-skill
Start Claude Code nom Kopéieren nei, fir datt den neie Skill erkannt gëtt.

An TypingMind benotzen

Aktivéiert Esp Bist Skill an engem Chat vun TypingMind, an de Modell iwwerhëlt de Rescht. Den Numm an d'Beschreiwung stinn am System-Prompt. Soubal eng Ufro dozou passt, luet de Modell déi komplett Instruktioune selwer — Dir musst de Skill ni manuell opruffen, an et fale keng Token un, bis en tatsächlech benotzt gëtt.

De Modell luet Esp Bist Skill automatesch, soubal eng Ufro dozou passt.

Funktionéiert mat all KI-Modell

KI-Skills si reng Markdown-Instruktiounen amplaz vun ubidderspezifeschem Code. Dofir ass Esp Bist Skill net un de Modell gebonnen, fir deen de Skill geschriwwe gouf. Installéiert en eemol an TypingMind a benotzt e mat GPT-5, Claude, Gemini, Grok, DeepSeek, Mistral, Llama oder engem lokale Modell, deen Dir selwer bedreift — alles mat Ären eegenen API-Schlësselen.

  • Gëtt nëmme gelueden, wann et néideg ass

    De System-Prompt enthält nëmmen den Numm an d'Beschreiwung. D'Instruktioune gi bei der éischter passender Ufro gelueden, soudatt en onbenotzte Skill näischt kascht.

  • De Modell am lafende Chat wiesselen

    Well de Skill aus Instruktiounen amplaz vu Code besteet, funktionéiert en och no engem Modellwiessel — den nächste Modell liest déi selwecht SKILL.md-Datei.

Skill-Instruktiounen

Dëst ass den Inhalt vu SKILL.md, deen de Modell luet. Liest e virun der Installatioun — e Skill besteet aus Instruktiounen, déi Äre Modell befollegt.

esp-bist-skill

AI Skill for the Espressif ESP-BIST (Built-In Self Test) library. ESP-BIST is a CMake library providing IEC 60730-1 Annex H (Class B) compliant hardware self-test routines for Espressif RISC-V SoCs: CPU registers, Configuration & Status Registers (CSR), RAM (March A/X), Flash (CRC32), Program Counter, clock sources, stack overflow, watchdog, and digital I/O. This skill provides scenario recipes, a grounded API reference, the real Kconfig option map, consolidated pitfalls, and the canonical post-boot + runtime integration pattern taken from samples/standalone.

Core Principles

  1. Never invent APIs — Every bist_* function, error code, and config symbol MUST be verified against resources/api_reference.md / resources/config_reference.md, which are transcribed from the repo's headers (src/bist/**/include/*.h) and src/bist/Kconfig. If a name is not in those files, it does not exist.
  2. One umbrella header — Application code includes "bist_esp.h" (which pulls bist_esp_types.h + bist_core.h). The watchdog / GPIO / timer driver wrappers need their own headers: "wdt.h", "gpio.h", "esp_timer.h".
  3. Post-boot vs runtime split — Expensive or destructive tests (RAM March, Flash CRC, stack-overflow stress, watchdog reset, crystal) run ONCE at startup. Cheap idempotent tests (CPU regs, CSR, PC, stack-overflow check) run every main-loop iteration. Mirror samples/standalone/main.c.
  4. Every test returns bist_esp_err_t — Never ignore the return value. A non-BIST_ESP_OK result MUST route to a fail-safe handler (fail_safe_exit() infinite loop, or custom). The library never calls your fail-safe for you.
  5. WDT timeout ≥ one RTC tick (≈ 500 µs / 31 µs at 32768 Hz) — wdt_init() returns -1 for any value below one MWDT tick. The repo's own test asserts wdt_init(1) == -1.
  6. Watchdog test is a two-boot sequence — bist_wdt_test() first triggers a reset; success is only detectable on the NEXT boot by checking the reset reason is RESET_REASON_CORE_MWDT0. Do not expect it to "pass" in a single run.
  7. RAM test is non-destructive but needs the linker region — March A/X back up the region into a .dram0.safe_ram backup buffer and relocate the stack to a 256-byte safe stack before testing. The tested region is bounded by linker symbols _bist_ram_test_start .. _dram0_end, defined in src/soc/<target>/ld/linker.ld.
  8. Flash CRC needs the post-build step — bist_flash_test() compares runtime CRC32 of .flash.text / .flash.rodata against reference values injected by scripts/calculate_crc32.py into .crc_section_text / .crc_section_data. If you bypass cmake/project.cmake's post-build hook, the stored CRC is zero and the test fails with BIST_ESP_FLASH_TEST_ERR.
  9. Stack overflow uses a 0xDEADBEEF sentinel — bist_cpu_stack_overflow_init() writes the sentinel at the linker symbol _stack_overflow_protection_start. You MUST call init before bist_cpu_stack_overflow_check() will ever report BIST_ESP_STACK_TEST_OVERFLOW.
  10. CSR/PMP masks are chip-specific and safety-locked — Never write test patterns to PMP Lock or PMA_L bits; they are write-once until power-on reset. The library's masks already exclude them (e.g. PMPCFG mask 0x1D1D1D1D on C3/C6/H2, 0x0D0D0D0D on C5). Do not "improve" the masks.
  11. Windowed WDT detects BOTH too-early and too-late feeds — wdt_init_windowed(underflow_us) defines the bottom of the window; wdt_init(timeout_us) defines the top. wdt_is_underflow_detected() returns true if you fed before the underflow window. On C6/H2 (no XT WDT) the 32 kHz external-crystal test is skipped and returns BIST_ESP_OK.
  12. bist.conf is mandatory — Every application directory must contain a bist.conf (Kconfig syntax). It can be empty (defaults apply) but must exist, and is what compiles individual CONFIG_ESP_BIST_*_TEST modules in or out.

When to Use

Applicable:

  • Building safety-critical firmware on ESP32-C3 / C5 / C6 / C61 / H2 / H4 / P4 targeting IEC 60730-1 Annex H Class B (or IEC 60335-1 Annex R)
  • Integrating ESP-BIST post-boot and runtime self-tests into a new or existing bare-metal/IDF critical firmware
  • Writing or adapting a samples/standalone-style application (windowed WDT, fail-safe exit, runtime test loop)
  • Debugging a specific BIST test failure (BIST_ESP_*_ERR) and mapping it back to the IEC 60730 component
  • Configuring bist.conf / CONFIG_ESP_BIST_* Kconfig options (WDT timeouts, clock drift %, heap size, flash chunk size)
  • Adding performance-metrics collection via the RISC-V Performance Counter CSRs (BIST_METRICS_*)

Not applicable:

  • General ESP-IDF application development with no safety/self-test requirement (use the ESP-IDF skill instead)
  • Non-Espressif or non-RISC-V targets (BIST is RISC-V CSR/PMP/PMA specific)
  • Xtensa-based ESP32 / S2 / S3 / C6* classic cores (the library targets the RISC-V families listed in get_started.rst)
  • PCB / schematic design or analog circuit verification

Scenario Quick Reference (Recipes)

When user intent matches a scenario, read the corresponding recipe first — it carries the complete call chain, real code adapted from the repo, and a common-errors table.

Project Setup & Integration

recipescenario
recipes/project_setup.mdNew BIST application: CMakeLists, bist.conf, MCUboot bootloader, build/flash/QEMU
recipes/standalone_integration.mdFull IEC 60730 integration pattern — post-boot tests + runtime loop + windowed WDT + fail-safe (mirrors samples/standalone)
recipes/zephyr_integration.mdZephyr RTOS on ESP32-C6 HP+LP dual core: west build --sysbuild, mbox ping/pong IPC, LP-core BIST with ulp_lp_core_intr_disable()/enable() (mirrors samples/zephyr)

CPU & Control-Flow Tests

recipescenario
recipes/cpu_register_csr_test.mdCPU general-purpose registers + CSR (trap / PMP / PMA / mexstatus) integrity
recipes/pc_and_stack_test.mdProgram Counter test (IRAM/Flash/RTC placement) + stack overflow init/check/stress
recipes/watchdog_windowed_test.mdWDT reset test + windowed WDT (underflow / overflow / consecutive feeds)

Memory & Clock Tests

recipescenario
recipes/ram_flash_test.mdRAM March A / March X + Flash CRC32 integrity (post-build CRC injection)
recipes/clock_test.mdExternal 32 kHz crystal (XT WDT) + main 40 MHz crystal drift measurement
recipes/gpio_test.mdGPIO output / input plausibility test + invalid-GPIO handling

Utilities

recipescenario
recipes/metrics_collection.mdRISC-V Performance Counter metrics: cycles, instructions, hazards via BIST_METRICS_*

AI Assistant & Tooling

recipescenario
recipes/mcp_server_setup.mdWire the shipped ESP-BIST MCP server (6 tools, FastMCP + BM25) into Cursor / VS Code; regenerate data/*.json via ingest.py; satisfy the mcp_data_drift CI job

Safety Certification

recipescenario
recipes/safety_validation_workflow.mdIEC 60730 Class B evidence workflow: QEMU -icount 3 + GDB :1234 fault injection driven by pytest_qemu_*, JUnit XML → traceability matrix → coverage → tool qualification → safety case summary

Supported SoCs

Source: README.md, src/bist/README.md, docs/en/get_started.rst.

SoCCPU / ArchMax FreqSRAMXT WDT (32 kHz test)CSR count
ESP32-C3Single-core RISC-V160 MHz400 + 8 RTC KBYes (SOC_XT_WDT_SUPPORTED)25
ESP32-C5RISC-V + LP RISC-V240 MHz384 HP + 16 LP KBNo (skipped)39 (+ mexstatus, mhint)
ESP32-C6RISC-V + LP RISC-V160 MHz512 HP + 16 LP KBNo (skipped)37 (PMA addr)
ESP32-H2Single-core RISC-V96 MHz320 + 4 RTC KBNo (skipped)37 (PMA addr)
ESP32-C61 / H4 / P4RISC-V familiesper datasheetper datasheetper chipper chip

Note: The two README files list slightly different active sets (README.md names C3/C5/C6/H2; get_started.rst additionally documents C61/H4/P4 as supported targets). The CI toolchain files in cmake/ cover esp32c3, esp32c5, esp32c6, esp32h2. Prefer those four for guaranteed build support.

Key Configuration (Kconfig)

Full list in resources/config_reference.md. All symbols live in src/bist/Kconfig.

SymbolTypeDefaultPurpose
CONFIG_ESP_BISTboolyMaster enable for the whole library
CONFIG_ESP_BIST_CPU_REG_TESTboolyCompile bist_cpu_regs_test
CONFIG_ESP_BIST_CPU_CSR_REG_TESTboolyCompile bist_cpu_csr_regs_test
CONFIG_ESP_BIST_MEMORY_RAM_TESTboolyCompile March A / March X
CONFIG_ESP_BIST_MEMORY_FLASH_TESTboolyCompile bist_flash_test
CONFIG_BIST_FLASH_TEST_CHUNK_SIZEhex0x1000Flash CRC chunk size (bytes)
CONFIG_ESP_BIST_STACK_TESTboolyCompile stack overflow tests
CONFIG_ESP_BIST_CLOCK_TESTboolyCompile clock tests
CONFIG_ESP_BIST_CLOCK_PERCENT_FREQUENCY_DRIFTint1Allowed main XTAL drift (%)
CONFIG_ESP_BIST_GPIO_TESTboolyCompile GPIO plausibility tests
CONFIG_ESP_BIST_PROGRAM_COUNTER_TESTboolyCompile PC test
CONFIG_ESP_BIST_WATCHDOG_TESTboolyCompile bist_wdt_test
CONFIG_ESP_BIST_FLASH_SIZEhex0x400000Flash size (bytes)
CONFIG_ESP_BIST_HEAP_SIZEhex0x1000Heap size for BIST ops
CONFIG_ESP_BIST_STACK_PROTECTION_BLOCK_SIZEhex0x100Stack sentinel block size
CONFIG_ESP_BIST_WDT_TIMEOUT_USint50000WDT timeout (top of window)
CONFIG_ESP_BIST_WDT_WINDOWED_UNDERFLOW_TIMEOUT_USint10Windowed WDT underflow (bottom)
CONFIG_ESP_BIST_METRICSboolyEnable BIST_METRICS_* macros

Error Code Reference (bist_esp_err_t)

Source: src/bist/include/bist_esp_types.h.

ValueNameMeaning
0BIST_ESP_OKTest passed
1BIST_ESP_CPU_TEST_ERRCPU register test failed
2BIST_ESP_CPU_CSR_TEST_ERRCSR test failed
3BIST_ESP_RAM_TEST_ERRRAM March A/X mismatch
4BIST_ESP_FLASH_TEST_ERRFlash CRC mismatch
5BIST_ESP_PC_TEST_ERRProgram Counter mismatch
6BIST_ESP_CLOCK_TEST_ERRClock failure / drift out of tolerance
7BIST_ESP_STACK_TEST_ERRStack overflow detection mechanism failed
8BIST_ESP_STACK_TEST_OVERFLOWStack sentinel corrupted (overflow detected)
9BIST_ESP_WDT_TEST_ERRWatchdog did not trigger expected reset
10BIST_ESP_IO_TEST_ERRGPIO output/input plausibility failed

Standalone Execution Flow (state machine)

Adapted from docs/en/application_guide.rst and samples/standalone/main.c:

Boot
 │
 ▼
Post-Boot Tests  ── fail ──►  fail_safe_exit()  (infinite loop)
 │ pass
 ▼
bist_cpu_stack_overflow_init()        (write 0xDEADBEEF sentinel)
 │
 ├─ esp_xt_wdt_register_callback(fail_safe_exit)   (only if SOC_XT_WDT_SUPPORTED)
 ├─ wdt_register_callback(wdt_callback)
 ▼
configure_gpio()  →  wdt_init(TIMEOUT_US)  →  wdt_init_windowed(UNDERFLOW_US)
 │
 ▼
┌─── Main Loop ──────────────────────────────────────┐
│  application_logic()                               │
│  runtime_tests():                                  │
│     bist_cpu_regs_test()       → fail_safe_exit    │
│     bist_cpu_csr_regs_test()   → fail_safe_exit    │
│     bist_cpu_stack_overflow_check() → fail_safe_exit │
│     bist_pc_test()             → fail_safe_exit    │
│  wdt_feed()   (must be inside the windowed window) │
└───────────────────── loop ─────────────────────────┘

Critical Pitfalls (Must Read)

These are the most common errors. Each shows a real WRONG vs CORRECT pattern grounded in the repo's headers, examples, and docs.

1. Ignoring the bist_esp_err_t return value

c
// ❌ WRONG — fire-and-forget; a fault passes silently
bist_cpu_regs_test();
bist_cpu_csr_regs_test();

// ✅ CORRECT — route every failure to a fail-safe handler
bist_esp_err_t err = bist_cpu_regs_test();
if (err == BIST_ESP_CPU_TEST_ERR) {
    ESP_LOGE(TAG, "CPU register test failed");
    fail_safe_exit();
}

2. Calling bist_cpu_stack_overflow_check() without init()

c
// ❌ WRONG — sentinel never written, check can never report overflow
while (1) {
    if (bist_cpu_stack_overflow_check() == BIST_ESP_STACK_TEST_OVERFLOW) {
        fail_safe_exit();
    }
}

// ✅ CORRECT — init the 0xDEADBEEF sentinel once after post-boot tests
bist_cpu_stack_overflow_init();   // writes _stack_overflow_protection_start
while (1) {
    if (bist_cpu_stack_overflow_check() == BIST_ESP_STACK_TEST_OVERFLOW) {
        fail_safe_exit();
    }
}

3. Expecting bist_wdt_test() to pass in a single boot

c
// ❌ WRONG — first execution triggers a reset; "OK" only appears next boot
int main(void) {
    if (bist_wdt_test() != BIST_ESP_OK) fail_safe_exit();  // always resets first time
}

// ✅ CORRECT — two-boot design: trigger reset, then verify reset reason on next boot
//   The library checks reset reason == RESET_REASON_CORE_MWDT0 internally.
//   Integrate into post-boot tests (see samples/standalone) and accept the reboot.
static void post_boot_tests(void) {
    bist_esp_err_t err = bist_wdt_test();
    if (err == BIST_ESP_WDT_TEST_ERR) fail_safe_exit();
}

4. WDT timeout below one RTC tick

c
// ❌ WRONG — 1 us is below one MWDT tick (~31 us @ 32768 Hz); init refuses
wdt_init(1);   // returns -1, watchdog never starts

// ✅ CORRECT — minimum accepted is 500 us (one MWDT tick)
if (wdt_init(500) != 0) {
    ESP_LOGE(TAG, "WDT init failed");
    fail_safe_exit();
}
// Or use the configured default:
wdt_init(CONFIG_ESP_BIST_WDT_TIMEOUT_US);

5. Forgetting the windowed WDT lower bound

c
// ❌ WRONG — only top of window set; underflow (too-early feed) undetected
wdt_init(50000);
while (1) { /* ... */ wdt_feed(); }   // feeding in a tight loop looks "fine"

// ✅ CORRECT — both bounds; feed only after the underflow window elapses
wdt_init(50000);                              // top of window
wdt_init_windowed(2000);                      // bottom of window (2 ms)
while (1) {
    /* application work taking >= underflow_us */
    wdt_feed();
    if (wdt_is_underflow_detected()) fail_safe_exit();
}

6. Calling wdt_feed() immediately after wdt_init_windowed() then again too soon

c
// ❌ WRONG — the first feed clears window_open_flag; an immediate second feed
//            fires the underflow violation (this is the repo's own negative test)
wdt_init_windowed(2000);
wdt_feed();
ets_delay_us(100);   // << underflow window
wdt_feed();          // wdt_is_underflow_detected() == true

// ✅ CORRECT — wait >= underflow_timeout_us between feeds
ets_delay_us(UNDERFLOW_TIMEOUT_US + FEED_MARGIN_US);
wdt_feed();
TEST_ASSERT_FALSE(wdt_is_underflow_detected());

7. Flash CRC "fails" because the post-build injection step was skipped

c
// ❌ WRONG — custom build system that never runs scripts/calculate_crc32.py
//            _crc_section_text_start / _crc_section_data_start stay zero
bist_flash_test();   // → BIST_ESP_FLASH_TEST_ERR

// ✅ CORRECT — build through cmake/project.cmake, which runs post-build:
//   python scripts/calculate_crc32.py <elf> .flash.text  .crc_section_text
//   python scripts/calculate_crc32.py <elf> .flash.rodata .crc_section_data
// Then at runtime the stored CRCs are non-zero and bist_flash_test() returns OK.

8. Passing an invalid GPIO number to the IO test

c
// ❌ WRONG — SOC_GPIO_PIN_COUNT / -1 are out of range
bist_gpio_output_test(SOC_GPIO_PIN_COUNT);   // → BIST_ESP_IO_TEST_ERR
bist_gpio_input_test(-1, 0);                 // → BIST_ESP_IO_TEST_ERR

// ✅ CORRECT — use a real, board-routed GPIO; input test needs external level
#define LED_GPIO 7
#define BTN_GPIO 9
bist_gpio_output_test(LED_GPIO);                 // expect BIST_ESP_OK
bist_gpio_input_test(BTN_GPIO, 1);               // button tied high = expect 1

9. Running GPIO tests AFTER the application has reconfigured the pins

c
// ❌ WRONG — IO tests reset and reconfigure pins; do them before app GPIO setup
configure_led();        // sets GPIO7 as output
bist_gpio_output_test(LED_GPIO);   // pin state fight with app config

// ✅ CORRECT — order matches samples/standalone: tests first, then app config
post_boot_tests();      // includes bist_gpio_output_test / input_test
configure_led();
configure_button();

10. Expecting the 32 kHz external-crystal test to actually run on C6/H2

c
// ❌ WRONG — assuming the test will catch a dead 32 kHz crystal on C6/H2
// (those SoCs lack SOC_XT_WDT_SUPPORTED; the test returns BIST_ESP_OK = "skipped")
if (bist_ext_crystal_fail_test() != BIST_ESP_OK) fail_safe_exit();

// ✅ CORRECT — guard with SOC_XT_WDT_SUPPORTED; rely on main crystal test otherwise
bist_esp_err_t err = bist_ext_crystal_fail_test();   // skipped → OK on C6/H2
if (err == BIST_ESP_CLOCK_TEST_ERR) fail_safe_exit();
err = bist_main_crystal_test();                       // always validates 40 MHz
if (err == BIST_ESP_CLOCK_TEST_ERR) fail_safe_exit();

11. Defining wdt_callback without IRAM_ATTR

c
// ❌ WRONG — MWDT callback runs before reset from IRAM context; a flash callback
//            may fault if flash cache is disabled
void wdt_callback(void *args) { ESP_LOGE(TAG, "WDT"); }

// ✅ CORRECT — place the callback in IRAM (as samples/standalone does)
void IRAM_ATTR wdt_callback(void *args) {
    ESP_LOGE(TAG, "User WDT callback triggered");
}
wdt_register_callback(wdt_callback, NULL);

12. Omitting the mandatory bist.conf file

bash
# ❌ WRONG — empty app dir, no bist.conf; build fails or uses no module selection
my_app/
└── main.c

# ✅ CORRECT — bist.conf is mandatory even when empty (defaults apply)
my_app/
├── CMakeLists.txt
├── bist.conf        # can be empty, or pin CONFIG_ESP_BIST_*_TEST=y/n
└── main.c

Execution Workflow

StepNameDescription
1PlanIdentify target SoC, which IEC 60730 components apply, post-boot vs runtime split
2RecipeIf the scenario matches a recipe in recipes/, follow its call chain and code
3QueryFor any API/config not in a recipe, look it up in resources/api_reference.md or resources/config_reference.md
4ValidateVerify the function name exists in resources/api_reference.md; verify the Kconfig symbol exists in resources/config_reference.md; if absent, do NOT invent it
5ConfirmPresent: includes (bist_esp.h + driver headers), bist.conf, init order, runtime loop, fail-safe path
6ExecuteFor a new app, copy the closest reference: samples/standalone/ for full integration, or tests/<name>/ for a single test, then modify
7Buildcmake -DSOC_TARGET=<target> -B build -GNinja && ninja -C build (after . $IDF_PATH/export.sh)
8Runninja -C build qemu (QEMU) or ninja -C build flash + ninja -C build monitor (device)
9VerifyConfirm each test prints BIST_ESP_OK; on a deliberate fault (fault-injection via GDB) confirm fail_safe_exit() triggers
10CertifyUse docs/en/test_traceability_matrix.rst + docs/en/safety_case_summary.rst for IEC 60730 evidence

Step 6 Detail — Project Creation Strategy

  • Full IEC 60730 integration → copy samples/standalone/ (has main.c, CMakeLists.txt, bist.conf, post-boot + runtime + windowed WDT)
  • Single-test harness (Unity) → copy tests/<test_name>/ (e.g. tests/cpu_reg_test/, tests/ram_test/, tests/windowed_wdt_test/)
  • Zephyr integration → start from samples/zephyr/
  • Always edit the copied bist.conf to enable exactly the CONFIG_ESP_BIST_*_TEST modules you need (see any tests/*/bist.conf for the pattern).

Failure Strategies

SituationAction
A bist_* name is not in resources/api_reference.mdStop; the API does not exist in this version of the library. Inform the user.
wdt_init() returns -1The timeout is below one MWDT tick (≈ 500 µs / 31 µs). Raise it to at least 500 µs.
bist_flash_test() fails on a fresh buildConfirm the post-build CRC injection (scripts/calculate_crc32.py) ran via cmake/project.cmake; check _crc_section_text_start is non-zero.
bist_cpu_stack_overflow_check() never tripsbist_cpu_stack_overflow_init() was not called, or the linker symbol _stack_overflow_protection_start is mis-placed.
bist_ext_crystal_fail_test() "passes" on C6/H2 with no crystalExpected — on SoCs without SOC_XT_WDT_SUPPORTED the test is skipped (BIST_ESP_OK). Use bist_main_crystal_test() for clock validation.
Windowed WDT flags underflow unexpectedlyApplication loop is faster than CONFIG_ESP_BIST_WDT_WINDOWED_UNDERFLOW_TIMEOUT_US. Either raise the underflow value or add a deliberate delay before wdt_feed().
wdt_init_windowed() "first feed then immediate feed" underflowsThis is by design (the repo's test_BIST_WINDOWED_WDT_UNDERFLOW proves it). Wait ≥ underflow window between feeds.
Unsure which CSR mask appliesIt is chip-specific and already encoded in the library (PMPCFG 0x1D1D1D1D on C3/C6/H2, 0x0D0D0D0D on C5; PMA not tested for cfg due to write-once Lock bit). Do not override.
Build cannot find esp_xt_wdt.hThat header comes from the ESP-IDF HAL (components/), not the BIST tree. Guard its use with #if SOC_XT_WDT_SUPPORTED.

References

  • Scenario recipes → recipes/ directory
  • API quick reference (every bist_* signature) → resources/api_reference.md
  • Kconfig / config reference → resources/config_reference.md
  • Consolidated pitfalls → resources/pitfalls.md
  • Real example & sample paths index → resources/example_list.md
  • Upstream repo → https://github.com/espressif/esp-bist

Matgeliwwert Dateien

De Modell liest dës Dateie bei Bedarf, wärend de Skill gelueden ass. Si ginn als liesbar Dateie bereetgestallt a ginn ni ausgeféiert.

Heefeg gestallte Froen

Wat mécht de KI-Skill Esp Bist Skill?

AI Skill for Espressif ESP-BIST (Built-In Self Test) safety library development. Used when users need to create, integrate, or debug IEC 60730 Class B self-test firmware on Espressif RISC-V SoCs, including CPU/CSR/PC integrity tests, RAM March A/X, Flash CRC, clock monitoring, stack overflow detection, and watchdog/windowed-WDT integration. Trigger words: "ESP-BIST", "BIST", "IEC 60730", "Class B", "自检", "内置自测", "安全关键", "safety-critical", "March A", "March X", "windowed watchdog", "CRC32", "ESP32-C3", "ESP32-C6", "ESP32-H2", "ESP32-C5"

Firwat Esp Bist Skill op TypingMind benotzen?

Well Dir en eemol installéiert a mat all Modell benotze kënnt. Esp Bist Skill besteet aus einfachem Markdown amplaz vun ubidderspezifeschem Code. Dee selwechte Skill funktionéiert also mat GPT-5, Claude, Gemini, Grok oder engem lokale Modell – an Dir kënnt de Modell matzen am Chat wiesselen, ouni datt de Skill ophält ze funktionéieren. TypingMind benotzt Är eegen API-Schlësselen, sou datt Dir d'Ubidder direkt bezuelt, amplaz en Abonnement pro Benotzerplaz ze bezuelen. Är Skills a Chats bleiwen an Ärem eegene Späicher.

Wéi installéieren ech Esp Bist Skill an TypingMind?

Maacht an TypingMind Plugins → Skills → Vu GitHub installéieren op a setzt https://github.com/JasonYANG170/esp-dev-skill/tree/main/repos/esp-bist an. TypingMind liest d'Datei SKILL.md, bëndelt déi zougehéiereg Dateien an installéiert dat Ganzt als Skill, deen Dir pro Chat aktivéiere kënnt.

Wéi eng KI-Modeller kënnen Esp Bist Skill benotzen?

All Modell, deen Dir an TypingMind verbënnt. KI-Skills sinn einfach Markdown-Instruktiounen an net ubidderspezifesche Code. Dofir kënne GPT, Claude, Gemini, Grok a lokal Modeller dëse Skill lueden, wann eng Ufro dozou passt.

Wéi vill KI-Modeller kann ech mat Esp Bist Skill benotzen?

Esou vill wéi Dir wëllt. Soulaang e Modell Skills ënnerstëtzt, kënnt Dir Esp Bist Skill domat benotzen – zum Beispill mat GPT, Claude, Gemini, Grok, DeepSeek, Mistral oder Llama – alles op TypingMind mat Ären eegenen API-Schlësselen.

Ass de KI-Skill Esp Bist Skill gratis?

Jo. JasonYANG170 huet de Skill ënner der Lizenz LGPL-3.0-or-later op GitHub publizéiert. Dir bezuelt nëmmen Ären eegene KI-Ubidder fir d'Token, déi Dir benotzt.

Wat si KI-Skills?

E KI-Skill ass e weiderverwendbare Pak vun Instruktiounen, deen engem KI-Modell bäibréngt, wéi en eng bestëmmt Aufgab erfëllt. E follegt dem oppenen Agent Skills-Format: eng Datei SKILL.md mat engem Numm an enger Beschreiwung, plus all Scripten, Virlagen oder Referenzdateien, déi de Modell eventuell brauch. De Modell liest d'Instruktiounen eréischt, wann Är Ufro zum Skill passt. En installéierte Skill kascht also näischt, bis e benotzt gëtt.

Wéi ënnerscheede sech KI-Skills vu Plugins oder MCP-Serveren?

E Plugin oder MCP-Server gëtt engem Modell nei Tools, déi en opruffe kann – Code, deen iergendwou leeft an e Resultat zeréckgëtt. E KI-Skill gëtt dem Modell dogéint Wëssen an eng Virgoensweis: wéi en eng Aufgab ugeet, wéi eng Schrëtt e maache soll a wéi eng gutt Ausgab ausgesäit. Skills bestinn aus einfachem Markdown, brauche kee Server, keen API-Schlëssel a kee Lafzäitëmfeld a funktionéiere mat all Modell.

Alleguer weisen

Elo Ären eegene KI-Aarbechtsberäich ariichten

Abonnéiert Iech op eisen Newsletter, fir iwwer nei Funktiounen an zukünfteg Gewënnspiller informéiert ze ginn 👇