[ESP32P4] Fix crashes on older ESP-HOSTED-MCU fw & detection 32M flash

This commit is contained in:
TD-er committed 2026-05-10 21:32:30 +02:00
1 parent f5bb6d95f0
commit 12435f3e8e
2 files changed
+10 -2

No files matched your search

+8
View File
@@ -504,6 +504,14 @@ bool wifiAPmodeActivelyUsed()
// AP not active or soon to be disabled in processDisableAPmode()
return false;
}
#ifdef BOARD_HAS_SDIO_ESP_HOSTED
if (GetHostedMCUFwVersion() < 0x010000) {
// Hosted fw is too old, function below is not yet implemented
// When calling that function the ESP32-P4 will crash.
return false;
}
#endif
return SOFTAP_STATION_COUNT != 0;
// FIXME TD-er: is effectively checking for AP active enough or must really check for connected clients to prevent automatic wifi
+2 -2
View File
@@ -140,8 +140,8 @@ uint32_t getFlashRealSizeInBytes() {
if (res == 0) {
#if defined(ESP32)
#ifdef ESP32P4
// TODO TD-er: Implement
res = 1 << 24;
const int32_t flash_cap_MB = getEmbeddedFlashSize();
res = flash_cap_MB << 20;
#else
res = (1 << ((getFlashChipId() >> 16) & 0xFF));
#endif