mirror of
https://github.com/espressif/esp-idf.git
synced 2024-10-05 20:47:46 -04:00
Merge branch 'bugfix/esp_flash_write_temp_buffer_lifetime' into 'master'
esp_flash: fix write issue using buffer on stack out of lifetime See merge request espressif/esp-idf!9932
This commit is contained in:
commit
37e3f20252
@ -631,14 +631,14 @@ esp_err_t IRAM_ATTR esp_flash_write(esp_flash_t *chip, const void *buffer, uint3
|
||||
do {
|
||||
uint32_t write_len;
|
||||
const void *write_buf;
|
||||
uint32_t temp_buf[8];
|
||||
if (direct_write) {
|
||||
write_len = MIN(length, MAX_WRITE_CHUNK);
|
||||
write_buf = buffer;
|
||||
} else {
|
||||
uint32_t buf[8];
|
||||
write_len = MIN(length, sizeof(buf));
|
||||
memcpy(buf, buffer, write_len);
|
||||
write_buf = buf;
|
||||
write_len = MIN(length, sizeof(temp_buf));
|
||||
memcpy(temp_buf, buffer, write_len);
|
||||
write_buf = temp_buf;
|
||||
}
|
||||
|
||||
err = rom_spiflash_api_funcs->start(chip);
|
||||
|
Loading…
Reference in New Issue
Block a user