Hi,
we are calling the
esp_ota_write(esp_ota_handle_t handle, const void *data, size_t size)
function with a buffer size of 1 byte, because we are receiving the firmware byte per byte.
Is it ok to do so, or will this lead to a faster wear of the flash, because only one byte is writte at one time?
Thanks,
Mike
Is it ok to call esp_ota_write() with buffer size of 1 byte?
Re: Is it ok to call esp_ota_write() with buffer size of 1 byte?
Hi,
It will wear level flash faster for sure, because low level API is working with 4kB flash sectors (read/write).
It is much better to have temporary buffer which will be flashed after filling with 4kB of data or even with 1kB of data.
It will wear level flash faster for sure, because low level API is working with 4kB flash sectors (read/write).
It is much better to have temporary buffer which will be flashed after filling with 4kB of data or even with 1kB of data.
-
- Posts: 9043
- Joined: Thu Nov 26, 2015 4:08 am
Re: Is it ok to call esp_ota_write() with buffer size of 1 byte?
I disagree on the extra wear: generally flash *erases* is the thing that makes flash wear out, not flash *writes*. +1 on the temp buffer, but it may be that the OTA routines already have a buffer like that internally.
EDIT: Looked it up, ota has a buffer of 16 bytes. I don't think there's anything technically wrong with calling esp_ota_write every byte, but it is likely to be a lot faster if you feed it a big buffer instead.
Who is online
Users browsing this forum: Majestic-12 [Bot] and 111 guests