Skip to content

docs: add TROUBLESHOOTING.md#6

Merged
Aiden Young (ajyds) merged 4 commits into
mainfrom
ab/june10-troubleshooting
Jun 27, 2026
Merged

docs: add TROUBLESHOOTING.md#6
Aiden Young (ajyds) merged 4 commits into
mainfrom
ab/june10-troubleshooting

Conversation

@ehuang2021

Copy link
Copy Markdown
Member

Summary

Adds TROUBLESHOOTING.md covering common build/sim/deploy issues, and links it from CONTRIBUTING.md.

Self-contained starter task (JUNE10DO, Person 7, task 4). Docs only — no code changes.

Sections

  • Vitis HLS license errors — FlexLM env vars, settings64.sh, and the no-license make test-fpga path via hls_compat.h
  • CUDA version mismatch — Torch wheel selection, CPU fallback in models/inference.py, why training needs a GPU but conversion/inference don't
  • MAVLink port conflicts — UDP (14540/14550 SITL) vs UART (telem2 @ 115200), lsof/dialout, CRC-extra notes
  • ARM cross-compilation gotchas — sim vs hardware vs FreeRTOS targets, armhf-vs-aarch64 triple mismatch, stale-.o/LTO/-ffast-math pitfalls
  • Event camera driver issues — udev/USB, vendor SDK not in requirements.txt, recorded-event dev path, ring-buffer eviction
  • SD card logging failures — best-effort buffered FatFs-over-SPI writes, flush/f_sync on shutdown, mavlogdump parsing, loop_profiler kFlush latency

Each section is grounded in the actual toolchain (arm/Makefile, fpga/build.tcl, fpga/config.yaml, arm/mavlink_sd_logger.h, arm/mavlink_bridge.h) and points to the hardware-free sim/test paths where they exist.

Test plan

  • Docs only; links to existing files verified to resolve
  • No build/test impact

Add a buffered, crash-safe telemetry logger that records the 100 Hz
control loop to an on-board SD card as a stream of CRC-checked MAVLink v2
frames (".bin" flight log), parseable by standard tooling.

- arm/mavlink_sd_logger.h: header-only MavlinkSdLogger. Canonical
  MCRF4XX CRC, MAVLink v2 framing, block-buffered writes, periodic +
  shutdown flush. SD-over-SPI sink abstracted behind FatFs-shaped
  write/sync callbacks. Per-tick CA_TELEM record; optional stock
  NAMED_VALUE_* for ground stations under MAVLINK_AVAILABLE.
- arm/drone_main.cpp: log each control tick, periodic fsync, flush and
  close on shutdown with a stats summary.
- arm/test_mavlink_logger.cpp: 11 unit tests (CRC known-answer, framing,
  field round-trip, buffering, oversize, write-failure recovery, raw
  tee, guards). Wired into arm `make test` and root `make test-arm`/CI.
- mavlink_bridge.h: silence two unused-parameter warnings now that the
  header is pulled into the main build.
…latency

- Add link-time optimization (-flto) to the ARM release build (RELEASE_FLAGS);
  -O3 was already enabled.
- Add loop_profiler.h: a zero-heap, per-stage latency accumulator (count / mean /
  max us) and a 'make profile' target (-DPROFILE_LOOP). Production builds compile
  the probe macros to no-ops, so the flight binary is unaffected.
- Instrument the control loop in drone_main.cpp across nine stages
  (read_flow, predict, track, evade, write_cmd, console_log, bin_log, flush, TOTAL).
- Add docs/loop-latency.md documenting methodology, measured worst case
  (482 us, 4.8% of the 10 ms budget), and the SD fsync real-hardware caveat.
Cover common build/sim/deploy issues: Vitis HLS licensing, CUDA version
mismatch, MAVLink port conflicts, ARM cross-compilation, event camera
drivers, and SD card logging failures. Grounded in the actual toolchain
(arm/Makefile, fpga/build.tcl, config.yaml, mavlink_sd_logger.h).

JUNE10DO Person 7 task 4.
- deploy: arm/Makefile hardcodes root@192.168.1.10 with no DEPLOY_HOST
  override variable; show direct scp instead of an invented make var
- cross-toolchain: list both gnueabihf and aarch64 apt package names
  explicitly to avoid pairing a 64-bit package with a 32-bit error
@ajyds Aiden Young (ajyds) merged commit 2dd6436 into main Jun 27, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants