Fix H5 OTA rollback

This commit is contained in:
robert committed 2026-06-16 10:56:36 +03:00
1 parent 52b9de4189
commit d1ea094067
5 files changed
+18 -10

No files matched your search

+4 -2
View File
@@ -12048,9 +12048,11 @@ bool mg_ota_write(const void *buf, size_t len) {
}
bool mg_ota_end(void) {
mg_ota_flash_end(&s_mg_flash_stm32h5);
return false;
if (!mg_ota_flash_end(&s_mg_flash_stm32h5)) return false;
*(volatile uint32_t *) 0xe000ed0c = 0x5fa0004U; // NVIC_SystemReset()
return true;
}
struct mg_flash *mg_flash = &s_mg_flash_stm32h5;
#endif