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

Fix HTTPUpdate flash size check and add SPIFFS size check #2161

Merged
merged 4 commits into from
Dec 6, 2018
Merged

Fix HTTPUpdate flash size check and add SPIFFS size check #2161

merged 4 commits into from
Dec 6, 2018

Conversation

Jeroen88
Copy link
Contributor

@Jeroen88 Jeroen88 commented Dec 5, 2018

HTTPUpdate checked if the new sketch would fit into the current partition free space, which was wrong. Now it checks if it fits into the next flash partition.

A size check for a SPIFFS update is added, this was stil 'to do' from the previous PR.

Still to do: the SHA256 hash could be checked if a server sends it in the request header.

This PR includes PR #2155.

@@ -366,6 +379,10 @@ bool HTTPUpdate::runUpdate(Stream& in, uint32_t size, String md5, int command)
}
}

// To do: the SHA256 could be checked if the server sends it

delay(0);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Removing...

} else {
if(len > (int) ESP.getFreeSketchSpace()) {
log_e("FreeSketchSpace to low (%d) needed: %d\n", ESP.getFreeSketchSpace(), len);
const esp_partition_t* _partition = esp_ota_get_next_update_partition(NULL);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

please move this logic to Esp.cpp and replace the one in ESP.getFreeSketchSpace. What is currently there makes no sense for any use.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Moving to ESP.cpp, replacing getFreeSketchSpace() with new code, in HTTUpdate.cpp calling getFreeSketchSpace() again.

@me-no-dev me-no-dev merged commit 884e417 into espressif:master Dec 6, 2018
@me-no-dev
Copy link
Member

Nice :) thanks!

@Jeroen88
Copy link
Contributor Author

Jeroen88 commented Dec 6, 2018

You're welcome! :)

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

Successfully merging this pull request may close these issues.

None yet

2 participants