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

ESP32 partition schema and apps support #654

Closed
bettio opened this issue Jul 1, 2023 · 1 comment · Fixed by #657
Closed

ESP32 partition schema and apps support #654

bettio opened this issue Jul 1, 2023 · 1 comment · Fixed by #657
Labels
Milestone

Comments

@bettio
Copy link
Collaborator

bettio commented Jul 1, 2023

The following partitioning schema is used and supported:

# Name,   Type, SubType, Offset,  Size, Flags
# Note: if you change the phy_init or app partition offset, make sure to change the offset in Kconfig.projbuild
nvs,      data, nvs,       0x9000,     0x6000,
phy_init, data, phy,       0xf000,     0x1000,
factory,  app,  factory,  0x10000,   0x1C0000,
lib.avm,  data, phy,     0x1D0000,    0x40000,
main.avm, data, phy,     0x210000,   0x100000

The schema should be evolved in order to support more advanced scenarios, such as application updates, and etc...

The following boot sequence should be supported:

  1. boot into kernel application
  2. decided whether boot app1 or app2
  3. open the partition and run the StartupModule:start()

The kernel application might be packed together with the rest of the libraries in order to reduce the partition count, however at the moment booting into lib.avm is not supported.

Also the simplest possible scenario should be supported anyway (that is libraries and just one app packed together).

So the following changes are proposed:

When there is a kernel.avm partition, the kernel.avm partition is always booted.

# Name,   Type, SubType, Offset,  Size, Flags
# Note: if you change the phy_init or app partition offset, make sure to change the offset in Kconfig.projbuild
nvs,      data, nvs,       0x9000,     0x6000,
phy_init, data, phy,       0xf000,     0x1000,
factory,  app,  factory,  0x10000,   0x1C0000,
kernel.avm,  data, phy,     0x1D0000,    0x40000,
app1.avm, data, phy,     0x210000,   0x100000
app2.avm, [...]

The following is still supported:

# Name,   Type, SubType, Offset,  Size, Flags
# Note: if you change the phy_init or app partition offset, make sure to change the offset in Kconfig.projbuild
nvs,      data, nvs,       0x9000,     0x6000,
phy_init, data, phy,       0xf000,     0x1000,
factory,  app,  factory,  0x10000,   0x1C0000,
main.avm,  data, phy,     0x1D0000,    0x40000,
[...]

Question: do we want to keep support also for a lib.avm + main.avm scenario, or in general do we want to still support a lib.avm partition?
Right now it costs about 15 lines of code, so it doesn't add too much complexity.
I suppose that we might also support lib, kernel, app1 and app2 partitions with ho additional code for free, we just open lib.avm partition regardless of anything else.

@bettio bettio added the platform:esp32 ESP32 platform specific label Jul 1, 2023
@bettio bettio added this to the v0.6 milestone Jul 1, 2023
@bettio
Copy link
Collaborator Author

bettio commented Jul 1, 2023

Other additional schema that we might support: kernel.avm + main.avm (just a single app with kernel app that boots into it).

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

Successfully merging a pull request may close this issue.

1 participant