thinknode_m1: stop GPS code from driving the LoRa radio power pin#2865
Open
benskigomez wants to merge 1 commit into
Open
thinknode_m1: stop GPS code from driving the LoRa radio power pin#2865benskigomez wants to merge 1 commit into
benskigomez wants to merge 1 commit into
Conversation
On the M1, pin 37 is the LoRa radio power enable (SX126X_POWER_EN, driven HIGH by ThinkNodeM1Board), but variant.h also defined PIN_GPS_RESET (37) -- the same pin. Because the M1 builds its location provider with default args, MicroNMEALocationProvider drives that pin as if it were the GPS reset: begin() drives it HIGH and stop() drives it LOW. So turning GPS off (e.g. via the GPS switch) cuts power to the LoRa radio. The M1 GPS has no MCU-controlled reset line. Remove the bogus PIN_GPS_RESET and set GPS_RESET (-1) so the provider never touches pin 37; the radio keeps it powered. GPS is unaffected (the L76K streams NMEA without a reset pulse; verified on hardware -- 3D fix in ~80s).
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
On the ThinkNode M1, pin 37 is the LoRa radio power enable (
SX126X_POWER_EN=37, driven HIGH inThinkNodeM1Board.cpp). Butvariants/thinknode_m1/variant.halso definedPIN_GPS_RESET (37)— the same pin.The M1 builds its location provider with default constructor args:
MicroNMEALocationProvider nmea = MicroNMEALocationProvider(Serial1, &rtc_clock); // -> pin_reset = GPS_RESET = PIN_GPS_RESET = 37So
MicroNMEALocationProviderdrives pin 37 thinking it's the GPS reset:begin()drives it HIGH andstop()drives it LOW. The result is that turning GPS off (e.g. via the GPS switch) drives pin 37 low and cuts power to the LoRa radio. The constructor also drives it low at static-init time before the board powers the radio.Fix
The M1 GPS has no MCU-controlled reset line. Remove the incorrect
PIN_GPS_RESET (37)define and setGPS_RESET (-1)so the location provider never touches pin 37. The radio driver continues to own that pin and keeps it powered.GPS is unaffected — the L76K streams NMEA without any reset pulse. Verified on hardware: the M1 GPS acquires normally and gets a 3D fix in ~80 s.
Note
This is the M1 analogue of the M6 REINIT-pin issue (#2863): in both cases the location provider was driving a pin that must not be driven. Different pin, different consequence (M6 silenced the GPS; M1 cuts the radio), same root pattern.