mirror of
https://github.com/espressif/esptool.git
synced 2025-10-18 18:01:15 +08:00
fix(flasher_stub): Correct boundaries for SPIWrite4B and SPIRead4B
SPIWrite4B and SPIRead4B functions are required for flash sizes bigger than 16MB. This fix corrects the boundaries so SPIWrite and SPIRead would be used for the whole 16MB area. The octal flash support for 32 MB chips (https://github.com/espressif/esptool/issues/795) will be added in a follow-up commit. Closes https://github.com/espressif/esptool/issues/745
This commit is contained in:
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@@ -119,7 +119,7 @@ void handle_flash_read(uint32_t addr, uint32_t len, uint32_t block_size,
|
||||
uint32_t n = len - num_sent;
|
||||
if (n > block_size) n = block_size;
|
||||
#if defined(ESP32S3)
|
||||
if (addr + len > 0x00ffffff)
|
||||
if (addr + n > 0x01000000)
|
||||
res = SPIRead4B(1, SPI_FLASH_FASTRD_MODE, addr, buf, n);
|
||||
else
|
||||
res = SPIRead(addr, (uint32_t *)buf, n);
|
||||
@@ -158,7 +158,7 @@ int handle_flash_get_md5sum(uint32_t addr, uint32_t len) {
|
||||
n = FLASH_SECTOR_SIZE;
|
||||
}
|
||||
#if defined(ESP32S3)
|
||||
if (addr + len > 0x00ffffff)
|
||||
if (addr + n > 0x01000000)
|
||||
res = SPIRead4B(1, SPI_FLASH_FASTRD_MODE, addr, buf, n);
|
||||
else
|
||||
res = SPIRead(addr, (uint32_t *)buf, n);
|
||||
|
@@ -320,7 +320,7 @@ void handle_flash_data(void *data_buf, uint32_t length) {
|
||||
|
||||
/* do the actual write */
|
||||
#if defined(ESP32S3)
|
||||
if (fs.next_write + length > 0x00ffffff)
|
||||
if (fs.next_write + length > 0x01000000)
|
||||
res = SPIWrite4B(1, SPI_FLASH_FASTRD_MODE, fs.next_write, data_buf, length);
|
||||
else
|
||||
res = SPIWrite(fs.next_write, data_buf, length);
|
||||
|
Reference in New Issue
Block a user