You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@mynewt.apache.org by GitBox <gi...@apache.org> on 2018/03/27 21:33:46 UTC

[GitHub] utzig closed pull request #964: Update to 2k sector size on stm32f3

utzig closed pull request #964: Update to 2k sector size on stm32f3
URL: https://github.com/apache/mynewt-core/pull/964
 
 
   

This is a PR merged from a forked repository.
As GitHub hides the original diff on merge, it is displayed below for
the sake of provenance:

As this is a foreign pull request (from a fork), the diff is supplied
below (as it won't show otherwise due to GitHub magic):

diff --git a/hw/mcu/stm/stm32f3xx/src/hal_flash.c b/hw/mcu/stm/stm32f3xx/src/hal_flash.c
index 84dc2b691..4c8c14464 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)) {


 

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services