Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use flash size byte to determine the location of the init data for byte 107. #1827

Merged
merged 1 commit into from Mar 2, 2017

Conversation

devsaurus
Copy link
Member

Fixes #1826.

  • This PR is for the dev branch rather than for master.
  • This PR is compliant with the other contributing guidelines as well (if not, please describe why).
  • I have thoroughly tested my contribution.

The current method to determine the location of the init data sector for byte 107 assumes that it's at offset -4 from the end of the flash. This logic breaks in case the current workaround for >4MB modules is present where init data is not located at the end of flash.

Fix is to determine init data location with flash_rom_get_sec_num() which relies on the size header byte. Size byte is the single source pointing to the init data location in all cases since the SDK also uses this information to locate init data.
This method is expected to remain valid also for the upcoming support of >4MB flash by the SDK (tagging #1810 for regression testing).

Tested on a 16MB Mini Pro and a stock 4MB NodeMCU devkit.

@jmattsson jmattsson merged commit f565218 into nodemcu:dev Mar 2, 2017
@marcelstoer marcelstoer added this to the 2.0.0-follow-up milestone Mar 2, 2017
@devsaurus devsaurus deleted the adc_16mb branch March 2, 2017 20:01
eiselekd pushed a commit to eiselekd/nodemcu-firmware that referenced this pull request Jan 7, 2018
@vladzaets
Copy link

Looks like the bug is back in master.

@HHHartmann
Copy link
Member

Yes it is. See #2925

@TerryE
Copy link
Collaborator

TerryE commented Nov 17, 2019

@vladzaets, please use the open #2925 for any further comments.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

6 participants