From 7208ce348c9f2f361b77d1d3d7437d4798c234e5 Mon Sep 17 00:00:00 2001 From: GlassOnTin Date: Thu, 2 Apr 2026 10:49:33 +0100 Subject: [PATCH] Add BHI260 init retry, revert BMM150 firmware (no magnetometer on PCB) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The T-Watch Ultra does not have a BMM150 magnetometer — the BHI260AP aux I2C pins are tied to VDD1V8 (confirmed from schematic). The BOSCH_BHI260_AUX_BMM150_GPIO firmware fails to init because there is no BMM150 to discover. Reverted to BOSCH_BHI260_GPIO. Added 10s retry interval for BHI260 init failures instead of single-attempt with no recovery. --- RNode_Firmware.ino | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/RNode_Firmware.ino b/RNode_Firmware.ino index c804d6a..e847151 100644 --- a/RNode_Firmware.ino +++ b/RNode_Firmware.ino @@ -2221,9 +2221,13 @@ void loop() { // Deferred BHI260AP init — runs once after boot is complete // Firmware upload takes ~10s and blocks, so we do it after radio is up #if BOARD_MODEL == BOARD_TWATCH_ULT - if (!bhi260_ready && bhi260 == NULL && millis() > 5000) { + static uint32_t bhi260_next_try = 5000; + if (!bhi260_ready && millis() > bhi260_next_try) { + bhi260_next_try = millis() + 10000; // retry every 10s + if (bhi260 == NULL) { + bhi260 = new SensorBHI260AP(); + } Wire.setClock(1000000UL); - bhi260 = new SensorBHI260AP(); bhi260->setPins(-1); bhi260->setFirmware(bosch_firmware_image, bosch_firmware_size, false); bhi260->setBootFromFlash(false);