BFD RTT Logger
Self-Improvement Loop (Required)
- When this skill encounters a build, flash, debug, script-usage, or other workflow problem, do not stop at the local workaround after the issue is solved.
- Record the resolved issue and lesson in
BFD-Kit/.learnings/ERRORS.mdand/orBFD-Kit/.learnings/LEARNINGS.md; unresolved capability gaps go toBFD-Kit/.learnings/FEATURE_REQUESTS.md. - Promote reusable fixes into the affected BFD-Kit asset in the same task when feasible: update the relevant
SKILL.md, script, wrapper, or resource so the next run benefits by default. - When a learning is promoted into a skill or script, append a short entry to
BFD-Kit/.learnings/CHANGELOG.mdand mention the improvement in the task close-out.
Use this skill to capture RTT logs with profile-driven defaults.
Quick Start
- Run bootstrap profile first.
- Use J-Link
quickmode for routine runtime checks. - Use
dualmode only after reset/reconnect flows on J-Link. - If the active probe is ST-Link, switch to
bfd-strtt-rttinstead 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
- Run bootstrap and verify profile env.
- Confirm RTT symbol/address.
- Capture with J-Link
quick/dual. - Archive logs and extract key evidence lines.
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:
- If RTT repeatedly shows lines such as
W:[usb] tx fail ... status=1, treatstatus=1asUSBD_BUSYon the ST USB CDC stack. - In this pattern, the visible failure is usually the MCU USB upstream path, not the service handler itself.
- For
mcu_comm-style firmware that reuses a shared static TX buffer, confirm that the USB send path waits forTxState == 0before reusing the buffer and also waits for TX completion afterCDC_Transmit_*()succeeds. - When this signature appears, prioritize transport-layer repair or verification before spending time on service/action state machines.
Probe Capability Boundary
- J-Link supports
quick,dual, and native HSS. - ST-Link uses the independent
bfd-strtt-rttskill. - ST-Link does not use this J-Link mainline RTT path.
Hard Rules
- Fail-fast if bootstrap profile is missing.
- Save final logs under
logs/rtt/. - In
dualmode, do not open competing J-Link sessions. - Keep final evidence in repository paths only.
Scripts
.codex/skills/bfd-rtt-logger/scripts/rtt_log.sh.codex/skills/bfd-rtt-logger/scripts/rtt_log.ps1.codex/skills/bfd-rtt-logger/scripts/get_rtt_address.sh
Related Skills
bfd-project-initbfd-debug-interfacebfd-fault-loggerbfd-debug-orchestrator