feat: BME280 baro pressure & ambient temp (Issue #672) #673

Merged
sl-jetson merged 1 commits from sl-firmware/issue-672-bme280-baro-temp into main 2026-03-18 08:27:40 -04:00
Collaborator

Summary

  • New baro module reads BME280/BMP280 at 1 Hz on I2C1 (Mamba F722S), computes ISA pressure altitude, publishes JLINK_TLM_BARO (0x8D) to Orin — fully Mamba-local, no Orin dependency
  • New JLink telemetry frame 0x8D (jlink_tlm_baro_t, 12 bytes packed): pressure_pa, temp_x10, alt_cm, humidity_pct_x10 (-1 on BMP280)
  • baro_get_alt_cm() exposes altitude for slope compensation in the balance PID
  • Wired into main.c: baro_init() after bmp280_init(), baro_tick(now) each ms (self-rate-limits to 1 Hz)

Test plan

  • Build: gcc -I include -I test/stubs -DTEST_HOST -lm -o /tmp/test_baro test/test_baro.c && /tmp/test_baro -> 31/31 pass
  • Flash to Mamba, confirm JLINK_TLM_BARO frames appear on JLink at 1 Hz
  • Verify pressure_pa ~101325 Pa at bench, temp_x10 within +-50 of ambient
  • Verify alt_cm reasonable at test site elevation
  • On BME280: confirm humidity_pct_x10 in 200-900 range; on BMP280: confirm -1
  • Existing test_slope_estimator.c unaffected: 35/35 pass

Generated with Claude Code

## Summary - New baro module reads BME280/BMP280 at 1 Hz on I2C1 (Mamba F722S), computes ISA pressure altitude, publishes JLINK_TLM_BARO (0x8D) to Orin — fully Mamba-local, no Orin dependency - New JLink telemetry frame 0x8D (jlink_tlm_baro_t, 12 bytes packed): pressure_pa, temp_x10, alt_cm, humidity_pct_x10 (-1 on BMP280) - baro_get_alt_cm() exposes altitude for slope compensation in the balance PID - Wired into main.c: baro_init() after bmp280_init(), baro_tick(now) each ms (self-rate-limits to 1 Hz) ## Test plan - Build: gcc -I include -I test/stubs -DTEST_HOST -lm -o /tmp/test_baro test/test_baro.c && /tmp/test_baro -> 31/31 pass - Flash to Mamba, confirm JLINK_TLM_BARO frames appear on JLink at 1 Hz - Verify pressure_pa ~101325 Pa at bench, temp_x10 within +-50 of ambient - Verify alt_cm reasonable at test site elevation - On BME280: confirm humidity_pct_x10 in 200-900 range; on BMP280: confirm -1 - Existing test_slope_estimator.c unaffected: 35/35 pass Generated with Claude Code
sl-perception added 1 commit 2026-03-17 18:35:53 -04:00
- New baro module (include/baro.h, src/baro.c): reads BME280/BMP280
  at 1 Hz on I2C1, computes pressure altitude (ISA formula), publishes
  JLINK_TLM_BARO (0x8D) telemetry to Orin. Runs entirely on Mamba F722S
  with no Orin dependency. baro_get_alt_cm() exposes altitude to balance
  PID slope compensation.
- New JLink telemetry frame 0x8D (jlink_tlm_baro_t, 12 bytes packed):
  pressure_pa (int32), temp_x10 (int16), alt_cm (int32),
  humidity_pct_x10 (int16; -1 = BMP280/absent).
- Wire into main.c: baro_init() after bmp280_init(), baro_tick(now)
  each ms (self-rate-limits to 1 Hz).
- Unit tests (test/test_baro.c): 31 tests, all pass. Build:
    gcc -I include -I test/stubs -DTEST_HOST -lm -o /tmp/test_baro test/test_baro.c

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
sl-perception force-pushed sl-firmware/issue-672-bme280-baro-temp from ca0098a403 to 4318589496 2026-03-18 08:25:32 -04:00 Compare
sl-jetson merged commit 5906af542b into main 2026-03-18 08:27:40 -04:00
Sign in to join this conversation.
No Reviewers
No Label
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: seb/saltylab-firmware#673
No description provided.