Skip to content

Commit

Permalink
cpu/esp_common: Set write size for flash implementation
Browse files Browse the repository at this point in the history
  • Loading branch information
chrysn committed May 17, 2022
1 parent 38d0ec5 commit b458d52
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions cpu/esp_common/periph/flash.c
Original file line number Diff line number Diff line change
Expand Up @@ -127,6 +127,7 @@ void spi_flash_drive_init (void)
_flash_driver.write_page = &_flash_write_page;
_flash_driver.erase = &_flash_erase;
_flash_driver.power = &_flash_power;
_flash_driver.flags = MTD_DRIVER_FLAG_CLEARING_OVERWRITE;

/* first, set the beginning of flash to 0x0 to read partition table */
_flash_beg = 0x0;
Expand Down Expand Up @@ -200,6 +201,9 @@ void spi_flash_drive_init (void)

_flash_dev.pages_per_sector = _flashchip->sector_size / _flashchip->page_size;
_flash_dev.page_size = _flashchip->page_size;
/* Emulation for smaller / unaligned writes is present, but at reduced
* performance */
_flash_dev.write_size = 4;

DEBUG("%s flashchip chip_size=%d block_size=%d sector_size=%d page_size=%d\n", __func__,
_flashchip->chip_size, _flashchip->block_size,
Expand Down

0 comments on commit b458d52

Please sign in to comment.