From c454dcba540dc8111b17df7497e512e384ae6790 Mon Sep 17 00:00:00 2001 From: TeTeHacko Date: Tue, 24 Nov 2026 19:43:09 +0100 Subject: [PATCH] Repeater, room server, sensor, companion: avoid nRF52840 SPIM3 Errata 195 idle current draw --- docs/power.md | 5 +++++ platformio.ini | 1 + 2 files changed, 6 insertions(+) diff --git a/docs/power.md b/docs/power.md index f0773f99..ea4da908 100644 --- a/docs/power.md +++ b/docs/power.md @@ -232,6 +232,11 @@ unnecessary idle draw that affect all nRF52 boards (not only SenseCAP Solar): before `Bluefruit.begin()`, which enables SoftDevice S140 (defaulting `NRF_POWER` to LDO). `NRF52BoardDCDC::onBootComplete()` now re-enables DC/DC via `sd_power_dcdc_mode_set(NRF_POWER_DCDC_ENABLE)` once SoftDevice is active. +- **Avoid `NRF_SPIM3` (Nordic Errata 195)**: `[nrf52_base]` now sets + `-D SPI_32MHZ_INTERFACE=1`, moving the primary `SPI` bus (used by SX1262 at + 2 MHz) from `NRF_SPIM3` to `NRF_SPIM2`. Adafruit `SPIClass::endTransaction()` + disables `SPIM3` without the Errata 195 workaround, leaving ~1.2-2 mA idle + draw after the first SPI transaction. ## Measuring this yourself — two traps diff --git a/platformio.ini b/platformio.ini index af3f8c2a..a779587d 100644 --- a/platformio.ini +++ b/platformio.ini @@ -142,6 +142,7 @@ build_flags = ${arduino_base.build_flags} -D EXTRAFS=1 -D FW_OTA_PUBKEY='"${ota.pubkey}"' -D USE_CC310_HW_CRYPTO=1 + -D SPI_32MHZ_INTERFACE=1 lib_deps = ${arduino_base.lib_deps} https://github.com/oltaco/CustomLFS#0.2.3