I’m trying to get an Elecrow 7" (standard, not advances) display panel with ESP32-S3 to work with Lovyan and lvgl.
There’s other issues, but the latest one is I’m apparently running out of RAM. I haven’t even done anything yet, but… I’m questioning what I’m even out stating with.
The spec calls out an ESP32-S3 WROOM-1-N4R8. This spec sheet indicates 512K static RAM.
When I compile, I get an error that basically, I’m out of ram. When I use platformio “inspect” and look at memory, it indicates I have 320K of “RAM” (quotes because I don’t which RAM it’s talking about, but I assume it’s the static 512K).
When I look at the board definition file, it says 320K also.
Can somebody explain to me what’s happening/wrong?
I’m just trying to create a buffer for the display in lvgl, Lovyan wants one also, so I’m running out of RAM very fast. Looks like I can’t use PSRAM because the buffer needs to be accessible by the DMA.
Hmm… Ok, thanks for the info and links, I’ll check them out.
I had read on another site that the PSRAM was not accessible by the DMA, perhaps there’s more details on that, or it was an older chip. One of the perils of reading “stuff” on the internet, lack of context.
Perhaps I’m using an older term in ‘datasheet’ - I have always used it to refer to the technical documentation put out by the manufacturer to detail all key aspects of the hardware item in question.
Section 3 is all about the GDMA controller (or would ‘module’, ‘peripheral’ or ‘component’ be a better term?) which handles the majority of the DMA work within the chip/.Figure 3-1 shows the modules that can be accessed by the GDMA controller. Note that the USB module is not listed.
Section 32 covers the USB OTG module (and @sivar2311 this is the ‘module’ I was referring to). The 3rd bullet point in Section 32.3.1 towards the bottom of page 1228 mentions that the USB module has its own DMA controller (and by implication therefore does NOT use the GDMA). It also says that it access “…system memory…” which excludes the external PSRAM that s only accessed via the special SPI module.
Further, there is an entry in the official Github ‘issues’ section for Espressif (admittedly in the ESP-IDF subsection but does refer to the underlying hardware so applies to all code that runs on the hardware) at How to allocate dma buffer in external PSRAM (esp32s3) (IDFGH-9984) · Issue #11269 · espressif/esp-idf · GitHub where the question is asked about how to use PSRAM memory with the USB module. The 2nd to last entry by ‘gm-jiang’ (dated the 12th of May 2023) explicitly states (2nd sentence) states that you first DMA from the USB to internal memory and then to PSRAM via the EDMA (which is the external RAM accesing part of te GDMA module).
Finally, you can always do what I did (before finding the above) and that is to (using the ESP-IDF framework at least) edit the ‘urb_alloc’ function (in the usb_private.c file) to get the ‘data_buffer’ malloc’d from the PSRAM (change the ‘DATA_BUFFER_CAPS’ #define from MALLOC_CAP_INTERNAL to MALLOC_CAP_SPIRAM). That part all works well and no errors are reported even when the USB transfers are occurring. It was only when I pre-filled the allocated buffer with known values (0xaa in my case) and checked after the USB transfers occurred that I found my pre-filled values still there.
Everything is fine, I just wanted to know which datasheet exactly - there are so many
Ok, the term USB “module” misled me and let me think of Espressif Modules.
I would have said USB “peripheral”.
But even Espressif has used the terms “peripheral” and “module” interchangeably in the technical reference manual.
Despite the limitations of the PSRAM with regard to DMA and USB, it should still be possible to allocate a DMA-capable buffer in the PSRAM that can be used for display output.