SpiFlashOpResult SPIEraseChip(void);
/**
- * @brief Erase a 32KB block of flash
- * Uses SPI flash command 52h.
+ * @brief Erase a 64KB block of flash
+ * Uses SPI flash command D8H.
* Please do not call this function in SDK.
*
* @param uint32_t block_num : Which block to erase.
/**
* @brief Erase a sector of flash.
+ * Uses SPI flash command 20H.
* Please do not call this function in SDK.
*
* @param uint32_t sector_num : Which sector to erase.
* @brief Erase some sectors.
* Please do not call this function in SDK.
*
- * @note If calling this function, first set
- * g_rom_flashchip.block_size = 32768; or call SPIParamCfg()
- * with appropriate parameters. This is due to a ROM bug, the
- * block erase command in use is a 32KB erase but after reset
- * the block_size field is incorrectly set to 65536.
- *
* @param uint32_t start_addr : Start addr to erase, should be sector aligned.
*
* @param uint32_t area_len : Length to erase, should be sector aligned.
#define SPI_FLASH_PP_V 0x1\r
#define SPI_FLASH_PP_S 25\r
/* SPI_FLASH_SE : R/W ;bitpos:[24] ;default: 1'b0 ; */\r
-/*description: Sector erase enable(4KB). Sector erase operation will be triggered\r
+/*description: Sector erase enable. A 4KB sector is erased via SPI command 20H. Sector erase operation will be triggered\r
when the bit is set. The bit will be cleared once the operation done.1: enable 0: disable.*/\r
#define SPI_FLASH_SE (BIT(24))\r
#define SPI_FLASH_SE_M (BIT(24))\r
#define SPI_FLASH_SE_V 0x1\r
#define SPI_FLASH_SE_S 24\r
/* SPI_FLASH_BE : R/W ;bitpos:[23] ;default: 1'b0 ; */\r
-/*description: Block erase enable(32KB) . Block erase operation will be triggered\r
+/*description: Block erase enable. A 64KB block is erased via SPI command D8H. Block erase operation will be triggered\r
when the bit is set. The bit will be cleared once the operation done.1: enable 0: disable.*/\r
#define SPI_FLASH_BE (BIT(23))\r
#define SPI_FLASH_BE_M (BIT(23))\r
#include "cache_utils.h"
/* bytes erased by SPIEraseBlock() ROM function */
-#define BLOCK_ERASE_SIZE 32768
+#define BLOCK_ERASE_SIZE 65536
#if CONFIG_SPI_FLASH_ENABLE_COUNTERS
static const char* TAG = "spi_flash";