Skip to content

Commit

Permalink
drivers/flash: Select FLASH_DEVICE_REQUIRES_ERASE for Ambiq
Browse files Browse the repository at this point in the history
The Ambiq provides erase function, but the storage is actually
MRAM based and does not require erase.

Signed-off-by: Dominik Ermel <dominik.ermel@nordicsemi.no>
  • Loading branch information
de-nordic committed Feb 2, 2024
1 parent 72646b1 commit f2bcb1a
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 0 deletions.
1 change: 1 addition & 0 deletions drivers/flash/Kconfig.ambiq
Original file line number Diff line number Diff line change
Expand Up @@ -8,5 +8,6 @@ config FLASH_AMBIQ
select AMBIQ_HAL
select FLASH_HAS_PAGE_LAYOUT
select FLASH_HAS_DRIVER_ENABLED
select FLASH_DEVICE_NOT_REQUIRES_ERASE
help
Enables Ambiq flash driver on MRAM.
3 changes: 3 additions & 0 deletions drivers/flash/flash_ambiq.c
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,9 @@ static struct k_sem flash_ambiq_sem;
static const struct flash_parameters flash_ambiq_parameters = {
.write_block_size = FLASH_WRITE_BLOCK_SIZE,
.erase_value = FLASH_ERASE_BYTE,
.flags = {
.erase_required = false,
},
};

static bool flash_ambiq_valid_range(off_t offset, size_t len)
Expand Down

0 comments on commit f2bcb1a

Please sign in to comment.