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

Expose unload_partitions to allow for dynamic updates (IDFGH-11498) #12625

Closed
angelnu opened this issue Nov 19, 2023 · 4 comments
Closed

Expose unload_partitions to allow for dynamic updates (IDFGH-11498) #12625

angelnu opened this issue Nov 19, 2023 · 4 comments
Assignees
Labels
Resolution: NA Issue resolution is unavailable Status: Done Issue is done internally Type: Feature Request Feature request for IDF

Comments

@angelnu
Copy link

angelnu commented Nov 19, 2023

Is your feature request related to a problem?

I wrote an extension of the OTA component for esphome. There I am able to update the partition table OTA.

In order to allow the new partitions to be used without reboot I had to call esp-idf unload_partitions. I have done this by adding my own definition as currently this function is not public.

I need to avoid the reboot since I also need to update the app partition in the same session - this allows changes in partition table sizes and migrations from different firmwares. More info in the PR.

Describe the solution you'd like.

Move

to https://github.com/espressif/esp-idf/blob/c8243465e45489835d645bf217a6929fd0c01b7f/components/esp_partition/include/esp_partition.h

Describe alternatives you've considered.

Rebooting after updating the partition table but this does not work when updating the app partition addresses/sizes

Additional context.

Happy to provide a PR

@angelnu angelnu added the Type: Feature Request Feature request for IDF label Nov 19, 2023
@espressif-bot espressif-bot added the Status: Opened Issue is new label Nov 19, 2023
@github-actions github-actions bot changed the title Expose unload_partitions to allow for dynamic updates Expose unload_partitions to allow for dynamic updates (IDFGH-11498) Nov 19, 2023
@espressif-bot espressif-bot added Status: Selected for Development Issue is selected for development Status: Reviewing Issue is being reviewed Status: Done Issue is done internally Resolution: NA Issue resolution is unavailable and removed Status: Opened Issue is new Status: Selected for Development Issue is selected for development Status: Reviewing Issue is being reviewed labels Nov 20, 2023
@adokitkat
Copy link
Collaborator

Hi, it should now be available in esp_partition.h. The function name changed to esp_partition_unload_all().

@angelnu
Copy link
Author

angelnu commented Nov 27, 2023

Many thanks @adokitkat - I will switch to use the new name once this commit gets into an official release of the ESP-IDF.

Currently I have

#if ESP_IDF_VERSION >= ESP_IDF_VERSION_VAL(5, 1, 0)
// private function in partition.c to unload partitions and free space allocated by them
extern "C" void unload_partitions(void);
#endif

@adokitkat
Copy link
Collaborator

It will be available in the v5.3 version. I can try to backport it to v5.1 and v5.2 as well.

@angelnu
Copy link
Author

angelnu commented Nov 27, 2023

If you could backport @adokitkat it would be really useful!
The arduino-esp32 is based on v5.1 so it is needed to fully remove the current extern declaration.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Resolution: NA Issue resolution is unavailable Status: Done Issue is done internally Type: Feature Request Feature request for IDF
Projects
None yet
Development

No branches or pull requests

3 participants