Repository navigation
Conversation
extflash_program() sized each write with min(len, QSPI_NOR_PAGE_SIZE), which is only correct when the address is page aligned. A page program command that starts mid-page wraps at the page boundary and overwrites the start of the same page. The limit now lives in stm32_qspi_nor_program() and stm32_xspi_nor_program(), the two functions every board's extflash_driver.cpp calls into, so the fix covers all nine copies at once. Fixes EdgeTX#7576
Don't split MEMORY_READY_MATCH_VALUE and MEMORY_READY_MASK_VALUE
This branch has not been deployed
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.
Fixes #7576
Summary of changes:
stm32_qspi_nor_program()andstm32_xspi_nor_program()now stop at the page boundary instead of handing the whole length to one page program command.I put the fix in the shared driver instead of in each board's
extflash_program(): nineextflash_driver.cppcopies call into these two functions (the issue lists five), and the lower layer is where the page size is known.The per-board loops still slice by length. That is harmless now, the lower layer re-slices on the page boundary.
How it was checked
Host harness: the patched function body compiled against a fake HAL that wraps like real NOR flash.
HAL_QSPI_Command()/HAL_QSPI_Transmit()are stubbed, and every page program command is checked foroffset + len > 256.Current master:
With this patch:
Both changed functions are STM32 HAL only, so this is as far as it goes without a radio. The normal update path writes page aligned from a sector start, so a hardware test would not show a difference either way.