Skip to content

V16 won't run on M5STACK AtomS3 Lite (ESP32S3) with M2 screw hole, 8Mb flash and without PSRAM #5629

@403-err

Description

@403-err

What happened?

After upgrading the AtomS3 Lite to version 16 the web interface shows the error "Error 8: Effect RAM depleted”.

To Reproduce Bug

Simply install version 15.4 to an Atoms3 Lite and confirm full function, then upgrade to v16. The web interface will show "Error 8: Effect RAM depleted” and the attached Led will not work

Expected Behavior

Since it works fine under 15.4 should it not still function under v16 ?

Install Method

Binary from WLED.me

What version of WLED?

WLED Version 16.0

Which microcontroller/board are you seeing the problem on?

ESP32-S3

Relevant log/trace output

Anything else?

I build a debug version and traced the source of the error to a _pixel buffer allocation in FX_fcn.cpp that uses the flag BFRALLOC_ENFORCE_PSRAM but since the Atoms3 Lite has no PSRAM the allocation fails and thus the error mesage.

I tried a build with following change

diff --git a/wled00/FX_fcn.cpp b/wled00/FX_fcn.cpp
index cbd937fb..0c999ce4 100644
--- a/wled00/FX_fcn.cpp
+++ b/wled00/FX_fcn.cpp
@@ -1274,7 +1274,7 @@ void WS2812FX::finalizeInit() {
   // allocate frame buffer after matrix has been set up (gaps!)
   p_free(_pixels); // using realloc on large buffers can cause additional fragmentation instead of reducing it
   // use PSRAM if available: there is no measurable perfomance impact between PSRAM and DRAM on S2/S3 with QSPI PSRAM for this buffer
-  _pixels = static_cast<uint32_t*>(allocate_buffer(getLengthTotal() * sizeof(uint32_t), BFRALLOC_ENFORCE_PSRAM | BFRALLOC_NOBYTEACCESS | BFRALLOC_CLEAR));
+  _pixels = static_cast<uint32_t*>(allocate_buffer(getLengthTotal() * sizeof(uint32_t), BFRALLOC_PREFER_PSRAM | BFRALLOC_NOBYTEACCESS | BFRALLOC_CLEAR));
   DEBUG_PRINTF_P(PSTR("strip buffer size: %uB\n"), getLengthTotal() * sizeof(uint32_t));
   DEBUG_PRINTF_P(PSTR("Heap after strip init: %uB\n"), getFreeHeapSize());
 }

Is this a valid change? Is there a better fix?

Code of Conduct

  • I agree to follow this project's Code of Conduct

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugfixed in sourceThis issue is unsolved in the latest release but fixed in master

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions