You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@mynewt.apache.org by ut...@apache.org on 2018/03/27 21:33:46 UTC
[mynewt-core] branch master updated: Update to 2k sector size on
stm32f3
This is an automated email from the ASF dual-hosted git repository.
utzig pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/mynewt-core.git
The following commit(s) were added to refs/heads/master by this push:
new e428732 Update to 2k sector size on stm32f3
e428732 is described below
commit e428732b11bbbcc1525c71f4cfcbd284a3097b60
Author: Fabio Utzig <ut...@apache.org>
AuthorDate: Tue Mar 27 16:54:19 2018 -0300
Update to 2k sector size on stm32f3
---
hw/mcu/stm/stm32f3xx/src/hal_flash.c | 5 ++---
1 file changed, 2 insertions(+), 3 deletions(-)
diff --git a/hw/mcu/stm/stm32f3xx/src/hal_flash.c b/hw/mcu/stm/stm32f3xx/src/hal_flash.c
index 84dc2b6..4c8c144 100644
--- a/hw/mcu/stm/stm32f3xx/src/hal_flash.c
+++ b/hw/mcu/stm/stm32f3xx/src/hal_flash.c
@@ -26,9 +26,8 @@
/*
* Flash is organized in FLASH_PAGE_SIZE blocks, which for the
* STM32F3 family is 2KB.
- * Split entire flash into 16KB sectors.
* */
-#define HAL_FLASH_SECTOR_SIZE (FLASH_PAGE_SIZE * 8)
+#define HAL_FLASH_SECTOR_SIZE FLASH_PAGE_SIZE
#define HAL_FLASH_SIZE ((*((uint16_t*)FLASH_SIZE_DATA_REGISTER)) * 1024U)
@@ -92,7 +91,7 @@ stm32f3_flash_erase_sector(const struct hal_flash *dev, uint32_t sector_address)
erase.TypeErase = FLASH_TYPEERASE_PAGES;
erase.PageAddress = sector_address;
- erase.NbPages = HAL_FLASH_SECTOR_SIZE / FLASH_PAGE_SIZE;
+ erase.NbPages = 1;
HAL_FLASH_Unlock();
if (HAL_OK == HAL_FLASHEx_Erase(&erase, &errorPage)) {
--
To stop receiving notification emails like this one, please contact
utzig@apache.org.