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

Implemented esp_core_dump_image_erase() (IDFGH-4832) #6631

Closed
wants to merge 2 commits into from

Conversation

0xFEEDC0DE64
Copy link
Contributor

Implemented esp_core_dump_image_erase() and esp_core_dump_image_get() now returns ESP_ERR_NOT_FOUND when partition is blank/erased.

esp_core_dump_image_erase() calls esp_partition_erase_range() and additionally writes size 0xFFFFFFFF to avoid problems when flash encryption is enabled. Without explicitly writing 0xFFFFFFFF for size, esp_core_dump_image_get() will read a garbage size when the erased bytes are being decrypted.

With size 0xFFFFFFFF esp_core_dump_image_get() now returns ESP_ERR_NOT_FOUND instead of ESP_ERR_INVALID_SIZE

I needed to know if an error happened during reading the coredump or if it has simply been not found / been invalid or erased (because never crashed or coredump has been transmitted already successfully)

… now returns ESP_ERR_NOT_FOUND when partition is blank
@github-actions github-actions bot changed the title Implemented esp_core_dump_image_erase() Implemented esp_core_dump_image_erase() (IDFGH-4832) Feb 28, 2021
@Alvin1Zhang
Copy link
Collaborator

Thanks for your contribution.

Copy link
Collaborator

@o-marshmallow o-marshmallow left a comment

Choose a reason for hiding this comment

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

Thank you for your contribution!
I added few comments, mostly details, please feel free to give me your opinion on them.

*
* @return ESP_OK on success, otherwise \see esp_err_t
*/
esp_err_t esp_core_dump_image_erase();
Copy link
Collaborator

Choose a reason for hiding this comment

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

Please, can you explicitly put void in the parenthesis to forbid passing arguments to the function?

components/espcoredump/src/core_dump_flash.c Outdated Show resolved Hide resolved
components/espcoredump/src/core_dump_flash.c Outdated Show resolved Hide resolved
@0xFEEDC0DE64
Copy link
Contributor Author

anything I can do for this PR?

@o-marshmallow
Copy link
Collaborator

Hello @0xFEEDC0DE64 ,

Sorry for the delay (again), your PR has been accepted and is currently passing internal reviews. Once merged, it will be synced to Github after passing the internal tests.

@espressif-bot espressif-bot added Resolution: Done Issue is done internally Status: Done Issue is done internally labels May 18, 2021
projectgus pushed a commit that referenced this pull request Jun 30, 2021
…mage_get() now returns ESP_ERR_NOT_FOUND when partition is blank

Closes #6631
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Resolution: Done Issue is done internally Status: Done Issue is done internally
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants