mirror of
https://github.com/espressif/esp-idf.git
synced 2025-08-31 06:12:42 +00:00
fix(spi_flash): Fix spi_flash write fail on 26M C2(including OTA fail on this chip)
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* SPDX-FileCopyrightText: 2015-2022 Espressif Systems (Shanghai) CO LTD
|
||||
* SPDX-FileCopyrightText: 2015-2023 Espressif Systems (Shanghai) CO LTD
|
||||
*
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*/
|
||||
@@ -368,21 +368,12 @@ static inline void spimem_flash_ll_program_page(spi_mem_dev_t *dev, const void *
|
||||
* should be configured before this is called.
|
||||
*
|
||||
* @param dev Beginning address of the peripheral registers.
|
||||
* @param pe_ops Is page program/erase operation or not.
|
||||
*/
|
||||
static inline void spimem_flash_ll_user_start(spi_mem_dev_t *dev)
|
||||
static inline void spimem_flash_ll_user_start(spi_mem_dev_t *dev, bool pe_ops)
|
||||
{
|
||||
dev->cmd.usr = 1;
|
||||
}
|
||||
|
||||
/**
|
||||
* In user mode, it is set to indicate that program/erase operation will be triggered.
|
||||
* This function is combined with `spimem_flash_ll_user_start`. The pe_bit will be cleared automatically once the operation done.
|
||||
*
|
||||
* @param dev Beginning address of the peripheral registers.
|
||||
*/
|
||||
static inline void spimem_flash_ll_set_pe_bit(spi_mem_dev_t *dev)
|
||||
{
|
||||
dev->cmd.flash_pe = 1;
|
||||
uint32_t usr_pe = (pe_ops ? 0x60000 : 0x40000);
|
||||
dev->cmd.val |= usr_pe;
|
||||
}
|
||||
|
||||
/**
|
||||
|
Reference in New Issue
Block a user