Skip to content

Commit 00e0ca0

Browse files
committed
Merge branch 'bugfix/flash_read_align' into 'master'
fix: read flash align See merge request sdk/ESP8266_RTOS_SDK!369
2 parents da436b5 + 7de09ac commit 00e0ca0

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

components/bootloader_support/src/bootloader_flash.c

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -264,6 +264,10 @@ esp_err_t bootloader_flash_erase_sector(size_t sector)
264264
#include "esp_err.h"
265265
#include "esp_log.h"
266266

267+
#ifndef BOOTLOADER_BUILD
268+
#include "esp_spi_flash.h"
269+
#endif
270+
267271
extern void Cache_Read_Disable();
268272
extern void Cache_Read_Enable(uint8_t map, uint8_t p, uint8_t v);
269273

@@ -313,7 +317,11 @@ void bootloader_munmap(const void *mapping)
313317

314318
static esp_err_t bootloader_flash_read_no_decrypt(size_t src_addr, void *dest, size_t size)
315319
{
320+
#ifdef BOOTLOADER_BUILD
316321
SPIRead(src_addr, dest, size);
322+
#else
323+
spi_flash_read(src_addr, dest, size);
324+
#endif
317325

318326
return ESP_OK;
319327
}

0 commit comments

Comments
 (0)