Open cjdell opened 2 weeks ago
Better workaround for now, add the following line to CMakeLists.txt
in the root of your project:
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 arduino-esp32
directly via the ESP-IDF and not via the Arduino IDE.
You should not define BOARD_HAS_PSRAM
yourself. All you need to do is control it through menuconfig and it will work
Ahh you are correct... need to do some tests
@cjdell fix is coming here. You will need to remove add_compile_options(-DBOARD_HAS_PSRAM=1)
once it's applied
Unfortunately the proposed fix will break many libraries PlatformIO projects. I suspect that documenting the necessity to add add_compile_options(-DBOARD_HAS_PSRAM)
to the project would be the only way to go.
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: https://github.com/espressif/arduino-esp32/commit/1833eeb1b18d6aa3b27ff9dca71740ed0b22e6dc
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