-
-
Notifications
You must be signed in to change notification settings - Fork 346
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
ESP32, IDF 5.0: error with nvs_flash_init #2653
Comments
Just for my understanding: Is the Basic_Blink application working for you? |
Ahm, Basic_Blink is working, Basic_Wifi is not working. So for simple test you can execute the nvs_flash_init in the Basic_Blink and it freezes also. |
I've traced it through to the |
I've attempted to load the partition table as early as possible by calling A temporary fix is to run |
Yes, that works for the moment. |
I've diffed the sdkconfig from IDF and Sming. --- idf.sdkconfig 2023-07-25 11:25:11.701113817 +0200
+++ sming.sdkconfig 2023-07-25 11:29:56.472197308 +0200
@@ -16,4 +15,0 @@
-CONFIG_APPTRACE_DEST_NONE=y
-CONFIG_APPTRACE_DEST_UART_NONE=y
-CONFIG_APPTRACE_LOCK_ENABLE=y
-CONFIG_APPTRACE_UART_TASK_PRIO=1
@@ -37,2 +33,2 @@
-CONFIG_COMPILER_OPTIMIZATION_DEFAULT=y
-CONFIG_COMPILER_OPTIMIZATION_LEVEL_DEBUG=y
+CONFIG_COMPILER_OPTIMIZATION_LEVEL_RELEASE=y
+CONFIG_COMPILER_OPTIMIZATION_SIZE=y
@@ -46,2 +41,0 @@
-CONFIG_ESP32_APPTRACE_DEST_NONE=y
-CONFIG_ESP32_APPTRACE_LOCK_ENABLE=y
@@ -115 +108,0 @@
-CONFIG_ESP_HTTP_CLIENT_ENABLE_HTTPS=y
@@ -136,3 +128,0 @@
-CONFIG_ESP_PROTOCOMM_SUPPORT_SECURITY_VERSION_0=y
-CONFIG_ESP_PROTOCOMM_SUPPORT_SECURITY_VERSION_1=y
-CONFIG_ESP_PROTOCOMM_SUPPORT_SECURITY_VERSION_2=y
@@ -152 +142 @@
-CONFIG_ESP_SYSTEM_EVENT_TASK_STACK_SIZE=2304
+CONFIG_ESP_SYSTEM_EVENT_TASK_STACK_SIZE=16384
@@ -165 +154,0 @@
-CONFIG_ESP_TLS_USING_MBEDTLS=y
@@ -181,19 +169,0 @@
-CONFIG_ETH_DMA_BUFFER_SIZE=512
-CONFIG_ETH_DMA_RX_BUFFER_NUM=10
-CONFIG_ETH_DMA_TX_BUFFER_NUM=10
-CONFIG_ETH_ENABLED=y
-CONFIG_ETH_PHY_INTERFACE_RMII=y
-CONFIG_ETH_RMII_CLK_IN_GPIO=0
-CONFIG_ETH_RMII_CLK_INPUT=y
-CONFIG_ETH_USE_ESP32_EMAC=y
-CONFIG_ETH_USE_SPI_ETHERNET=y
-CONFIG_FATFS_AUTO_TYPE=y
-CONFIG_FATFS_CODEPAGE=437
-CONFIG_FATFS_CODEPAGE_437=y
-CONFIG_FATFS_FS_LOCK=0
-CONFIG_FATFS_LFN_NONE=y
-CONFIG_FATFS_PER_FILE_CACHE=y
-CONFIG_FATFS_SECTOR_4096=y
-CONFIG_FATFS_SECTORS_PER_CLUSTER_1=y
-CONFIG_FATFS_TIMEOUT_MS=10000
-CONFIG_FATFS_VOLUME_COUNT=2
@@ -207,0 +178 @@
+CONFIG_FREERTOS_GENERATE_RUN_TIME_STATS=y
@@ -214,0 +186 @@
+CONFIG_FREERTOS_RUN_TIME_STATS_USING_ESP_TIMER=y
@@ -217 +188,0 @@
-CONFIG_FREERTOS_TASK_FUNCTION_WRAPPER=y
@@ -222,0 +194,4 @@
+CONFIG_FREERTOS_USE_STATS_FORMATTING_FUNCTIONS=y
+CONFIG_FREERTOS_USE_TRACE_FACILITY=y
+CONFIG_FREERTOS_VTASKLIST_INCLUDE_COREID=y
+CONFIG_FREERTOS_WATCHPOINT_END_OF_STACK=y
@@ -228,4 +202,0 @@
-CONFIG_HTTPD_ERR_RESP_NO_DELAY=y
-CONFIG_HTTPD_MAX_REQ_HDR_LEN=512
-CONFIG_HTTPD_MAX_URI_LEN=512
-CONFIG_HTTPD_PURGE_BUF_LEN=32
@@ -242 +212,0 @@
-CONFIG_LCD_PANEL_IO_FORMAT_BUF_SIZE=32
@@ -293 +263 @@
-CONFIG_LWIP_TCPIP_TASK_STACK_SIZE=3072
+CONFIG_LWIP_TCPIP_TASK_STACK_SIZE=8192
@@ -311,3 +280,0 @@
-CONFIG_MBEDTLS_CERTIFICATE_BUNDLE_DEFAULT_FULL=y
-CONFIG_MBEDTLS_CERTIFICATE_BUNDLE_MAX_CERTS=200
-CONFIG_MBEDTLS_CERTIFICATE_BUNDLE=y
@@ -365,4 +331,0 @@
-CONFIG_MQTT_PROTOCOL_311=y
-CONFIG_MQTT_TRANSPORT_SSL=y
-CONFIG_MQTT_TRANSPORT_WEBSOCKET_SECURE=y
-CONFIG_MQTT_TRANSPORT_WEBSOCKET=y
@@ -375 +338 @@
-CONFIG_OPTIMIZATION_LEVEL_DEBUG=y
+CONFIG_OPTIMIZATION_LEVEL_RELEASE=y
@@ -393 +355,0 @@
-CONFIG_SEMIHOSTFS_MAX_MOUNT_POINTS=1
@@ -573,11 +534,0 @@
-CONFIG_SPIFFS_CACHE_WR=y
-CONFIG_SPIFFS_CACHE=y
-CONFIG_SPIFFS_GC_MAX_RUNS=10
-CONFIG_SPIFFS_MAX_PARTITIONS=3
-CONFIG_SPIFFS_META_LENGTH=4
-CONFIG_SPIFFS_OBJ_NAME_LEN=32
-CONFIG_SPIFFS_PAGE_CHECK=y
-CONFIG_SPIFFS_PAGE_SIZE=256
-CONFIG_SPIFFS_USE_MAGIC_LENGTH=y
-CONFIG_SPIFFS_USE_MAGIC=y
-CONFIG_SPIFFS_USE_MTIME=y
@@ -597,0 +549 @@
+CONFIG_SPI_MASTER_IN_IRAM=y
@@ -601,2 +552,0 @@
-CONFIG_SUPPORT_TERMIOS=y
-CONFIG_SUPPRESS_SELECT_DEBUG_OUTPUT=y
@@ -604 +554 @@
-CONFIG_SYSTEM_EVENT_TASK_STACK_SIZE=2304
+CONFIG_SYSTEM_EVENT_TASK_STACK_SIZE=16384
@@ -611 +561 @@
-CONFIG_TCPIP_TASK_STACK_SIZE=3072
+CONFIG_TCPIP_TASK_STACK_SIZE=8192
@@ -631,14 +580,0 @@
-CONFIG_UNITY_ENABLE_DOUBLE=y
-CONFIG_UNITY_ENABLE_FLOAT=y
-CONFIG_UNITY_ENABLE_IDF_TEST_RUNNER=y
-CONFIG_VFS_SEMIHOSTFS_MAX_MOUNT_POINTS=1
-CONFIG_VFS_SUPPORT_DIR=y
-CONFIG_VFS_SUPPORT_IO=y
-CONFIG_VFS_SUPPORT_SELECT=y
-CONFIG_VFS_SUPPORT_TERMIOS=y
-CONFIG_VFS_SUPPRESS_SELECT_DEBUG_OUTPUT=y
-CONFIG_WIFI_PROV_AUTOSTOP_TIMEOUT=30
-CONFIG_WIFI_PROV_SCAN_MAX_ENTRIES=16
-CONFIG_WIFI_PROV_STA_ALL_CHANNEL_SCAN=y
-CONFIG_WL_SECTOR_SIZE=4096
-CONFIG_WL_SECTOR_SIZE_4096=y
@@ -647,2 +582,0 @@
-CONFIG_WS_BUFFER_SIZE=1024
-CONFIG_WS_TRANSPORT=y Edit: I removed the WDT Initialization from |
I don't know but at the moment I have no clue.
The Sming sample bootloader output:
So there is the spi_flash output missing. |
Ok, that was also not the problem. Its only caused because the message is enclosed in |
I've tried hard on setting sdkconfig switches, but nothing helped. It looks like there are some compiler switches missing or any other thing. I'm totally lost at the moment. |
Do you need both CPUs? If not, stick to unicore for now. |
Getting rid of FreeRTOS entirely would be ideal, but the WiFi stack is closed-source and has some embedded dependencies on RTOS operation. Consipiracy edit: Strategy by Espressif to ensure they have a closed-source BLOB which gets them full control if required. |
Other samples reset the ESP32 too. Those using WiFi. |
Afaik. the problem is located in the SPI flash access. I currently had no chance to test against IDF 4.4, I think it is caused by IDF 5. |
I've updated sming IDF 4.4 to latest Espressif release (date 3/1/24) and can confirm that the above issue is still present, however the same fix applies and Basic_Ssl sample is working. To update existing IDF installation manually:
|
I have an issue with initialization of Wifi, I used a clean machine and try to deploy the Basic_Wifi sample. The ESP freezes at boot and the WDT is resetting the chip.
commands:
output of WDT and addresses
In the end I drilled it down to the function
nvs_flash_init
.I used the Basic_Blink sample and added the function and it freezes.
The crazy thing is, if I use the
nvs_rw_value
example of the installed IDF it is working.commands:
The text was updated successfully, but these errors were encountered: