PSRAM support status

ESP_Sprite
Posts: 9014
Joined: Thu Nov 26, 2015 4:08 am

Re: PSRAM support status

Postby ESP_Sprite » Mon Sep 11, 2017 6:46 am

Looks like the issue is that some code calls stuff like memcpy() with flash cache disabled. This is somewhat of an issue because for the psram workaround, we use a version that lives in flash instead of ROM, and that can't be called because, well, flash is disabled. Working on a patch to store functions like that in IRAM instead.

User avatar
loboris
Posts: 514
Joined: Wed Dec 21, 2016 7:40 pm

Re: PSRAM support status

Postby loboris » Sun Sep 17, 2017 6:15 pm

Is there any progress in solving the SPIRAM+WiFi issue and generally in SPIRAM support integration into main esp-idf branch?

ESP_igrr
Posts: 2067
Joined: Tue Dec 01, 2015 8:37 am

Re: PSRAM support status

Postby ESP_igrr » Sun Sep 17, 2017 8:43 pm

The fix for WiFi issue and the new toolchain URLs have both been merged into master, however we are having some issues which prevent us from updating Github master branch. We expect to resolve these issues today or tomorrow.

User avatar
loboris
Posts: 514
Joined: Wed Dec 21, 2016 7:40 pm

Re: PSRAM support status

Postby loboris » Mon Sep 18, 2017 7:45 pm

I'm pleased to report that after pulling the latest commits from esp-idf master branch and Espressif toolchain 1.22.0-73-ge28a011-5.2.0 all my PSRAM tests passes without error.
Even the complex application (MicroPython running with heap on SPIRAM) runs without error.
The only feature still missing is the possibility tou use malloc() to allocate also in SPIRAM.

llewellyn
Posts: 33
Joined: Fri May 05, 2017 8:22 am

Re: PSRAM support status

Postby llewellyn » Sun Sep 24, 2017 4:55 pm

Hi,

Is the PSRAM completely integrated into the master branch as of today?
What I mean is that can I expect 4mb RAM for my application to run WIFI, BTLE, PPPoS, AWSIoT?

Regards

User avatar
loboris
Posts: 514
Joined: Wed Dec 21, 2016 7:40 pm

Re: PSRAM support status

Postby loboris » Sun Sep 24, 2017 6:33 pm

llewellyn wrote:Hi,

Is the PSRAM completely integrated into the master branch as of today?
What I mean is that can I expect 4mb RAM for my application to run WIFI, BTLE, PPPoS, AWSIoT?

Regards
malloc() will not allocate from SPIRAM region, but you can use heap_caps_malloc(size, MALLOC_CAP_SPIRAM) to allocate from SPIRAM in your application code. All functions using malloc() will allocate from internal RAM.
You have to configure → Component config → ESP32-specific → SPI RAM config → Make RAM allocatable using heap_caps_malloc for heap_caps_malloc to be able to use MALLOC_CAP_SPIRAM option.

I've been testing it for the last 6 days and had no issues so far...

ESP_Sprite
Posts: 9014
Joined: Thu Nov 26, 2015 4:08 am

Re: PSRAM support status

Postby ESP_Sprite » Mon Sep 25, 2017 1:58 am

FWIW, we have the code that allows for malloc() in external RAM almost ready, it should be merged shortly.

llewellyn
Posts: 33
Joined: Fri May 05, 2017 8:22 am

Re: PSRAM support status

Postby llewellyn » Mon Sep 25, 2017 4:40 am

Thanks for the replies.

Waiting for the merge.

Regards

sintech
Posts: 27
Joined: Wed Dec 14, 2016 2:54 pm

Re: PSRAM support status

Postby sintech » Sun Oct 08, 2017 9:30 pm

Hello,
I have some issues with SPI RAM on ALB-WROVER module.
"SPI RAM config" in menuconfig is set to "Make RAM allocatable using heap_caps_malloc".
But when I try to do "heap_caps_malloc" in my program I get the "Guru Meditation Error of type LoadStoreAlignment".

My pretty simple code is based on standard hello_world example (only with SPI RAM support turned on in menuconfig) + loboris test code.
Source: https://gist.github.com/sintech/7595875 ... rld_main-c
Console output: https://gist.github.com/sintech/7595875 ... ole-output

Perhaps I made some stupid mistake. And it would be great if you give me some advice how to fix it.
Thanks in advance.

P.S. same issue was observed while using malloc (with corresponding option enabled in menuconfig).

User avatar
loboris
Posts: 514
Joined: Wed Dec 21, 2016 7:40 pm

Re: PSRAM support status

Postby loboris » Sun Oct 08, 2017 10:44 pm

If "SPI RAM config" in menuconfig is set to "Make RAM allocatable using heap_caps_malloc" you shouldn't use direct memory access, for that you should use "Integrate RAM into ESP32 memory map" option.
If you comment that part of your code, it will work.
If you configure "Make RAM allocatable using malloc() as well", you can use malloc() and heap_caps_malloc().
And you probably don't want to print the index 2000000 times (

Code: Select all

printf("i: %d\n",i);
)

Who is online

Users browsing this forum: No registered users and 98 guests