Skip to content

Fixes for GPS support on RAK boards - #3051

Open
YoshiWalsh wants to merge 7 commits into
meshcore-dev:mainfrom
YoshiWalsh:fix/rak-gps
Open

Fixes for GPS support on RAK boards#3051
YoshiWalsh wants to merge 7 commits into
meshcore-dev:mainfrom
YoshiWalsh:fix/rak-gps

Conversation

@YoshiWalsh

Copy link
Copy Markdown

This PR enables GPS support on RAK4631 and RAK3401 boards. It also provides support for RAK12501, which was previously unsupported.

Behind the scenes, it fixes some additional logic errors and slightly improves code cleanliness.

Code changes

  • Enable GPS on RAK4631 (& related boards)
  • Enable RAK-flavoured sensor support for RAK3401
  • Fix UART GPS not working on RAK boards due to transposed RX/TX pins
  • Replace faulty reset pin logic with PIN_3V3_EN logic (see below)
  • Code cleanliness

Details on faulty reset pin logic

The previous code only worked by accident.

  1. Regardless of which slot the GPS module was present in, it would always be detected as Slot A
  2. Slot A reset pin (WB_IO2) overlaps with PIN_3V3_EN.
  3. Per u-blox ZOE-M8Q documentation: "In reset state, the SiP consumes a significant amount of current. It is therefore recommended to use RESET_N only as a reset signal and not as an enable/disable."
    So using reset PIN to control GPS status is not desirable anyway.

Due to the way these logic errors interacted, the RAK12500 sensor was actually able to work correctly in Slot A and Slot C, but for the wrong reasons.

This PR explicitly just controls the 3V3 bus, which was what the previous code was doing by accident.

Note: 3V3 control is disabled on the RAK3401 as this board is most commonly used in the "1W LoRa Booster Kit", and turning 3V3 off would also disable 5V power supply to the SKY66122 PA.

Changes tested with RAK3401 with a RAK12500 in both Slot A and Slot C, as well as a RAK12501 in Slot A. (RAK12501 should work in Slot D too, I just haven't tested it)

This was only configured for a single Sensor Slot anyway
These boards support the RAK12500 and RAK12501 GPS modules.
This board is a RAK4631 derivative (even sharing the same bootloader) and so supports the same features
This seems to have just been a typo. Fixing this allows RAK12500 to work in serial mode, and RAK12501 to work at all. (Both tested on RAK3401)
The previous code only worked by accident.

1. Regardless of which slot the GPS module was present in, it would always be detected as Slot A
2. Slot A reset pin (WB_IO2) overlaps with PIN_3V3_EN.
3. Per u-blox ZOE-M8Q documentation: "In reset state, the SiP consumes a significant amount of current. It is therefore recommended to use RESET_N only as a reset signal and not as an enable/disable."
So using reset PIN to control GPS status is not desirable anyway.

This commit replaces the faulty reset pin detection and control logic by instead just controlling the 3V3 bus.

Note: 3V3 control is disabled on the RAK3401 as this board is most commonly used in the "1W LoRa Booster Kit", and turning 3V3 off would also disable 5V power supply to the SKY66122 PA.

Changes tested with RAK3401 with a RAK12500 in both Slot A and Slot C, as well as a RAK12501 in Slot A.
@IoTThinks

Copy link
Copy Markdown
Contributor

RAK12501 (L76K) works RAK4631 on MeshCore 1.16.

@IoTThinks

Copy link
Copy Markdown
Contributor

You may want to rebase to dev instead.
The PR will be merged to dev, then to main.

Have you tested the combination of RAK4631/RAK3401 and RAK12500/RAK12501?

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