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

ESP32-S3 SPI ram not configured on fri3d-2024 on IDF-5.3 #170

Open
raphatex opened this issue Nov 27, 2024 · 6 comments
Open

ESP32-S3 SPI ram not configured on fri3d-2024 on IDF-5.3 #170

raphatex opened this issue Nov 27, 2024 · 6 comments
Labels
bug Something isn't working

Comments

@raphatex
Copy link

So I don't know if this issue needs to be fixed but I wanted to share my experience to help others!

On IDF-5.3 it seems that sdkconfig is a bit different for the S3, so the Octal SPI RAM is not configured as it should be. Also, the default frequency is 160 MHz for the ESP32 instead of 240 MHz. There are probably other differences but I didn't dig deeper.

@raphatex raphatex added the bug Something isn't working label Nov 27, 2024
ducalex added a commit that referenced this issue Nov 28, 2024
Ensure the CPU is set to 240Mhz.

The value names as of esp-idf 5.x should be: `CONFIG_ESP_DEFAULT_CPU_FREQ_MHZ_X`

But `CONFIG_ESP32S3_DEFAULT_CPU_FREQ_X` seems to work for both 4.4 and 5.x, so I went with that for now.

The previous `CONFIG_ESP32_DEFAULT_CPU_FREQ_X` was just not working on 5.x, always defaulting to 160Mhz.
@ducalex
Copy link
Owner

ducalex commented Nov 28, 2024

I've updated the sdkconfig for CPU frequency and it seems to now be working correctly on at least 4.4 5.0 5.3, can you confirm? If it doesn't work, I've left some notes in the commit message and you can experiment and we can use whichever names you find work best.

For SPIRAM it might be more challenging (but not impossible) because 5.3 seems to have entirely dropped many of the old names.

If we can find values that work consistently across 5.x at least that would be good.

@SSStarku
Copy link

SSStarku commented Nov 28, 2024

i had the same error in my esp32s3 8psram that the PSRAM was not recognized in 5.3 and I created a new one and this one works fine. Check if the Ducalex one works and if not, try this one. I have created it based on the values ​​of the previous ducalex sdkconfig with the menuconfig. Also, i think that the default value is 240MZ.

sdkconfig.txt

@raphatex
Copy link
Author

Oh yeah sorry i just realised you already mentioned this issue

@raphatex
Copy link
Author

I've updated the sdkconfig for CPU frequency and it seems to now be working correctly on at least 4.4 5.0 5.3, can you confirm? If it doesn't work, I've left some notes in the commit message and you can experiment and we can use whichever names you find work best.

For SPIRAM it might be more challenging (but not impossible) because 5.3 seems to have entirely dropped many of the old names.

If we can find values that work consistently across 5.x at least that would be good.

Frequency in working fine for me too !

@raphatex
Copy link
Author

So I edited the SPI RAM config section in the SDKconfig file with this:

#
# SPI RAM config
#
CONFIG_SPIRAM=y
# CONFIG_SPIRAM_MODE_QUAD is not set
CONFIG_SPIRAM_MODE_OCT=y
CONFIG_SPIRAM_TYPE_AUTO=y
# CONFIG_SPIRAM_TYPE_ESPPSRAM64 is not set
CONFIG_SPIRAM_ALLOW_STACK_EXTERNAL_MEMORY=y
CONFIG_SPIRAM_CLK_IO=30
CONFIG_SPIRAM_CS_IO=26
# CONFIG_SPIRAM_XIP_FROM_PSRAM is not set
# CONFIG_SPIRAM_FETCH_INSTRUCTIONS is not set
# CONFIG_SPIRAM_RODATA is not set
# CONFIG_SPIRAM_SPEED_40M is not set
CONFIG_SPIRAM_SPEED_80M=y
CONFIG_SPIRAM_SPEED=80
# CONFIG_SPIRAM_ECC_ENABLE is not set
CONFIG_SPIRAM_BOOT_INIT=y
# CONFIG_SPIRAM_IGNORE_NOTFOUND is not set
# CONFIG_SPIRAM_USE_MEMMAP is not set
# CONFIG_SPIRAM_USE_CAPS_ALLOC is not set
CONFIG_SPIRAM_USE_MALLOC=y
CONFIG_SPIRAM_MEMTEST=y
CONFIG_SPIRAM_MALLOC_ALWAYSINTERNAL=16384
# CONFIG_SPIRAM_TRY_ALLOCATE_WIFI_LWIP is not set
CONFIG_SPIRAM_MALLOC_RESERVE_INTERNAL=32768
# CONFIG_SPIRAM_ALLOW_BSS_SEG_EXTERNAL_MEMORY is not set

CONFIG_ESP32_SPIRAM_SUPPORT=y
CONFIG_SPIRAM_BOOT_INIT=y
CONFIG_SPIRAM_IGNORE_NOTFOUND=y
CONFIG_SPIRAM_USE_MEMMAP=n
CONFIG_SPIRAM_USE_CAPS_ALLOC=n
CONFIG_SPIRAM_USE_MALLOC=y
CONFIG_SPIRAM_TYPE_AUTO=y
CONFIG_SPIRAM_TYPE_ESPPSRAM32=n
CONFIG_SPIRAM_TYPE_ESPPSRAM64=n
CONFIG_SPIRAM_SIZE=-1
CONFIG_SPIRAM_SPEED_40M=n
CONFIG_SPIRAM_SPEED_80M=y
CONFIG_SPIRAM_MEMTEST=y
CONFIG_SPIRAM_CACHE_WORKAROUND=n
CONFIG_SPIRAM_BANKSWITCH_ENABLE=n
#CONFIG_SPIRAM_MALLOC_ALWAYSINTERNAL=16384
#CONFIG_SPIRAM_MALLOC_RESERVE_INTERNAL=16384

(I simply added the IDF-5.3 specific on top of the old configuration)
It works fine on IDF-5.3.
But I do not have older version of IDF to test it

ducalex added a commit that referenced this issue Nov 29, 2024
The value name as of esp-idf 5.x should be: `CONFIG_SPIRAM=y`

But 4.4 doesn't support it, so `CONFIG_ESP32S3_SPIRAM_SUPPORT=y` is also included to preserve compatibility.

I've also removed esp32-specific stuff that doesn't apply to an esp32s3 target.
ducalex added a commit that referenced this issue Nov 29, 2024
I've disabled the following:

- CONFIG_SPIRAM_FETCH_INSTRUCTIONS
- CONFIG_SPIRAM_RODATA

They were for a feature that was never merged.
@ducalex
Copy link
Owner

ducalex commented Nov 29, 2024

Thanks to you two, based on your two versions I have identified what seems to be the main culprit and I've pushed a change. There were more differences but the values picked by the target's author likely had a reason to be so I prefer to leave them alone for now.

The changes seem to maintain SPIRAM being enabled on 4.4.8 5.0 5.3 (at least in the menu, I can't test on real hardware myself).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants