Skip to content

thinknode_m1: stop GPS code from driving the LoRa radio power pin#2865

Open
benskigomez wants to merge 1 commit into
meshcore-dev:devfrom
benskigomez:fix/m1-gps-radio-pin
Open

thinknode_m1: stop GPS code from driving the LoRa radio power pin#2865
benskigomez wants to merge 1 commit into
meshcore-dev:devfrom
benskigomez:fix/m1-gps-radio-pin

Conversation

@benskigomez

Copy link
Copy Markdown

Problem

On the ThinkNode M1, pin 37 is the LoRa radio power enable (SX126X_POWER_EN=37, driven HIGH in ThinkNodeM1Board.cpp). But variants/thinknode_m1/variant.h also defined PIN_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 = 37

So MicroNMEALocationProvider drives pin 37 thinking it's the GPS reset: begin() drives it HIGH and stop() 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 set GPS_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.

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).
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