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

PSRAM not working for esp32s3? project ignoring sdkconfig? #9756

Closed
1 task done
anthonyhoegberg opened this issue Jun 3, 2024 · 2 comments · Fixed by #9762
Closed
1 task done

PSRAM not working for esp32s3? project ignoring sdkconfig? #9756

anthonyhoegberg opened this issue Jun 3, 2024 · 2 comments · Fixed by #9762
Labels
Status: In Progress Issue is in progress
Milestone

Comments

@anthonyhoegberg
Copy link

Board

ESP32s3

Device Description

ESP32s3

Hardware Configuration

FLASH 16MB DIO 80MHZ
OPI PSRAM

Version

v3.0.0

IDE Name

ESP-IDF vscode

Operating System

Windows 11

Flash frequency

80

PSRAM enabled

yes

Upload speed

default

Description

So i cant figure out how to enable psram for arduino components
My sdkconfig has been setup correctly with all the correct settings, however i feel like arduino components are ignoring some settings?

Like i cant get serial to work or my device unless i add definitions for USB CDC and USB MODE
But i think that should be automatic based on sdkconfig no?
Also in older versions of arduino component the BOARD_HAS_PSRAM definition made it enable psram for me
However in this version 3.0.0 it no longer works and gives me the error
project_folder/managed_components/espressif__arduino-esp32/cores/esp32/esp32-hal-psram.c:22:10: fatal error: esp_psram.h: No such file or directory
22 | #include "esp_psram.h"

Is arduino components somehow ignoring my sdkconfig and not applying settings correctly since i have to add definitions or is something wrong here? (When i remove the definition for BOARD HAS PSRAM I get no error but sketch shows no psram)

Project root cmake config:

# The following lines of boilerplate have to be in your project's
# CMakeLists in this exact order for cmake to work correctly
cmake_minimum_required(VERSION 3.5)

add_definitions(-DBOARD_HAS_PSRAM -mfix-esp32-psram-cache-issue)
add_definitions(-DARDUINO_USB_CDC_ON_BOOT=1)
add_definitions(-DARDUINO_USB_MODE=1)

include($ENV{IDF_PATH}/tools/cmake/project.cmake)
project(amcamiot3)

sdkconfig

Sketch

#include "Arduino.h"

void setup() {
    Serial.begin(115200);
    Serial.println("Serial works!");

    Serial.printf("Total heap: %li\n", ESP.getHeapSize());
    Serial.printf("Free heap: %li\n", ESP.getFreeHeap());
    Serial.printf("Total PSRAM: %li\n", ESP.getPsramSize());
    Serial.printf("Free PSRAM: %li\n", ESP.getFreePsram());
}

void loop() {
}

Debug Message

if definition is removed for psram, i get this output
Serial works!
Total heap: 401636
Free heap: 368860
Total PSRAM: 0
Free PSRAM: 0

Other Steps to Reproduce

No response

I have checked existing issues, online documentation and the Troubleshooting Guide

  • I confirm I have checked existing issues, online documentation and Troubleshooting guide.
@anthonyhoegberg anthonyhoegberg added the Status: Awaiting triage Issue is waiting for triage label Jun 3, 2024
@anthonyhoegberg anthonyhoegberg changed the title PSRAM not initialized? PSRAM not working for esp32s3? project ignoring sdkconfig? Jun 3, 2024
@anthonyhoegberg
Copy link
Author

I found out about the error
It looks like the CMakeLists.txt file in arduino-esp32 does not include esp32-psram component at all?

set(requires spi_flash esp_partition mbedtls wifi_provisioning wpa_supplicant esp_adc esp_eth http_parser)

adding esp_psram to the end of that will make PSRAM work with our -DBOARD_HAS_PSRAM definitions

Looks like we need to do some kind of check to see if psram config is enabled and include it in the requires

Based on https://docs.espressif.com/projects/esp-idf/en/v5.2/esp32s3/migration-guides/release-5.x/5.0/system.html#psram
it is required to include esp_psram component i think?

@me-no-dev
Copy link
Member

We do not need to specify this so far on IDF v5.1. I will add it to requires and see if it will work ok on targets without PSRAM

@VojtechBartoska VojtechBartoska added Status: In Progress Issue is in progress and removed Status: Awaiting triage Issue is waiting for triage labels Jun 3, 2024
@VojtechBartoska VojtechBartoska added this to the 3.0.1 milestone Jun 3, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Status: In Progress Issue is in progress
Projects
Development

Successfully merging a pull request may close this issue.

3 participants