arch/arm/stm32: fix undeclared page variable in flash write#18295
Closed
adwait-godbole wants to merge 8 commits intoapache:masterfrom
Closed
arch/arm/stm32: fix undeclared page variable in flash write#18295adwait-godbole wants to merge 8 commits intoapache:masterfrom
adwait-godbole wants to merge 8 commits intoapache:masterfrom
Conversation
Fix a compilation error in stm32f10xxf30xx_flash.c where the variable `page` is used without being declared in up_progmem_write(). The issue appears when STM32_FLASH_DUAL_BANK is enabled. The page index is now derived from the write address using up_progmem_getpage() and used for bank selection. Signed-off-by: Adwait Godbole <adwaitngodbole@gmail.com>
acassis
previously approved these changes
Jan 31, 2026
Add empty line after `}` Signed-off-by: Bowen Wang <wangbowen6@xiaomi.com>
Replace all goto statements with structured control flow using while loops and conditional blocks. Consolidate early returns into a single error-handling path for better code structure and MISRA HIS standards compliance. Signed-off-by: hujun5 <hujun5@xiaomi.com>
Extract the core waitid logic into a separate waittcb() helper function to reduce the cyclomatic complexity of the main waitid() function. This improves code maintainability, reduces nested conditions, and enhances code clarity while preserving all functionality. Signed-off-by: hujun5 <hujun5@xiaomi.com>
Fix a compilation error in stm32f10xxf30xx_flash.c where the variable `page` is used without being declared in up_progmem_write(). The issue appears when STM32_FLASH_DUAL_BANK is enabled. The page index is now derived from the write address using up_progmem_getpage() and used for bank selection. Signed-off-by: Adwait Godbole <adwaitngodbole@gmail.com>
…t-godbole/nuttx into arch/stm32-fix-dualbank-flash-page
…t-godbole/nuttx into arch/stm32-fix-dualbank-flash-page
Contributor
|
@adwait-godbole I missed a detail during the view: the generic flash code cannot depend on PROGMEM. Progmem is a featured used when you want to have write access to internal flash of the microcontroller |
Contributor
Author
@acassis I've re-opened the PR here. I will address your request over there. Thanks. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR fixes a compilation error in
stm32f10xxf30xx_flash.cwhere the variablepagewas used without being declared in up_progmem_write().The issue is configuration-dependent and occurs when STM32_FLASH_DUAL_BANK is enabled.
The fix derives the page index from the write address using up_progmem_getpage() and uses it for flash bank selection.
Fixes #18172