Summary Files Commits Branches @commit @diff @stats
diff options
context:
space:
mode:
Commit06e659dec139aa0d08d5fff433e9ffdec0a736b5 (patch)
Author
 Syndamia <kamen@syndamia.com>
2024-05-27 12:51:00 +0300
Committer
 Syndamia <kamen@syndamia.com>
2024-05-27 12:51:00 +0300
Files64fad6dbd0e9416d3c008f697a6db752d28b00fa
uni-projects-06e659dec139aa0d08d5fff433e9ffdec0a736b5.tar
uni-projects-06e659dec139aa0d08d5fff433e9ffdec0a736b5.tar.gz
uni-projects-06e659dec139aa0d08d5fff433e9ffdec0a736b5.zip
Parent589689911fb58f1582c702869dcd303ed26b3b24 (diff)
[iot/goam] Increased init_camera task size, which fixes nvs::HashList::find crash
2 files changed, 4 insertions, 6 deletions
-rw-r--r--Year 3/Internet of things/goam/main/main.c5
-rw-r--r--Year 3/Internet of things/goam/main/wifi.c5
diff --git a/Year 3/Internet of things/goam/main/main.c b/Year 3/Internet of things/goam/main/main.c
index ec5f06b..6d8d4f8 100644
--- a/Year 3/Internet of things/goam/main/main.c
+++ b/Year 3/Internet of things/goam/main/main.c
@@ -105,7 +105,9 @@ void app_main(void)
nvs_init(); // A whole lotta stuff depend on this
// Minor performance improvement, since we always have to wait 2.5 seconds
- xTaskCreate(init_camera, "init_camera", 1024, NULL, 10, NULL);
+ // Must be 2048 size, otherwise we get a LoadStoreError from nvs::HashList::find,
+ // when another task tries to work with NVS
+ xTaskCreate(init_camera, "init_camera", 2048, NULL, 10, NULL);
// These inits are really fast, it doesnt make a difference if
// they're in a task or not
@@ -126,6 +128,7 @@ void app_main(void)
xTaskNotifyWait(0, 0, &notification, 50 / portTICK_PERIOD_MS);
}
+
while (true) {
xTaskNotifyWait(ULONG_MAX, 0, &notification, 5000 / portTICK_PERIOD_MS);
}
diff --git a/Year 3/Internet of things/goam/main/wifi.c b/Year 3/Internet of things/goam/main/wifi.c
index 24a6ba5..316d668 100644
--- a/Year 3/Internet of things/goam/main/wifi.c
+++ b/Year 3/Internet of things/goam/main/wifi.c
@@ -170,11 +170,6 @@ void wifi_init() {
netif_init();
wifi_init_config_t cfg = WIFI_INIT_CONFIG_DEFAULT();
- // It seems that ptc06 also uses nvs, and since both are in different tasks during init, we get a crash,
- // which I think is caused by both trying to access/modify nvs at the "same" time
- // I couldn't figure out a good/proper mechanism for interlocking, since I don't entirely know when and why
- // both access nvs, but this will do
- cfg.nvs_enable = false;
ESP_ERROR_CHECK(esp_wifi_init(&cfg));
wifi_init_events();