Internal fastfs file gets corrupt some time after re-power.

snahmad75
Posts: 445
Joined: Wed Jan 24, 2018 6:32 pm

Re: Internal fastfs file gets corrupt some time after re-power.

Postby snahmad75 » Fri Apr 12, 2019 10:39 pm

jcsbanks wrote:
Fri Apr 12, 2019 10:16 pm
Internal flash writes during large partition updates from OTA, or sometimes even small files with FATFS can cause problems with the CAN driver and high resolution timer callbacks resulting in interrupt watchdog timeouts, so I've preferred to refactor my work to use a form of RAM disk where a map of strings vs byte vectors is stored in PSRAM rather than save extensively to FATFS at run time, and adding vTaskDelay to OTA updates code and am choosing to disable CAN completely during some operations and considering returning to a previous method I had of rebooting into the factory app to do OTA updates whilst doing nothing else with even soft realtime requirements on a busy CAN bus. Until I started writing to internal flash I had not appreciated how disruptive it can be to a running system's realtime responsiveness, where a busy CAN bus barely tickles the ESP32 normally. Not sure if related to your work, but from your previous posts it sounds like you are doing similar things with CAN bus, networks and file systems.

ESP32 performance is quite amazing in all respects for what it is and what you can achieve in a fast booting tiny system, but flash writes are the slowest and most intrusive thing by far that I need to do.

Is this your experience. I so have similar experience. during OTA update I stop process can messages. not stop can driver completely. I found writing to sd card is fine during OTA and during busy can bus. I can avoid internal fatfs operation during ota. I do nvs write and commit after ota ends.

I am also using hardware timer every 1ms to update leds. I do get some watch dog for my application task which do data processing send and receive by can driver.

Yes I am doing all these 3 things.

CAN bus, networks LWIP and file systems.

snahmad75
Posts: 445
Joined: Wed Jan 24, 2018 6:32 pm

Re: Internal fastfs file gets corrupt some time after re-power.

Postby snahmad75 » Sat Apr 13, 2019 3:16 pm

I found out interesting results.

After OTA complete/end

If I perform internal fatfs operation like check file exist and delete file. It fails.

Can you some check and verify please. I now move my internal fatfs operation before ota begin.

I still do NVS write and commit after ota end/complete. Is this dangerous. I think some time it fails.

Kindly reply asap. we need to release my firmware asap.

jcsbanks
Posts: 305
Joined: Tue Mar 28, 2017 8:03 pm

Re: Internal fastfs file gets corrupt some time after re-power.

Postby jcsbanks » Sat Apr 13, 2019 9:34 pm

My only comment is that I often do FATFS operations in between OTS completion and reset into the new OTS app.

snahmad75
Posts: 445
Joined: Wed Jan 24, 2018 6:32 pm

Re: Internal fastfs file gets corrupt some time after re-power.

Postby snahmad75 » Sat Apr 13, 2019 9:39 pm

jcsbanks wrote:
Sat Apr 13, 2019 9:34 pm
My only comment is that I often do FATFS operations in between OTS completion and reset into the new OTS app.
Thanks for sharing.

Who is online

Users browsing this forum: No registered users and 121 guests