You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@nuttx.apache.org by GitBox <gi...@apache.org> on 2020/02/27 13:17:05 UTC
[GitHub] [incubator-nuttx] davids5 commented on a change in pull request
#391: arch/arm/src/stm32/stm32f20xxf40xx_flash.c: Add progmen flash block
mapping.
davids5 commented on a change in pull request #391: arch/arm/src/stm32/stm32f20xxf40xx_flash.c: Add progmen flash block mapping.
URL: https://github.com/apache/incubator-nuttx/pull/391#discussion_r385117465
##########
File path: arch/arm/src/stm32/stm32f20xxf40xx_flash.c
##########
@@ -226,83 +279,65 @@ int stm32_flash_writeprotect(size_t page, bool enabled)
up_waste();
}
- /* Relock options */
+ /* Re-lock options */
modifyreg32(STM32_FLASH_OPTCR, 0, FLASH_OPTCR_OPTLOCK);
return 0;
}
size_t up_progmem_pagesize(size_t page)
{
- static const size_t page_sizes[STM32_FLASH_NPAGES] = STM32_FLASH_SIZES;
-
- if (page >= sizeof(page_sizes) / sizeof(*page_sizes))
- {
- return 0;
- }
- else
- {
- return page_sizes[page];
- }
+ return PAGESIZE;
Review comment:
This will not work on the F4 the page (sector) size is not constant.
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to 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