Skip to content

Commit 12decd2

Browse files
committed
Use correct page address offset for SPI block erase
1 parent 68fedad commit 12decd2

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

firmware/programmer/spi_flash.c

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,6 @@
2020
#define CMD_READ_STATUS 0xD7
2121

2222
#define PAGE_ADDRESS_OFFSET 9
23-
#define BLOCK_ADDRESS_OFFSET 12
2423

2524
#define STATUS_READY (1<<7)
2625

@@ -264,7 +263,7 @@ static uint32_t spi_flash_read_spare_data(uint8_t *buf, uint32_t page,
264263

265264
static uint32_t spi_flash_erase_block(uint32_t page)
266265
{
267-
uint32_t addr = page << BLOCK_ADDRESS_OFFSET;
266+
uint32_t addr = page << PAGE_ADDRESS_OFFSET;
268267
spi_flash_select_chip();
269268

270269
spi_flash_send_byte(CMD_FLASH_BLOCK_ERASE);

0 commit comments

Comments
 (0)