feat(rak3401): cold-sleep RAK4631 onboard SX1262 on RAK13302 builds
A RAK4631 core paired with a RAK13302 leaves the core's own SX1262 powered but never initialized, idling in STDBY_RC for the life of the board. Firmware cannot cut its supply -- P1.05 is the RF switch rail, not the radio's -- so bring it up on its own pins just long enough to issue a cold sleep, before std_init() repins SPI onto the RAK13302. Gated behind RAK4631_ONBOARD_SX1262_SLEEP and exposed through seven RAK_4631_13302_* envs, so RAK_3401_* artifacts are unchanged. The sleep is issued regardless of what begin() returns: Module::init() runs first, so SPI stays usable even if TCXO calibration fails. NSS is then held high, since the SX1262 wakes on an NSS falling edge. Verified on RAK19007 + RAK4631 + RAK13302: begin=0 sleep=0, RAK13302 init clean (device_errors=0x0000), TX and RX both confirmed. The current saving itself is derived from the datasheet (600 uA STDBY_RC -> 160 nA cold sleep) and is not measured.
This commit is contained in:
1 parent
22bc13804c
commit
974564b89c
3 files changed
+173
No files matched your search
@@ -134,3 +134,128 @@ build_src_filter = ${rak3401.build_src_filter}
|
||||
extends = rak3401
|
||||
build_src_filter = ${rak3401.build_src_filter}
|
||||
+<../examples/kiss_modem/>
|
||||
|
||||
; ------------------------- RAK4631 core + RAK13302 -------------------------
|
||||
; Same RF hardware as the RAK3401 1W kit, but the RAK4631 core carries a second,
|
||||
; unused SX1262 that would otherwise idle in standby forever. These envs match
|
||||
; the RAK_3401_* ones and additionally cold-sleep that radio at boot.
|
||||
; Do not flash them to a genuine RAK3401 -- there is no onboard radio to sleep.
|
||||
|
||||
[rak4631_13302]
|
||||
extends = rak3401
|
||||
board = rak4631
|
||||
build_flags = ${rak3401.build_flags}
|
||||
-D RAK4631_ONBOARD_SX1262_SLEEP
|
||||
build_src_filter = ${rak3401.build_src_filter}
|
||||
lib_deps = ${rak3401.lib_deps}
|
||||
|
||||
[env:RAK_4631_13302_repeater]
|
||||
extends = rak4631_13302
|
||||
build_flags =
|
||||
${rak4631_13302.build_flags}
|
||||
-D DISPLAY_CLASS=SSD1306Display
|
||||
-D ADVERT_NAME='"RAK4631 1W Repeater"'
|
||||
-D ADVERT_LAT=0.0
|
||||
-D ADVERT_LON=0.0
|
||||
-D ADMIN_PASSWORD='"password"'
|
||||
-D MAX_NEIGHBOURS=50
|
||||
;-D MESH_PACKET_LOGGING=1
|
||||
;-D MESH_DEBUG=1
|
||||
build_src_filter = ${rak4631_13302.build_src_filter}
|
||||
+<helpers/ui/SSD1306Display.cpp>
|
||||
+<../examples/simple_repeater>
|
||||
|
||||
[env:RAK_4631_13302_room_server]
|
||||
extends = rak4631_13302
|
||||
build_flags =
|
||||
${rak4631_13302.build_flags}
|
||||
-D DISPLAY_CLASS=SSD1306Display
|
||||
-D ADVERT_NAME='"Test Room"'
|
||||
-D ADVERT_LAT=0.0
|
||||
-D ADVERT_LON=0.0
|
||||
-D ADMIN_PASSWORD='"password"'
|
||||
-D ROOM_PASSWORD='"hello"'
|
||||
;-D MESH_PACKET_LOGGING=1
|
||||
;-D MESH_DEBUG=1
|
||||
build_src_filter = ${rak4631_13302.build_src_filter}
|
||||
+<helpers/ui/SSD1306Display.cpp>
|
||||
+<../examples/simple_room_server>
|
||||
|
||||
[env:RAK_4631_13302_companion_radio_usb]
|
||||
extends = rak4631_13302
|
||||
board_build.ldscript = boards/nrf52840_s140_v6_extrafs.ld
|
||||
board_upload.maximum_size = 712704
|
||||
build_flags =
|
||||
${rak4631_13302.build_flags}
|
||||
-I examples/companion_radio/ui-new
|
||||
-D PIN_USER_BTN_ANA=31
|
||||
-D DISPLAY_CLASS=SSD1306Display
|
||||
-D MAX_CONTACTS=350
|
||||
-D MAX_GROUP_CHANNELS=40
|
||||
-D ENABLE_USB_INTERFACE
|
||||
; NOTE: DO NOT ENABLE --> -D MESH_PACKET_LOGGING=1
|
||||
; NOTE: DO NOT ENABLE --> -D MESH_DEBUG=1
|
||||
build_src_filter = ${rak4631_13302.build_src_filter}
|
||||
+<../examples/companion_radio/*.cpp>
|
||||
+<../examples/companion_radio/ui-new/*.cpp>
|
||||
lib_deps =
|
||||
${rak4631_13302.lib_deps}
|
||||
densaugeo/base64 @ ~1.4.0
|
||||
|
||||
[env:RAK_4631_13302_companion_radio_ble]
|
||||
extends = rak4631_13302
|
||||
board_build.ldscript = boards/nrf52840_s140_v6_extrafs.ld
|
||||
board_upload.maximum_size = 712704
|
||||
build_flags =
|
||||
${rak4631_13302.build_flags}
|
||||
-I examples/companion_radio/ui-new
|
||||
-D PIN_USER_BTN_ANA=31
|
||||
-D DISPLAY_CLASS=SSD1306Display
|
||||
-D MAX_CONTACTS=350
|
||||
-D MAX_GROUP_CHANNELS=40
|
||||
-D BLE_PIN_CODE=123456
|
||||
-D BLE_DEBUG_LOGGING=1
|
||||
-D OFFLINE_QUEUE_SIZE=256
|
||||
;-D MESH_PACKET_LOGGING=1
|
||||
;-D MESH_DEBUG=1
|
||||
build_src_filter = ${rak4631_13302.build_src_filter}
|
||||
+<helpers/nrf52/SerialBLEInterface.cpp>
|
||||
+<../examples/companion_radio/*.cpp>
|
||||
+<../examples/companion_radio/ui-new/*.cpp>
|
||||
lib_deps =
|
||||
${rak4631_13302.lib_deps}
|
||||
densaugeo/base64 @ ~1.4.0
|
||||
|
||||
[env:RAK_4631_13302_terminal_chat]
|
||||
extends = rak4631_13302
|
||||
build_flags =
|
||||
${rak4631_13302.build_flags}
|
||||
-D MAX_CONTACTS=100
|
||||
-D MAX_GROUP_CHANNELS=1
|
||||
;-D MESH_PACKET_LOGGING=1
|
||||
;-D MESH_DEBUG=1
|
||||
build_src_filter = ${rak4631_13302.build_src_filter}
|
||||
+<../examples/simple_secure_chat/main.cpp>
|
||||
lib_deps =
|
||||
${rak4631_13302.lib_deps}
|
||||
densaugeo/base64 @ ~1.4.0
|
||||
|
||||
[env:RAK_4631_13302_sensor]
|
||||
extends = rak4631_13302
|
||||
build_flags =
|
||||
${rak4631_13302.build_flags}
|
||||
-D DISPLAY_CLASS=SSD1306Display
|
||||
-D ADVERT_NAME='"RAK4631 Sensor"'
|
||||
-D ADVERT_LAT=0.0
|
||||
-D ADVERT_LON=0.0
|
||||
-D ADMIN_PASSWORD='"password"'
|
||||
;-D MESH_PACKET_LOGGING=1
|
||||
;-D MESH_DEBUG=1
|
||||
build_src_filter = ${rak4631_13302.build_src_filter}
|
||||
+<helpers/ui/SSD1306Display.cpp>
|
||||
+<../examples/simple_sensor>
|
||||
|
||||
[env:RAK_4631_13302_kiss_modem]
|
||||
extends = rak4631_13302
|
||||
build_src_filter = ${rak4631_13302.build_src_filter}
|
||||
+<../examples/kiss_modem/>
|
||||
Reference in new issue
Block a user