Fix wifi init crash: add missing NVS (and phy_init) partitions to partition table; make wifi/web startup non-fatal; enable Boya flash driver

This commit is contained in:
2026-09-09 22:15:09 +02:00
parent 96d14c0538
commit 686b8d1f6f
4 changed files with 28 additions and 7 deletions

View File

@@ -29,10 +29,22 @@ void app_main(void)
ESP_LOGW(TAG, "RFID unavailable (%s) - continuing without card scanning", esp_err_to_name(ret));
}
ESP_ERROR_CHECK(wifi_manager_init());
ESP_ERROR_CHECK(wifi_manager_start());
ESP_ERROR_CHECK(scryfall_client_start());
ESP_ERROR_CHECK(web_server_start());
/* Networking is not fatal either: without it the device runs offline
* (cached cards + AP pairing). Init failures are logged, boot continues. */
ret = wifi_manager_init();
if (ret != ESP_OK) {
ESP_LOGW(TAG, "wifi init failed (%s) - continuing offline", esp_err_to_name(ret));
} else {
if (wifi_manager_start() != ESP_OK) {
ESP_LOGW(TAG, "wifi start failed - continuing offline");
}
if (scryfall_client_start() != ESP_OK) {
ESP_LOGW(TAG, "scryfall client start failed");
}
}
if (web_server_start() != ESP_OK) {
ESP_LOGW(TAG, "web server start failed - continuing without AP");
}
ESP_ERROR_CHECK(ui_task_start());

View File

@@ -1,4 +1,10 @@
# Name, Type, SubType, Offset, Size
# 2MB factory (app) partition + 1.5MB LittleFS data partition on 4MB flash
# 4MB ESP32 flash layout:
# nvs 24KB 0x9000 - NVS settings (required by esp_wifi / http / storage)
# phy_init 4KB 0xF000 - PHY init data (optional reserved)
# factory 2MB app - firmware
# storage ~1.9MB littlefs - card database (/spiffs)
nvs, data, nvs, 0x9000, 0x6000
phy_init, data, phy, 0xf000, 0x1000
factory, app, factory, 0x10000, 0x200000
storage, data, littlefs, 0x210000, 0x1F0000
1 # Name, Type, SubType, Offset, Size
2 # 2MB factory (app) partition + 1.5MB LittleFS data partition on 4MB flash # 4MB ESP32 flash layout:
3 # nvs 24KB 0x9000 - NVS settings (required by esp_wifi / http / storage)
4 # phy_init 4KB 0xF000 - PHY init data (optional reserved)
5 # factory 2MB app - firmware
6 # storage ~1.9MB littlefs - card database (/spiffs)
7 nvs, data, nvs, 0x9000, 0x6000
8 phy_init, data, phy, 0xf000, 0x1000
9 factory, app, factory, 0x10000, 0x200000
10 storage, data, littlefs, 0x210000, 0x1F0000

View File

@@ -1938,7 +1938,7 @@ CONFIG_SPI_FLASH_SUPPORT_ISSI_CHIP=y
CONFIG_SPI_FLASH_SUPPORT_MXIC_CHIP=y
CONFIG_SPI_FLASH_SUPPORT_GD_CHIP=y
CONFIG_SPI_FLASH_SUPPORT_WINBOND_CHIP=y
# CONFIG_SPI_FLASH_SUPPORT_BOYA_CHIP is not set
CONFIG_SPI_FLASH_SUPPORT_BOYA_CHIP=y
# CONFIG_SPI_FLASH_SUPPORT_TH_CHIP is not set
# end of Auto-detect flash chips

View File

@@ -12,3 +12,6 @@ CONFIG_JD_USE_ROM=n
CONFIG_JD_SZBUF=512
CONFIG_JD_FORMAT_RGB565=y
CONFIG_JD_FASTDECODE_32BIT=y
# Some ESP32 boards ship a Boya flash chip; use the optimized driver
CONFIG_SPI_FLASH_SUPPORT_BOYA_CHIP=y