Page 1 of 1

How to use the upper 4MB of ESP-Wrover 8MB PSRAM

Posted: Tue Sep 19, 2023 4:10 pm
by dallim30
Hello,
I am using an ESP-Wrover-Kit.
It has a 16MB external SPI flash and an additional 8 MB PSRAM.
In the datasheet, it is mentioned that up to 4 MB of PSRAM can be mapped into CPU data memory space at a time.
As only 4 MB memory space is considered for External SRAM (0x3F80_0000 to 0x3FBF_FFFF), how can I use (map) the extra 4MB?
What would be the CPU data memory address to map that extra 4MB?

Is there an option to use part of the 4MB mappable addres srange to bank-switch the remaining memory in?
Do any one have a clue and similar situation for me to take a reference?

Thanks!

Re: How to use the upper 4MB of ESP-Wrover 8MB PSRAM

Posted: Tue Sep 19, 2023 4:44 pm
by MicroController
Is there an option to use part of the 4MB mappable addres srange to bank-switch the remaining memory in?
Do any one have a clue and similar situation for me to take a reference?
Yes and yes: "Himem Allocation API"

Re: How to use the upper 4MB of ESP-Wrover 8MB PSRAM

Posted: Fri Sep 22, 2023 4:51 am
by dallim30
How do I assign values from variables in RAM to a separate variable?

thanks

Re: How to use the upper 4MB of ESP-Wrover 8MB PSRAM

Posted: Fri Sep 22, 2023 2:40 pm
by MicroController
If the variables are structs or arrays, you do it via memcpy(); otherwise, and if you're referring to the himem PSRAM, you can alternatively use pointer-casting. Both just as you would with malloc'ed RAM.