DRAM segment data does not fit

lobis0
Posts: 1
Joined: Mon Jan 24, 2022 5:26 pm

DRAM segment data does not fit

Postby lobis0 » Mon Jan 24, 2022 6:22 pm

Hello,

I am running into a problem where I need to allocate memory for a dynamic array and it (barelly) exceeds the DRAM limit of my ESP32 board.

Code: Select all

#include <Arduino.h>

#define IMAGE_SIZE 134400

unsigned char image[IMAGE_SIZE];

void setup()
{

  for (int i = 0; i < IMAGE_SIZE; i++)
  {
    image[i] = 0;
  }

  return;
}

void loop()
{
}
Is there any way to make the above code work?

My goal is to call an external function that takes a `const unsigned char *image` as an argument. If I declare this `image` array as a const array, the problem will work, but taking out the const modifier throws this exception. I could store the image data into multiple arrays since it fits in memory, perhaps there is a smart way to merge this multiple arrays into a single const array such as the one required by my external function? This would solve my issue.

Thanks!

Who is online

Users browsing this forum: Baidu [Spider] and 24 guests