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

Static linking in psram. Is there support or what is needed for it? #1083

Open
Volkalex28 opened this issue Jan 16, 2024 · 7 comments
Open
Labels
peripheral:psram PSRAM peripheral

Comments

@Volkalex28
Copy link
Contributor

Hello. Are there any plans to add a linking attribute to psram?
As in idf:
#[link_section = ".ext_ram.bss.****"]

@bjoernQ
Copy link
Contributor

bjoernQ commented Jan 16, 2024

There are currently no plans to use PSRAM for anything but heap memory. PRs are welcome

@Volkalex28
Copy link
Contributor Author

Why was it removed here?

@bjoernQ
Copy link
Contributor

bjoernQ commented Jan 16, 2024

Why was it removed here?

It was never really supported ... e.g. we never actually zeroed .external.bss

@Volkalex28
Copy link
Contributor Author

Added a draft for this. I will be glad for any help

@ProfFan
Copy link
Contributor

ProfFan commented Aug 24, 2024

I had some discussion with my coworkers today and realized that there is a huge benefit to this (PSRAM XIP): The PSRAM has much lower latency than the flash, so ICACHE misses will be much faster! XREF #1096 for example. Also per official docs: https://docs.espressif.com/projects/esp-idf/en/stable/esp32s3/api-reference/kconfig.html#config-spiram-fetch-instructions

Tagging @MabezDev since I saw the comments in #1090

@igrr
Copy link

igrr commented Sep 4, 2024

The PSRAM has much lower latency than the flash, so ICACHE misses will be much faster!

@ProfFan I am curious about this conclusion, could you please explain it further? AFAICT, provided that Flash and PSRAM use same SPI bus width and frequency, read latencies would be the same (plus-minus a couple of dummy cycles after the address phase).

@ProfFan
Copy link
Contributor

ProfFan commented Sep 4, 2024

@igrr

I am curious about this conclusion

It's written in the official docs: https://docs.espressif.com/projects/esp-idf/en/stable/esp32s3/api-reference/kconfig.html#config-spiram-fetch-instructions

Also quote from docs:

The benefits of XiP from PSRAM is:

PSRAM access speed is faster than Flash access. So the performance is better.
The cache will not be disabled during an SPI1 flash operation, thus optimizing the code execution performance during SPI1 flash operations. For ISRs, ISR callbacks and data which might be accessed during this period, you do not need to place them in internal RAM, thus internal RAM usage can be optimized. This feature is useful for high throughput peripheral involved applications to improve the performance during SPI1 flash operations.

@MabezDev MabezDev added the peripheral:psram PSRAM peripheral label Oct 8, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
peripheral:psram PSRAM peripheral
Projects
Status: Todo
Development

No branches or pull requests

6 participants