Skip to content

ESP32 PSRAM Memory Exception #1069

Description

@beckerzito

Build environment: macOS
Target device: ESP32

Description
I have been working in an application with Main Thread + Worker (almost 50k bytes allocated for each machine) in the ESP32 SoC. With the increase of the application, we saw the need to start using an external PSRAM. To configure that, we have followed the espressif documentation on how to use the PSRAM.

Also, I have found in this repo, some issues raised when trying to use moddable in this setup, mainly related to the DEBUGGER SPEED, where I also had to decrease it to 115200 to be able to communicate with xsBug.

However, since we enabled the external RAM, the application got unstable. First of all, in debug mode, the WIFI is never able to connect (always getting event 5 - DISCONNECTED). In instrumented mode, I'm able to connect to the WIFI, however, Secure Socket connections get closed with -2 status.

Despite all that, what is really concerning me, is some memory exceptions being thrown randomly. Sometimes right after boot up, sometimes after hours. Those exceptions are (LoadProhibited or StoreProhibited) when trying to read or write to an invalid address. The weird part is that the crashes always happen in Moddable code (usually in the fxSeep function - see screenshot below).

Steps to Reproduce
Couldn't find a specific way to reproduce it. Sometimes the problem happens right after the bootup, sometimes it takes hours.

Expected behavior
What you expect to happen

Images
image

Other information

  • Our current SoC revision is 1. We know that this revision used to have problems with Cache access when using PSRAM. But it seems that Espressif was able to work around all the reported issues through software. (I have tested lots of software that were used to reproduce the problems in the past, and all of them are working fine).
  • I configured the sdk in such a way that both machines are now allocated in the external memory.

My question is: Have you seen similar behavior in this configuration? I'm not totally convinced that this is a moddable issue (maybe an integration problem between moddable and how Espressif handles PSRAM?). But what is bugging me is that all the crashes I have seen so far were always in a moddable code.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions