feat(rak3401): auto-sleep optional onboard SX1262

Use the existing RAK3401 firmware roles for RAK4631 cores paired with a
RAK13302. Probe the optional onboard radio and put it into cold sleep
before handing SPI to the primary radio, removing seven duplicate build
environments.

Preserve BUSY startup readiness, release probe pulls before sleep, and
disconnect unused GPIO input buffers during cleanup. Add focused tests
for sequencing, missing signatures, timeouts, and failed sleep readback.

Validated with four native tests, seven firmware-role builds, and repeater
boot checks on RAK4631 + RAK13302. Supply current was not measured.
This commit is contained in:
agessaman committed 2026-10-16 19:02:23 -07:00
1 parent 94a4c0b0ed
commit 6dc7f2b047
6 files changed
+184 -164

No files matched your search

+1 -6
View File
@@ -175,10 +175,7 @@ static const uint8_t AREF = PIN_AREF;
#define P_LORA_BUSY SX126X_BUSY
#define P_LORA_RESET SX126X_RESET
// The RAK4631 core carries its own SX1262, which is unused when a RAK13302
// supplies the RF path. RAK4631_ONBOARD_SX1262_SLEEP builds put it into cold
// sleep at boot; on a genuine RAK3401 these pins are unconnected.
#ifdef RAK4631_ONBOARD_SX1262_SLEEP
// Optional RAK4631 onboard radio; these internal pins are unused on RAK3401.
#define ONBOARD_LORA_NSS (42) // P1.10
#define ONBOARD_LORA_SCLK (43) // P1.11
#define ONBOARD_LORA_MOSI (44) // P1.12
@@ -187,8 +184,6 @@ static const uint8_t AREF = PIN_AREF;
#define ONBOARD_LORA_DIO_1 (47) // P1.15
#define ONBOARD_LORA_RESET (38) // P1.06
#define ONBOARD_LORA_ANT_SW (37) // P1.05, powers the onboard RF switch
#define ONBOARD_LORA_TCXO_VOLTAGE 1.8
#endif
// enables 3.3V periphery like GPS or IO Module
// Do not toggle this for GPS power savings