espressif / esp-idf

Espressif IoT Development Framework. Official development framework for Espressif SoCs.
Apache License 2.0
13.58k stars 7.27k forks source link

FatFS corruption in SDK 5.2.1 [bug] (IDFGH-12465) #13480

Open filzek opened 6 months ago

filzek commented 6 months ago

Answers checklist.

General issue report

Using SDK release v5.2.1, the FatFS with Wearleaveling when concurrence happen in ISR, GPTIMER, Console or UART exchange information and File Read/Write the partition get full corrupted, we will also open a ticket for it.

haberturdeur commented 6 months ago

Hi, thank you for the report. Does this happen consistently or is it just sometimes? Could there have been a power fluctuation (it is known to cause FS corruption)? If it's somewhat consistent, could you provide an example that demonstrates the problem?

filzek commented 6 months ago

If you create 2 GPTIMER with this priority gptimer_config_t timer_config_us_up = { .clk_src = GPTIMER_CLK_SRC_DEFAULT, .direction = GPTIMER_COUNT_UP, .resolution_hz = 1 1000 1000, // 1MHz, 1 tick = 1us .intr_priority = 1, .flags.intr_shared = false, };

and this being tirggered even in IRAM with saving to flash and using a SPIRAM memory this will create a panic (boot reason 5) and corrupting the flash.

we arent able to solve it yet.

filzek commented 6 months ago

Hi, thank you for the report. Does this happen consistently or is it just sometimes? Could there have been a power fluctuation (it is known to cause FS corruption)? If it's somewhat consistent, could you provide an example that demonstrates the problem?

We can recreate all the time the bug, we are tracking it right now, the panic is o hard that the debug doesnt even show anything, just crash and reboot.

adokitkat commented 6 months ago

Hi. Could you please share a zip file with the folder of your project which can be build to reproduce the issue? Please also set log level to verbose in the menuconfig and share the output here as well. Thank you.

AxelLin commented 5 months ago

@filzek Any update for the issue and any feedback for the comment https://github.com/espressif/esp-idf/issues/13480#issuecomment-2056609036 ?

filzek commented 5 months ago

Hi. Could you please share a zip file with the folder of your project which can be build to reproduce the issue? Please also set log level to verbose in the menuconfig and share the output here as well. Thank you.

Sure, I understand. We're currently focused on ensuring that SDK version 5.2.1 operates flawlessly. We're close to completing all necessary adjustments and fixes. Once we're done, we will prepare and share a split version of the firmware code, which includes the fatfs corruption issue, for your review. Thank you for your patience and understanding.

filzek commented 5 months ago

@AxelLin we thing we can do it in about 10 days so far.

AxelLin commented 4 months ago

@AxelLin we thing we can do it in about 10 days so far.

@filzek Do you still hit this issue?

filzek commented 4 months ago

@AxelLin we thing we can do it in about 10 days so far.

@filzek Do you still hit this issue?

In sdk 5.2.2 we are testing now, issue have almost solved but still happen on 5.2.1, now we are testing again with forcing ble, wifi, udp, and all channes requests with massive gpio isrs acting over while saving small data and large data, lets see if it survives