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

dallim30
Posts: 22
Joined: Thu Apr 29, 2021 1:35 am

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

Postby dallim30 » Tue Sep 19, 2023 4:10 pm

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!

MicroController
Posts: 1750
Joined: Mon Oct 17, 2022 7:38 pm
Location: Europe, Germany

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

Postby MicroController » Tue Sep 19, 2023 4:44 pm

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"

dallim30
Posts: 22
Joined: Thu Apr 29, 2021 1:35 am

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

Postby dallim30 » Fri Sep 22, 2023 4:51 am

How do I assign values from variables in RAM to a separate variable?

thanks

MicroController
Posts: 1750
Joined: Mon Oct 17, 2022 7:38 pm
Location: Europe, Germany

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

Postby MicroController » Fri Sep 22, 2023 2:40 pm

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.

Who is online

Users browsing this forum: No registered users and 91 guests