Skip to content

Wi-Fi buffers in SPIRAM #90072

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

Merged
merged 2 commits into from
May 27, 2025

Conversation

marekmatej
Copy link
Collaborator

@marekmatej marekmatej commented May 16, 2025

This PR enables the SPIRAM buffers to be partially allocated in the external memory.

Build instructions:

west build -b esp32s3_devkitm/esp32s3/procpu samples/net/wifi/shell/ -p -DCONFIG_BOOTLOADER_MCUBOOT=y -DCONFIG_ESP_SPIRAM=y -DCONFIG_ESP_SPIRAM_SIZE=2097152 -DCONFIG_ESP_WIFI_HEAP_SPIRAM=y -DCONFIG_ESP32_WIFI_NET_ALLOC_SPIRAM=y -DCONFIG_SPIRAM_FETCH_INSTRUCTIONS=y -DCONFIG_SPIRAM_RODATA=y -DCONFIG_SPIRAM_SPEED_80M=y

Copy link

github-actions bot commented May 16, 2025

The following west manifest projects have changed revision in this Pull Request:

Name Old Revision New Revision Diff
hal_espressif zephyrproject-rtos/hal_espressif@fa60a7a zephyrproject-rtos/hal_espressif@e3532f0 (zephyr) zephyrproject-rtos/[email protected]

All manifest checks OK

Note: This message is automatically posted and updated by the Manifest GitHub Action.

@github-actions github-actions bot added manifest manifest-hal_espressif DNM (manifest) This PR should not be merged (controlled by action-manifest) labels May 16, 2025
@marekmatej marekmatej added platform: ESP32 Espressif ESP32 area: Wi-Fi Wi-Fi labels May 16, 2025
@marekmatej marekmatej force-pushed the feature/wifi_psram_buffs branch 2 times, most recently from 65edc41 to 299ab42 Compare May 21, 2025 12:09
@github-actions github-actions bot removed the DNM (manifest) This PR should not be merged (controlled by action-manifest) label May 21, 2025
@marekmatej marekmatej marked this pull request as ready for review May 21, 2025 12:12
uLipe
uLipe previously approved these changes May 21, 2025
Copy link
Member

@uLipe uLipe left a comment

Choose a reason for hiding this comment

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

LGTM, question it would not possible to put the exttra configurations shown in the build command into a snippet file? It would serve as a good template for people may want to use this option.

@marekmatej
Copy link
Collaborator Author

LGTM, question it would not possible to put the exttra configurations shown in the build command into a snippet file? It would serve as a good template for people may want to use this option.

Yeah, I have already PR regarding the snippets, and I was waiting until the PSRAM+WiFi gets resolved. In general, what you need is to enable ESP_SPIRAM and WIFI_HEAP_SPIRAM. That should be enough.

@marekmatej marekmatej force-pushed the feature/wifi_psram_buffs branch 2 times, most recently from 22ed0e9 to 81e8b29 Compare May 26, 2025 12:21
@github-actions github-actions bot added the DNM (manifest) This PR should not be merged (controlled by action-manifest) label May 26, 2025
@marekmatej marekmatej force-pushed the feature/wifi_psram_buffs branch from 81e8b29 to 71414d7 Compare May 26, 2025 14:32
@github-actions github-actions bot removed the DNM (manifest) This PR should not be merged (controlled by action-manifest) label May 26, 2025
@@ -35,6 +35,9 @@ choice ESP_WIFI_HEAP
config ESP_WIFI_HEAP_SYSTEM
bool "Wi-Fi adapter use kernel mempool heap (k_malloc)"

config ESP_WIFI_HEAP_SPIRAM
Copy link
Collaborator

Choose a reason for hiding this comment

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

should not be indented again (lines 35-39)

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Yeah.. I followed the lines 137-140 and 206-209, that's why the indentation. Do you want me to update it all?

Copy link
Collaborator

Choose a reason for hiding this comment

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

sure

Marek Matej added 2 commits May 27, 2025 10:08
Update HAL to support Wi-Fi buffers in PSRAM.

Signed-off-by: Marek Matej <[email protected]>
Update kconfig to support SPIRAM.

Signed-off-by: Marek Matej <[email protected]>
@marekmatej marekmatej force-pushed the feature/wifi_psram_buffs branch from 71414d7 to a5c699f Compare May 27, 2025 08:10
Copy link

@marekmatej marekmatej requested review from nordicjm and uLipe May 27, 2025 09:18
@kartben kartben merged commit c203760 into zephyrproject-rtos:main May 27, 2025
29 checks passed
@marekmatej
Copy link
Collaborator Author

Fixes #86722

@kartben kartben linked an issue Jun 26, 2025 that may be closed by this pull request
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.

ESP32 wifi should be able to use SPIRAM heap for buffer allocation
6 participants