-
Notifications
You must be signed in to change notification settings - Fork 7.4k
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
PSRAM stops working when importing arduino-esp32
into ESP-IDF. Flag CONFIG_SPIRAM
becomes undefined when BOARD_HAS_PSRAM
is not set.
#10500
Comments
Better workaround for now, add the following line to add_compile_options(-DBOARD_HAS_PSRAM=1) This may just be a documentation issue. It would be great to have the docs clarified when using |
You should not define |
Ahh you are correct... need to do some tests |
Unfortunately the proposed fix will break many libraries PlatformIO projects. I suspect that documenting the necessity to add |
BTW this code has been as-is for a very long time. You are the first to notice the issue |
Thanks for the quick turnaround. I'm surprised using the ESP-IDF directly with the desire to use abundant Arduino libraries is not more common Documentation seems the best way to go. Also on how to apply custom build flags in general as there is no info on that (that I can see). |
I think I found a way that changes nothing in Arduino and does not delete the defines when using as component. Change is minimal and differentiates wether the prebuilt libs are used (Arduino IDE, PlatformIO) and if so it has the old behavior, else does not change anything. You can see it here if you want to try: 1833eeb |
* fix(psram): Do not disable PSRAM when used as component Information: #10500 * IDF release/v5.3 59550599
* fix(psram): Do not disable PSRAM when used as component Information: #10500 * IDF release/v5.1 Update
Board
Xiao ESP32-S3 Sense
Device Description
Xiao ESP32-S3 Sense connected to PC with USB-C
Hardware Configuration
Just USB-C to PC
Version
latest master (checkout manually)
IDE Name
VSCode
Operating System
NixOS
Flash frequency
40MHz
PSRAM enabled
yes
Upload speed
460800
Description
Unfortunately my PSRAM stopped working as soon as I started using the
arduino-esp32
component. This code literally undefines theCONFIG_SPIRAM
andCONFIG_SPIRAM_SUPPORT
flag out of existence:https://github.com/espressif/arduino-esp32/blob/master/cores/esp32/esp32-hal-psram.h#L29
There is no way to override them back. I even tried defining
BOARD_HAS_PSRAM
as a build flag but it hasn't worked. I haven't found docs on how to set global builds flags nor is there any information on theBOARD_HAS_PSRAM
flag and any explanation as to why it exists when we already have flags insdkconfig
for those.Manually removing lines 24-31 in
esp32-hal-psram.h
will get PSRAM working again but this is an uncomfortable workaround.Thanks
Sketch
Debug Message
Other Steps to Reproduce
No response
I have checked existing issues, online documentation and the Troubleshooting Guide
The text was updated successfully, but these errors were encountered: