Files
MeshCore/variants/rak3401/platformio.ini
T
mikecarper a60a6a1f60 Merge PowerSaving-v17 and harden noise calibration and RX recovery
Port the measured RXPS model without changing Cascade wire preambles or automatically enabling experimental levels. Use a spaced weighted median with bounded calibration windows, preserve packet ownership across CAD, and check actual SX126x receive mode before recovery.

Preserve Cascade sleep and radio fixes, integrate the new sensor and board profiles, and correct BSEC script inheritance and the MKE UART pin conflict. Native regressions, production-method/SPI harnesses, and ESP32, nRF52, and STM32 builds pass. Hardware comparison and fault-injection validation are recorded privately.
2026-09-10 13:19:22 -07:00

222 lines
7.4 KiB
INI

[rak3401]
extends = nrf52_base
board = rak3401
board_check = true
board_build.ldscript = boards/nrf52840_s140_v6.ld
extra_scripts = ${nrf52_base.extra_scripts}
post:variants/rak3401/fix_bsec_lib.py
build_flags = ${nrf52_base.build_flags}
${sensor_base.build_flags}
-I variants/rak3401
-D RAK_3401
-D RAK_BOARD
-D RECOVERABLE_EXTERNAL_RADIO
; RAK13300/RAK13302 BUSY and DIO1 use nRF52840 P0.09/P0.10. A full
; chip erase restores those pads to NFC mode, so SystemInit must repair
; UICR and reset once before the external SX1262 can be reached.
-D CONFIG_NFCT_PINS_AS_GPIOS
-D NRF52_POWER_MANAGEMENT
-D RADIO_CLASS=CustomSX1262
-D WRAPPER_CLASS=CustomSX1262Wrapper
-D LORA_TX_POWER=22
-D SX126X_CURRENT_LIMIT=140
-D SX126X_RX_BOOSTED_GAIN=1
-D SX126X_REGISTER_PATCH=1 ; Patch register 0x8B5 for improved RX with SKY66122 FEM
-D FORCE_GPS_ALIVE ; WB_IO2 controls the shared 3V3_S rail; stop_gps() must not drop it.
-D PIN_GPS_EN=-1 ; -1 = no dedicated GPS enable pin (power is the shared 3V3_S rail), same as rak4631
-UENV_INCLUDE_BME680
-D ENV_INCLUDE_BME680_BSEC=1
build_src_filter = ${nrf52_base.build_src_filter}
+<../variants/rak3401>
+<helpers/sensors>
+<helpers/ui/SSD1306Display.cpp>
+<helpers/ui/MomentaryButton.cpp>
lib_deps =
${nrf52_base.lib_deps}
${sensor_base.lib_deps}
adafruit/Adafruit SSD1306 @ ^2.5.13
sparkfun/SparkFun u-blox GNSS Arduino Library@^2.2.27
boschsensortec/BSEC Software Library @ ^1.8.1492
[env:RAK_3401_repeater]
extends = rak3401
extra_scripts = ${nrf52_lora_ota.extra_scripts}
post:variants/rak3401/fix_bsec_lib.py
build_flags =
${rak3401.build_flags}
-UENABLE_OTA
-D DISABLE_LORA_OTA=1 ; Full external-sensor build exceeds the in-place OTA ceiling
-D DISPLAY_CLASS=SSD1306Display
-D ADVERT_NAME='"RAK3401 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 = ${rak3401.build_src_filter}
+<helpers/ota/*.cpp>
+<helpers/ui/SSD1306Display.cpp>
+<../examples/simple_repeater>
; Explicit lean alternative to the full-sensor, non-OTA repeater above. It removes optional
; environmental telemetry sensors while retaining the common INA I2C voltage/current monitors,
; board display/RTC support, and both RAK12500 I2C and RAK12501 UART GPS paths. Use sensor slot A:
; slot D conflicts with the RAK13302 radio's BUSY/DIO1 wiring.
; RAK12500 and the configured INA3221 both use I2C address 0x42, so they cannot be installed
; together at those addresses. Keep GPS at 0x42, strap INA3221 A0 to SCL for 0x43, and build
; with -DTELEM_INA3221_ADDRESS=0x43 when both modules are required.
; The legacy target name remains stable for OTA compatibility.
[env:RAK_3401_repeater_lora_ota_no_external_sensors]
extends = rak3401
extra_scripts = ${nrf52_lora_ota.extra_scripts}
post:variants/rak3401/fix_bsec_lib.py
build_flags =
${rak3401.build_flags}
${nrf52_reduced_sensors_keep_ina_gps.build_flags}
-D DISPLAY_CLASS=SSD1306Display
-D ADVERT_NAME='"RAK3401 1W Repeater"'
-D ADVERT_LAT=0.0
-D ADVERT_LON=0.0
-D ADMIN_PASSWORD='"password"'
-D MAX_NEIGHBOURS=50
-D ENABLE_OTA=1
-D OTA_FLASH_STORE=1
-D OTA_FOLDER_SERIAL
-D OTA_TARGET_NAME_TABLE=0 ; IDs remain authoritative; omit the 540-entry display-name table
-D OTA_LOCAL_TARGET_ID=0x2fa509c1
-D OTA_LOCAL_TARGET_NAME='"RAK_3401_repeater_lora_ota_no_external_sensors"'
-D OTA_FETCH_PIPELINE=4 ; adaptive one-packet flights grow 1 -> 2 -> 3 -> 4 on a clean link
build_src_filter = ${rak3401.build_src_filter}
+<helpers/ota/*.cpp>
+<helpers/ui/SSD1306Display.cpp>
+<../examples/simple_repeater>
lib_deps =
${nrf52_lora_ota.lib_deps}
${nrf52_reduced_sensors_keep_ina_gps.lib_deps}
adafruit/Adafruit SSD1306 @ ^2.5.13
sparkfun/SparkFun u-blox GNSS Arduino Library@^2.2.27
; Full-sensor/GPS repeater with RAK13302 1 W radio and an exact 2 MiB Winbond
; W25Q16JV breakout. The flash shares SCK/MOSI/MISO with the RAK13302 but uses
; its own CS on J11 AIN1. The QSPI store temporarily releases and restores SPI1
; while holding the radio NSS high. GPS remains supported in sensor slot A.
[env:RAK_3401_repeater_rak13302_w25q16_lora_ota]
extends = rak3401
extra_scripts = ${nrf52_lora_ota.extra_scripts}
post:variants/rak3401/fix_bsec_lib.py
build_flags =
${rak3401.build_flags}
${nrf52_wisblock_w25q16_ota.build_flags}
-D OTA_QSPI_RAK3401_RADIO_BUS_HANDOFF=1
-D MOTA_HW_ID='"RAK3401_RAK13302_W25Q16"'
-D DISPLAY_CLASS=SSD1306Display
-D ADVERT_NAME='"RAK3401 1W + W25Q16 OTA"'
-D ADVERT_LAT=0.0
-D ADVERT_LON=0.0
-D ADMIN_PASSWORD='"password"'
-D MAX_NEIGHBOURS=50
-D ENABLE_OTA=1
-D OTA_FOLDER_SERIAL
-D OTA_FETCH_PIPELINE=4
build_src_filter = ${rak3401.build_src_filter}
+<helpers/ota/*.cpp>
+<helpers/ui/SSD1306Display.cpp>
+<../examples/simple_repeater>
[env:RAK_3401_room_server]
extends = rak3401
build_flags =
${rak3401.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 = ${rak3401.build_src_filter}
+<helpers/ui/SSD1306Display.cpp>
+<../examples/simple_room_server>
[env:RAK_3401_companion_radio_usb]
extends = rak3401
board_build.ldscript = boards/nrf52840_s140_v6_extrafs.ld
board_upload.maximum_size = 712704
build_flags =
${rak3401.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 = ${rak3401.build_src_filter}
+<../examples/companion_radio/*.cpp>
+<../examples/companion_radio/ui-new/*.cpp>
lib_deps =
${rak3401.lib_deps}
densaugeo/base64 @ ~1.4.0
[env:RAK_3401_companion_radio_ble]
extends = rak3401
board_build.ldscript = boards/nrf52840_s140_v6_extrafs.ld
board_upload.maximum_size = 712704
build_flags =
${rak3401.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 = ${rak3401.build_src_filter}
+<helpers/nrf52/SerialBLEInterface.cpp>
+<../examples/companion_radio/*.cpp>
+<../examples/companion_radio/ui-new/*.cpp>
lib_deps =
${rak3401.lib_deps}
densaugeo/base64 @ ~1.4.0
[env:RAK_3401_terminal_chat]
extends = rak3401
build_flags =
${rak3401.build_flags}
-D MAX_CONTACTS=100
-D MAX_GROUP_CHANNELS=1
;-D MESH_PACKET_LOGGING=1
;-D MESH_DEBUG=1
build_src_filter = ${rak3401.build_src_filter}
+<../examples/simple_secure_chat/main.cpp>
lib_deps =
${rak3401.lib_deps}
densaugeo/base64 @ ~1.4.0
[env:RAK_3401_sensor]
extends = rak3401
build_flags =
${rak3401.build_flags}
-D DISPLAY_CLASS=SSD1306Display
-D ADVERT_NAME='"RAK3401 Sensor"'
-D ADVERT_LAT=0.0
-D ADVERT_LON=0.0
-D ADMIN_PASSWORD='"password"'
-D USER_GPIO_CONTROL=1
;-D MESH_PACKET_LOGGING=1
;-D MESH_DEBUG=1
build_src_filter = ${rak3401.build_src_filter}
+<helpers/ui/SSD1306Display.cpp>
+<../examples/simple_sensor>
[env:RAK_3401_kiss_modem]
extends = rak3401
build_src_filter = ${rak3401.build_src_filter}
+<../examples/kiss_modem/>