Skip to content

Repository files navigation

STM32 embedded proximity-sensor algorithm

STM32F722RE firmware and STM32CubeIDE project, backed up on 2026-09-06 before implementing the proposed Q2 release-delay changes.

Snapshot status

  • Active board configuration: Standard_Sensor4.
  • Q2 release conditions use Q2 detection values, not Q1 values.
  • CapRaw previous/current weights remain 0/1.
  • Active debug CAN: Q2-only v2, 14 IDs (0x40 through 0x4D), 100 Hz, classic CAN at 1 Mbps. Previous transmit maps are preserved under #if 0.
  • Detector-reference alignment, independent learning timers and direction-sensitive approach changes have NOT been implemented.

Contents

  • Core/Src, Core/Inc, Core/Startup: firmware and startup code.
  • Drivers: STM32/CMSIS and sensor drivers, with existing license notices.
  • .project, .cproject, the .ioc file, linker scripts and launch configurations: STM32CubeIDE project configuration.
  • Core/tools: CAN capture/decoding, offline analysis and regression tests.
  • Core/test: existing local reference/test text files.
  • Core/captures: compact summaries, analyses, findings and existing plots.

Generated build output, Python bytecode and raw CAN .jsonl recordings are excluded. Raw recordings remain on the measurement PC. Replaying individual frames or learning samples requires those local recording files.

Build and diagnostics

Import into STM32CubeIDE and build for STM32F722RE. Existing IDE settings use some absolute paths from the original PC; adjust them on a different machine.

Run offline tests from Core:

py -3 -m unittest discover -s tools -p test_capdist_debug_protocol.py -v

Live capture uses python-can and the IXXAT VCI driver. Existing plotting tools additionally use NumPy and Matplotlib. Q2 v2 learning analysis does not require the plotting tools.

Capture Q2 v2 without sending application CAN frames, from Core:

py -3 tools/capture_capdist.py --seconds 30 --require-q2 --start-immediately --quiet-progress

Debug protocol and findings

The touch test did not reproduce the previous large residual-delta issue. The remaining release/learning delay involved repeated detection near the threshold and a shared learning period of up to four seconds. This snapshot intentionally preserves the firmware before that next fix.

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages