esp_partition_erase_range freeze

daniSi
Posts: 47
Joined: Thu Dec 23, 2021 9:43 am

esp_partition_erase_range freeze

Postby daniSi » Tue Nov 22, 2022 7:48 pm

Hi,

we have experienced some strange behaviour when using the

Code: Select all

 esp_err_t esp_partition_erase_range(const esp_partition_t* partition, size_t offset, size_t size);
function.

The function was used already previously where the result was as expected. The problems started after enabling the flash encryption.

1. Code same as before causes that the MCU freezes and not even a WDT cause a reset. All other tasks are as well blocked.
2. Experimentally we have putted before the call of the function a 100ms delay. After this when calling the function the WDT causes a reset.
3. Experimentally we have increased the delay to 1000ms. After this when calling the function the result is as expected.

We use esp-idf 4.4.2 and the partition size is 3MB.

Any ideas what could cause this?

Danijel

chegewara
Posts: 2371
Joined: Wed Jun 14, 2017 9:00 pm

Re: esp_partition_erase_range freeze

Postby chegewara » Wed Nov 23, 2022 5:56 pm

I would suggest to not erase whole partition at once, just do it in chunks.

daniSi
Posts: 47
Joined: Thu Dec 23, 2021 9:43 am

Re: esp_partition_erase_range freeze

Postby daniSi » Wed Nov 23, 2022 9:35 pm

I forgot to mention this, but we have try it as well. Experimentally we have discovered that at least a 150ms delay before the function is still fine, if its less then this, strange behaviour occurs.

wilkxt
Posts: 15
Joined: Sun Mar 06, 2016 7:46 pm

Re: esp_partition_erase_range freeze

Postby wilkxt » Mon Jan 09, 2023 11:08 am

Hi
I have the same problem in IDF 5.0. TaskDelay(150) doesn't help. Do you resolve this problem?
best regards, Tom

wilkxt
Posts: 15
Joined: Sun Mar 06, 2016 7:46 pm

Re: esp_partition_erase_range freeze

Postby wilkxt » Tue Jan 10, 2023 6:11 am

In the function before using esp_partition_erase_range I had a hang (vTaskSuspend(xHandleMonitorTask)) of a task (not related to this task) and it was causing this problem. I don't know why, but as soon as I turned off suspending the task, the freezing problem disappeared. It's possible it's a bug in the IDF.
best regards, Tom

Who is online

Users browsing this forum: Bing [Bot], Google [Bot] and 144 guests