Skip to content

ThinkNode M8: switch the GPS to the AG3352Q - #12151

Merged
jp-bennett merged 3 commits into
developfrom
claude/thinknode-m8-gps-ag3352
Oct 15, 2026
Merged

jp-bennett merged 3 commits into
developfrom
claude/thinknode-m8-gps-ag3352

Conversation

@jp-bennett

@jp-bennett jp-bennett commented Oct 13, 2026 •

Copy link
Copy Markdown
Collaborator

Later ThinkNode M8 units replace the ATGM336H with an Airoha AG3352Q. There is no RTC_INT, and GPS_EN switches only the 0.8 V core buck; the 1.8 V rail is always on. With $PAIR003 (the M9 approach) the receiver never reached low power: Elecrow measured 1.5 mA.

  • Sleep: $PAIR382,1 then $PAIR650,0 (backup mode), each sent while idle_int is held low, then GPS_EN goes low.
  • Wake: GPS_EN high, then a 10 ms RESETB pulse. RESETB is the only way out of backup mode on this board.
  • Shutdown: idle_int is held high and RESETB released through System OFF. Previously the variant's pin sweep left both floating.

This adds GPS_AIROHA_RESET_WAKE to GPS.h/GPS.cpp for Airoha boards with RESETB but no RTC_INT. Boards with RTC_INT (T1000-E, Wio T1000-S, Mesh Tracker X1) and the M9 build unchanged.

Pin map, checked against the ThinkNode M8 V1.0 schematic:

Signal nRF52840 Notes
GPS TX (GPIO4) P1.02 MCU RX, unchanged
GPS RX (GPIO5) P1.04 MCU TX, unchanged
RESETB P0.17 inverted by Q16, so the default GPS_RESET_MODE HIGH is correct
1PPS (GPIO10) P0.14 unchanged
idle_int (GPIO11) P1.07 new GPS_SLEEP_INT, driven high in initVariant()
0.8 V core buck EN P0.16 PIN_GPS_EN
1.8 V buck EN (P0.15, NC) pulled up to VIN_GPS, always on
  • Removed PIN_GPS_STANDBY (P0.15). It was the ATGM336H standby pin, and with it defined down() picks soft sleep, which does nothing for an Airoha receiver.
  • Changed GPS_BAUDRATE from 9600 to 115200. The probe's baud scan is unchanged.
  • ATGM336H units are not supported after this change.

🤝 Attestations

  • I have tested that my proposed changes behave as described.
  • I have tested that my proposed changes do not cause any obvious regressions on the following devices:
    • Heltec (Lora32) V3
    • LilyGo T-Deck
    • LilyGo T-Beam
    • RAK WisBlock 4631
    • Seeed Studio T-1000E tracker card
    • Other (please specify below)
      • ThinkNode M8 (AG3352Q): probe reports AG3352 detected; over six fix/sleep/wake cycles $PAIR650 was acked five times (one no ack after the 1.5 s budget), and NMEA resumed after every RESETB pulse. Fix after wake took 36–84 s.
      • ThinkNode M8 sleep and shutdown current: waiting on Elecrow's measurement

🤖 Generated with Claude Code

Summary by CodeRabbit

  • Device Support
    • Updated GPS support on the ELECROW ThinkNode M8 for the AG3352Q receiver, including operation at 115200 baud.
    • The GPS sleep-control signal starts high during initialization and remains high during shutdown.
    • GPS receivers with reset-based wake support now receive a reset pulse when waking, and the GPS reset pin is held low during shutdown.

Later M8 units replace the ATGM336H with an Airoha AG3352Q. Drop the
ATGM336H standby pin and wire up idle_int (P1.07) so the existing
GPS_SLEEP_INT path stops the engine with $PAIR003 before GPS_EN cuts
the 0.8 V core, as on the ThinkNode M9. Default baud is now 115200.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@github-actions

Copy link
Copy Markdown
Contributor

⚡ Try this PR in the Web Flasher

Note

Building this pull request… the flash button, badges and supported-board
list will appear here automatically once CI finishes.

@coderabbitai

coderabbitai Bot commented Oct 13, 2026 •

Copy link
Copy Markdown
Contributor

Review in Change Stack →

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration
  • Configuration used: Repository: meshtastic/firmware/.coderabbit.yaml
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 2a0778b1-bdfe-4312-b39a-b1c3eb3dc16e
📥 Commits

Reviewing files that changed from the base of the PR and between 533d40c and 2c01e20.

📒 Files selected for processing: 2
  • variants/nrf52840/ELECROW-ThinkNode-M8/variant.cpp
  • variants/nrf52840/ELECROW-ThinkNode-M8/variant.h

Included review availability: This review used your included allowance. Your plan provides up to 8 included reviews per hour; 7 remain after this review.

📝 Walkthrough

The ThinkNode M8 variant now configures its GPS for an AG3352Q at 115200 baud and defines sleep and reset-wake signals. When reset-wake support is enabled, GPS wake handling pulses reset for supported Airoha receivers.

Changes: Airoha GPS reset wake

Layer / File(s) Summary
Board GPS signals and wake capability
variants/nrf52840/ELECROW-ThinkNode-M8/variant.h, variants/nrf52840/ELECROW-ThinkNode-M8/variant.cpp, src/gps/GPS.h
The variant sets the GPS baud rate to 115200, adds GPS_SLEEP_INT and GPS_AIROHA_RESET_WAKE, and removes PIN_GPS_STANDBY. Initialization drives the sleep signal HIGH. Shutdown sets the sleep signal HIGH and reset pin LOW, and excludes both pins from the shutdown output-low loop. GPS.h defines reset-wake capability when the required board macros exist and soft RTC is disabled.
Airoha reset-based wake
src/gps/GPS.cpp
When reset-wake support is enabled, GPS wake handling waits for power to settle and pulses reset for AG3335 and AG3352 receivers. Sleep-command setup supports reset-wake builds and retains its Airoha-model and missed-acknowledgement guards.

Priority: ➖ Normal

Estimated code review effort: 2 (Simple) | ~15 minutes

Change: Feature

Merge Risk: ⚪ Minimal · up to 2c01e

The M8 change configures the AG3352Q for reset-based wake. The inspected shutdown and wake levels are consistent with the board’s inverted RESETB, and no concrete user-facing failure is established; the PR appears ready for normal checks.

Pre-merge checks: Passed 4 · Failed 1

Failed Failed checks: 1 warning

Check name Status Explanation Resolution
Docstring Coverage Warning Docstring coverage is 50.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 8 functions across 4 files. Write docstrings for the functions missing them to satisfy the coverage threshold.
Passed Passed checks: 4 passed
Check name Status Explanation
Title check Passed The title clearly identifies the primary change: switching the ThinkNode M8 GPS to the AG3352Q.
Description check Passed The description explains the hardware differences, sleep and wake behavior, pin changes, compatibility impact, test results, and remaining current-measurement work. It also completes the relevant atte…
Linked Issues check Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.
  • Fix all pre-merge checks with AI
✨ Finishing Touches: 💡 1
📝 Generate docstrings: 💡
  • Commit to this branch
  • Create a new PR
🧪 Generate unit tests (beta)
  • Commit to this branch
  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@jp-bennett jp-bennett added the hardware-support Hardware related: new devices or modules, problems specific to hardware label Oct 13, 2026
@github-actions

github-actions Bot commented Oct 13, 2026 •

Copy link
Copy Markdown
Contributor

@jp-bennett jp-bennett added this to the 2.8.2 milestone Oct 13, 2026
$PAIR003 only stops the GNSS engine, so with the 1.8 V rail always on
the receiver never reached low power (1.5 mA measured by Elecrow).

Add GPS_AIROHA_RESET_WAKE for boards without RTC_INT that have RESETB:
sleep sends $PAIR650,0 (with idle_int low) before EN goes low, and wake
pulses RESETB once EN is back up. Enable it on the M8.

At shutdown, hold idle_int high and RESETB released instead of letting
the variant's pin sweep float them through System OFF.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@jp-bennett
jp-bennett enabled auto-merge October 14, 2026 17:03
@jp-bennett
jp-bennett added this pull request to the merge queue Oct 14, 2026
@jp-bennett
jp-bennett removed this pull request from the merge queue due to a manual request Oct 14, 2026
…8-gps-ag3352

# Conflicts:
#	variants/nrf52840/ELECROW-ThinkNode-M8/variant.cpp
@jp-bennett
jp-bennett enabled auto-merge October 14, 2026 23:52
@jp-bennett
jp-bennett added this pull request to the merge queue Oct 15, 2026
Merged via the queue into develop with commit ed072eb Oct 15, 2026
@caveman99
caveman99 deleted the claude/thinknode-m8-gps-ag3352 branch October 26, 2026 08:39
Slankydudl pushed a commit to Slankydudl/firmware that referenced this pull request Nov 23, 2026
* ThinkNode M8: switch the GPS to the AG3352Q

Later M8 units replace the ATGM336H with an Airoha AG3352Q. Drop the
ATGM336H standby pin and wire up idle_int (P1.07) so the existing
GPS_SLEEP_INT path stops the engine with $PAIR003 before GPS_EN cuts
the 0.8 V core, as on the ThinkNode M9. Default baud is now 115200.

Co-Authored-By: Claude Opus 5.5 <[email protected]>

* ThinkNode M8: put the AG3352 into backup mode for sleep

$PAIR003 only stops the GNSS engine, so with the 1.8 V rail always on
the receiver never reached low power (1.5 mA measured by Elecrow).

Add GPS_AIROHA_RESET_WAKE for boards without RTC_INT that have RESETB:
sleep sends $PAIR650,0 (with idle_int low) before EN goes low, and wake
pulses RESETB once EN is back up. Enable it on the M8.

At shutdown, hold idle_int high and RESETB released instead of letting
the variant's pin sweep float them through System OFF.

Co-Authored-By: Claude Opus 5.5 <[email protected]>

---------

Co-authored-by: Claude Opus 5.5 <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

hardware-support Hardware related: new devices or modules, problems specific to hardware

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant