Bfd rtt logger

From Sonder4/STM32-BFD-Kit · View interactive version

Bfd rtt logger is an AI agent skill from the GitHub repository Sonder4/STM32-BFD-Kit. Use when capturing STM32 RTT output through the current J-Link mainline, validating runtime behavior after flash/reset, or collecting short runtime evidence from J-Link RTT channels.

How to use this skill

Skill file

BFD RTT Logger

Self-Improvement Loop (Required)

Use this skill to capture RTT logs with profile-driven defaults.

Quick Start

  1. Run bootstrap profile first.
  2. Use J-Link quick mode for routine runtime checks.
  3. Use dual mode only after reset/reconnect flows on J-Link.
  4. If the active probe is ST-Link, switch to bfd-strtt-rtt instead of this skill.

Core Commands

# 0) Bootstrap profile (required)
python3 ./.codex/skills/bfd-project-init/scripts/bootstrap.py --project-root . --mode check
# 1) Quick mode
./build_tools/jlink/rtt.sh logs/rtt/rtt_quick.log 5 --mode quick
# 2) Dual mode for reset-follow capture
./build_tools/jlink/rtt.sh logs/rtt/rtt_dual.log 6 --mode dual --reset-policy gdb-reset-go
# 3) Resolve RTT address from profile ELF
./.codex/skills/bfd-rtt-logger/scripts/get_rtt_address.sh \
  --elf "${STM32_ELF}" \
  --device "${STM32_DEVICE}" \
  --out logs/debug/rtt_addr_probe.log

Workflow

  1. Run bootstrap and verify profile env.
  2. Confirm RTT symbol/address.
  3. Capture with J-Link quick or dual.
  4. Archive logs and extract key evidence lines.
  5. If RTT reports fallback_no_payload, RTT_SUCCESS=0, or RTT Control Block not found, stop RTT-based judgment and switch to standardized RAM sampling.

USB CDC Service False-Negative Triage

If a ROS/service transaction clearly leaves the host, but the host never receives SYSTEM_STATUS, ODOM, or other regular upstream packets, do not immediately conclude that the service FSM is broken. Check RTT first:

Probe Capability Boundary

Mandatory Fallback: RTT Failure to RAM Sampling

Trigger this branch when any of the following is observed:

Do not treat these results as proof that motors are offline.

Primary fallback target:

Fallback Step 1: Generic Symbol-Auto Decode

python3 BFD-Kit/skills/codex/bfd-data-acquisition/scripts/data_acq.py \
  --elf "${STM32_ELF}" \
  --mode symbol-auto \
  --symbol <global_symbol> \
  --follow-depth 1 \
  --format summary \
  --output logs/data_acq/<global_symbol>.summary

Fallback Step 2: Manual Symbol Fallback When Auto Reflection Is Not Suitable

python3 BFD-Kit/skills/codex/bfd-data-acquisition/scripts/data_acq.py \
  --elf "${STM32_ELF}" \
  --mode symbol \
  --symbol <global_symbol> \
  --count <N> \
  --decode-profile <profile_name> \
  --format summary \
  --output logs/data_acq/<global_symbol>.summary

Archival form:

python3 BFD-Kit/skills/codex/bfd-data-acquisition/scripts/data_acq.py \
  --elf "${STM32_ELF}" \
  --mode symbol \
  --symbol <global_symbol> \
  --count <N> \
  --decode-profile <profile_name> \
  --format json \
  --output logs/data_acq/<global_symbol>.json

This fallback is the default next action after RTT payload failure. Do not invent a new J-Link or GDB command first.

If the required output is not a decoded object snapshot but a high-rate, non-halting fixed-address scalar stream, switch to the native HSS wrapper:

bash BFD-Kit/scripts/bfd_jlink_hss.sh --json hss sample \
  --symbol <scalar_symbol_path> \
  --duration 0.3 \
  --period-us 1000 \
  --output logs/data_acq/<scalar_symbol_path>.csv

Hard Rules

Scripts

Related Skills

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.