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

Fix WiFi allocation in SPIRAM on ESP32 and ESP32-S3 #82870

Merged

Conversation

marekmatej
Copy link

@marekmatej marekmatej commented Dec 11, 2024

This PR fixes the ESP32 and ESP32S3 linker in case when CONFIG_SPIRAM and CONFIG_ESP32_WIFI_NET_ALLOC_SPIRAM are both enabled. This frees the space in the internal DRAM.
Fixes #74675

@zephyrbot
Copy link
Collaborator

zephyrbot commented Dec 11, 2024

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

Name Old Revision New Revision Diff

All manifest checks OK

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

@marekmatej marekmatej force-pushed the bugfix/memory_spiram_esp32s3 branch from e309224 to dd178e7 Compare December 11, 2024 20:05
@marekmatej marekmatej changed the title Fix SPIRAM WiFi allocation on ESP32-S3 Fix WiFi allocation in SPIRAM on ESP32 and ESP32-S3 Dec 11, 2024
@marekmatej marekmatej force-pushed the bugfix/memory_spiram_esp32s3 branch from dd178e7 to 3a8267a Compare December 12, 2024 11:40
Marek Matej added 3 commits December 12, 2024 17:07
Fix allocations of large buffers if SPIRAM and WiFi alloc
to SPIRAM are both enabled.

Signed-off-by: Marek Matej <[email protected]>
Fix the allocations if the SPIRAM and WiFi alloc to SPIRAM
are both enabled.

Signed-off-by: Marek Matej <[email protected]>
Rename psram.c -> esp_psram.c to align with the naming conventions.

Signed-off-by: Marek Matej <[email protected]>
@marekmatej marekmatej force-pushed the bugfix/memory_spiram_esp32s3 branch from 3a8267a to fa55140 Compare December 12, 2024 16:07
@marekmatej marekmatej marked this pull request as ready for review December 12, 2024 18:33
@zephyrbot zephyrbot added the platform: ESP32 Espressif ESP32 label Dec 12, 2024
Comment on lines +685 to +703
#ifdef CONFIG_ESP32_WIFI_NET_ALLOC_SPIRAM
*(EXCLUDE_FILE(
*libdrivers__wifi.a:*
*libsubsys__net__l2__ethernet.a:*
*libsubsys__net__lib__config.a:*
*libsubsys__net__ip.a:*
*libsubsys__net.a:* ) .noinit)
*(EXCLUDE_FILE(
*libdrivers__wifi.a:*
*libsubsys__net__l2__ethernet.a:*
*libsubsys__net__lib__config.a:*
*libsubsys__net__ip.a:*
*libsubsys__net.a:* ) .noinit.*)
#else
*(.noinit)
*(.noinit.*)
. = ALIGN (8);
#endif /* CONFIG_ESP32_WIFI_NET_ALLOC_SPIRAM */
__dram_noinit_end = ABSOLUTE(.);
. = ALIGN (4);
Copy link
Collaborator

Choose a reason for hiding this comment

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

There is something wrong with this logic. In case CONFIG_ESP32_WIFI_NET_ALLOC_SPIRAM is defined, it should only exclude the net/wifi stuff. Currently, it is also not adding .noinit data at all. Is that right?

Copy link
Author

Choose a reason for hiding this comment

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

It excludes the noinit and noinit.* sections for object files matching the pattern. If the SPIRAM alloc is not defined it spills noinit and noinit.* without exceptions.

@kartben kartben merged commit 930000d into zephyrproject-rtos:main Dec 16, 2024
27 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
platform: ESP32 Espressif ESP32
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Enabling the CONFIG_ESP32_WIFI_NET_ALLOC_SPIRAM does not move the WiFi noinit to the SPIRAM
7 participants