diff --git a/main/main.c b/main/main.c index 8cc8513..c072e34 100644 --- a/main/main.c +++ b/main/main.c @@ -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()); diff --git a/partitions.csv b/partitions.csv index f5a9f91..d4aa813 100644 --- a/partitions.csv +++ b/partitions.csv @@ -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 \ No newline at end of file diff --git a/sdkconfig b/sdkconfig index 263a4ab..51d40e2 100644 --- a/sdkconfig +++ b/sdkconfig @@ -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 diff --git a/sdkconfig.defaults b/sdkconfig.defaults index b03d2a7..26238af 100644 --- a/sdkconfig.defaults +++ b/sdkconfig.defaults @@ -11,4 +11,7 @@ CONFIG_FREERTOS_SMP=y CONFIG_JD_USE_ROM=n CONFIG_JD_SZBUF=512 CONFIG_JD_FORMAT_RGB565=y -CONFIG_JD_FASTDECODE_32BIT=y \ No newline at end of file +CONFIG_JD_FASTDECODE_32BIT=y + +# Some ESP32 boards ship a Boya flash chip; use the optimized driver +CONFIG_SPI_FLASH_SUPPORT_BOYA_CHIP=y \ No newline at end of file