Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Crash Loop on ESP32-S3-WROOM-1-N8R8 #71

Open
Jotschi opened this issue Nov 28, 2023 · 1 comment
Open

Crash Loop on ESP32-S3-WROOM-1-N8R8 #71

Jotschi opened this issue Nov 28, 2023 · 1 comment
Labels
bug Something isn't working

Comments

@Jotschi
Copy link

Jotschi commented Nov 28, 2023

I'm currently trying to narrow it down but I believe the error happens when sendInfo of websocket.cpp is invoked.

assert failed: insert_free_block heap_tlsf.c:233 (current && "free list cannot have a null entry")

The S3 N8R8 has 8MB PSRAM.

@Jotschi
Copy link
Author

Jotschi commented Nov 28, 2023

Update: I was able to fix/workaround the issue by adding a custom allocator which uses SPI and the PSRAM for the JSON document:

#include <Arduino.h>
#include <ArduinoJson.h>

struct SpiRamAllocator {
  void* allocate(size_t size) {
    return heap_caps_malloc(size, MALLOC_CAP_SPIRAM);
  }

  void deallocate(void* pointer) {
    heap_caps_free(pointer);
  }

  void* reallocate(void* ptr, size_t new_size) {
    return heap_caps_realloc(ptr, new_size, MALLOC_CAP_SPIRAM);
  }
};

Details: https://arduinojson.org/v6/how-to/use-external-ram-on-esp32/

Unfortunately now the ESP32 crashes when I try to invoke the first request.

assert failed: spinlock_acquire spinlock.h:122 (result == core_id || result == SPINLOCK_FREE)

Returning a basic hello world works.

@ph1p ph1p added the bug Something isn't working label Nov 28, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants