Add MeshTower V2 SD-backed LoRa OTA

This commit is contained in:
mikecarper committed 2026-08-03 12:49:36 -07:00
1 parent 9b8c68d926
commit 4ed3307c6c
24 files changed
+833 -37

No files matched your search

+10 -1
View File
@@ -70,7 +70,12 @@ bool ota_self_firmware(SelfFwInfo& out) {
const uint32_t app_base = mota_nrf52_app_base();
if (!mota_nrf52_layout_valid(app_base)) { out = SelfFwInfo(); return false; }
const uint8_t* region = (const uint8_t*)(uintptr_t)app_base;
uint32_t region_len = MOTA_NRF52_FS_START - app_base;
uint32_t region_len =
#if defined(OTA_SD_STORE)
MOTA_NRF52_APP_END - app_base;
#else
MOTA_NRF52_FS_START - app_base;
#endif
return find_self_firmware(region, region_len, out, /*verify_body=*/true);
}
#else
@@ -89,7 +94,11 @@ bool ota_self_read(uint32_t off, uint8_t* buf, uint32_t len) {
#elif defined(NRF52_PLATFORM)
bool ota_self_read(uint32_t off, uint8_t* buf, uint32_t len) {
const uint32_t app_base = mota_nrf52_app_base();
#if defined(OTA_SD_STORE)
if (app_base >= MOTA_NRF52_APP_END || (uint64_t)app_base + off + len > MOTA_NRF52_APP_END) return false;
#else
if (!mota_nrf52_layout_valid(app_base) || (uint64_t)app_base + off + len > MOTA_NRF52_FS_START) return false;
#endif
memcpy(buf, (const uint8_t*)(uintptr_t)(app_base + off), len);
return true;
}