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 2019/01/16 15:11:16 UTC

[GitHub] utzig commented on a change in pull request #1600: Only erase FLASH_BANK_2 when available

utzig commented on a change in pull request #1600: Only erase FLASH_BANK_2 when available
URL: https://github.com/apache/mynewt-core/pull/1600#discussion_r248319483
 
 

 ##########
 File path: hw/mcu/stm/stm32l4xx/src/hal_flash.c
 ##########
 @@ -38,9 +38,12 @@ stm32_mcu_flash_erase_sector(const struct hal_flash *dev, uint32_t sector_addres
         eraseinit.TypeErase = FLASH_TYPEERASE_PAGES;
         if ((sector_address - dev->hf_base_addr) < (_FLASH_SIZE / 2)) {
 
 Review comment:
   Is it still OK to test against `_FLASH_SIZE / 2` when there's only a single bank? Won't this stop the second half of the flash from being erased? I think maybe it would be better to make `eraseinit.Banks = FLASH_BANK_1;` before the test and then test if we're in the 2nd half and change the value to `FLASH_BANK_2` (inside the #ifdef). What do you think?

----------------------------------------------------------------
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