mirror of https://github.com/meshcore-dev/MeshCore
Browse Source
On nRF52 BLE companion builds, a failed external-flash init left BLE completely dead: the node never advertised on the Elecrow ThinkNode M6 on any firmware version, even though the same unit runs fine over LoRa and pairs over BLE under other firmware. Root cause: when nrfx_qspi_init() fails (the M6 returns NRFX_ERROR_TIMEOUT / 0xBAD0007 during QSPI activation), it has already enabled the QSPI peripheral and enabled QSPI_IRQn in the NVIC at priority 0 (reserved for the SoftDevice), and it does not clean any of that up before returning. The very next step, the SoftDevice enable in Bluefruit.begin(), then fails (returns false) and every later BLE call reports NRF_ERROR_SOFTDEVICE_NOT_ENABLED, so the node never advertises. USB companion builds are unaffected because they never enable the SoftDevice. Fix: on the QSPIFlash.begin() failure path, disable QSPI_IRQn and power the QSPI peripheral back down before continuing. This only runs on the failure path, so boards whose QSPI init succeeds are unaffected, and BLE now comes up cleanly even when the external flash is absent or fails to initialize. Validated on a ThinkNode M6: with the QSPI init still timing out, the SoftDevice now enables, the node advertises, and the MeshCore app pairs and exchanges frames.pull/2828/head
1 changed files with 12 additions and 0 deletions
Loading…
Reference in new issue