Skip to content

Commit 7085cc7

Browse files
committed
Merge branch 'bugfix/fix_bootloader_failed_read_image_data' into 'master'
fix(spi_flash): Fix bootloader failed to read image data See merge request sdk/ESP8266_RTOS_SDK!1665
2 parents 971db98 + 92ac9ee commit 7085cc7

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

components/spi_flash/src/spi_flash_raw.c

+10
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,9 @@ uint32_t spi_flash_get_id_raw(esp_rom_spiflash_chip_t *chip)
3939
{
4040
uint32_t rdid = 0;
4141

42+
#ifndef BOOTLOADER_BUILD
4243
Cache_Read_Disable();
44+
#endif
4345

4446
Wait_SPI_Idle(chip);
4547

@@ -49,7 +51,9 @@ uint32_t spi_flash_get_id_raw(esp_rom_spiflash_chip_t *chip)
4951

5052
rdid = READ_PERI_REG(PERIPHS_SPI_FLASH_C0)&0xffffff;
5153

54+
#ifndef BOOTLOADER_BUILD
5255
Cache_Read_Enable_New();
56+
#endif
5357

5458
return rdid;
5559
}
@@ -150,8 +154,11 @@ bool spi_user_cmd_raw(esp_rom_spiflash_chip_t *chip, spi_cmd_dir_t mode, spi_cmd
150154
{
151155
int idx = 0;
152156

157+
#ifndef BOOTLOADER_BUILD
153158
// Cache Disable
154159
Cache_Read_Disable_2();
160+
#endif
161+
155162
//wait spi idle
156163
if((mode & SPI_RAW) == 0) {
157164
Wait_SPI_Idle(chip);
@@ -272,8 +279,11 @@ bool spi_user_cmd_raw(esp_rom_spiflash_chip_t *chip, spi_cmd_dir_t mode, spi_cmd
272279
if((mode & SPI_RAW) == 0) {
273280
Wait_SPI_Idle(chip);
274281
}
282+
283+
#ifndef BOOTLOADER_BUILD
275284
//enable icache
276285
Cache_Read_Enable_2();
286+
#endif
277287

278288
return true;
279289
}

0 commit comments

Comments
 (0)