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 related snippets #87432

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

marekmatej
Copy link

This PR provides snippets commonly needed when building targts with the Espressif SoCs.

  • PSRAM - full utilization
  • MCUboot - application type

@marekmatej marekmatej changed the title Improvement/snippets esp ESP32 related snippets Mar 20, 2025
@marekmatej marekmatej force-pushed the improvement/snippets_esp branch from b06cfca to f5ce19e Compare March 24, 2025 14:12
@marekmatej marekmatej marked this pull request as ready for review March 24, 2025 14:13
@@ -0,0 +1 @@
CONFIG_BOOTLOADER_MCUBOOT=y
Copy link
Collaborator

Choose a reason for hiding this comment

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

Why is this a snippet ?

Please explain why -DSNIPPET=esp-mcuboot is cleaner, better, easier than -DCONFIG_BOOTLOADER_MCUBOOT=y

Copy link
Author

Choose a reason for hiding this comment

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

Yeah, the idea here is to use them in combination. I'm using -DSNIPPET="mcuboot;spiram", which is much shorter compared to adding -DCONFIG_BOOTLOADER_MCUBOOT=y

Copy link
Author

Choose a reason for hiding this comment

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

Why is this a snippet ?

Please explain why -DSNIPPET=esp-mcuboot is cleaner, better, easier than -DCONFIG_BOOTLOADER_MCUBOOT=y

We often need to switch between no-bootloader (simpleboot) to MCUBoot. And this - yes very primitive - mcuboot snippet allows us to use snippets in a linear fashion:
west build -p -b <board> <sample> -DSNIPPER="mcuboot;spiram;..."

Copy link
Collaborator

Choose a reason for hiding this comment

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

If we want a snippet for enabling MCUBoot, then why is this an espressif specific snippet, and not just a MCUboot snippets which can do board/SoC specific stuff if that is needed ?

Copy link
Author

Choose a reason for hiding this comment

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

We are currently in the process of integrating the MCUboot Espressif Port into Zephyr, and it seems there will be additional configs involved

Copy link
Collaborator

Choose a reason for hiding this comment

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

then I prefer we wait with a MCUboot specific snippet until we have a better view of what such snippet will actually do, and whether such snippet should have esp in it's name, or be a generic mcuboot snippet which can have special handling for esp SoCs.

Copy link
Author

Choose a reason for hiding this comment

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

I agree with you, and have renamed the mcuboot snippet files and identifiers.

Marek Matej added 2 commits March 27, 2025 21:45
Enable the SPIRAM and allow rodata and code to be executed from it.

Signed-off-by: Marek Matej <marek.matej@espressif.com>
This will build the application so it can be loaded by the MCUboot.

Signed-off-by: Marek Matej <marek.matej@espressif.com>
@marekmatej marekmatej force-pushed the improvement/snippets_esp branch from f5ce19e to a9368a2 Compare March 27, 2025 20:52
@marekmatej
Copy link
Author

@tejlmand ptal. I like the mcuboot snippet because it's shorter and allows sharing the image features as a single string.

@tejlmand
Copy link
Collaborator

I like the mcuboot snippet because it's shorter and allows sharing the image features as a single string.

but following such approach to its extreme would mean that any single Kconfig could end-up having a corresponding snippet.
What about the next snippet which simply enables just a single Kconfig, should that also be accepted ?

@marekmatej
Copy link
Author

I like the mcuboot snippet because it's shorter and allows sharing the image features as a single string.

but following such approach to its extreme would mean that any single Kconfig could end-up having a corresponding snippet. What about the next snippet which simply enables just a single Kconfig, should that also be accepted ?

Hypothetically, but we are talking about enabling bootloader support. It is rather exception than a rule. Frankly, creating 3 new files just to enable single config is not a victory. But it makes perfect sense in this case.

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

Successfully merging this pull request may close these issues.

3 participants