code is too big #11541
Replies: 1 comment
-
Is it an immutable type of data, meaning that the bytes won't change along the execution of the application? It is also necessary to correctly set the Partition Scheme to have an application partition that can store the firmware size plus the 4MB data. Otherwise, if the data must be allocated to RAM, it shall go to a PSRAM sized to store such volume of data. char *bigArray = NULL;
void setup() {
bigArray = (char *) malloc(4 * 1024 * 1024);
if (bigArray == NULL) {
log_e("Memory allocation in PSRAM has failed.");
}
// populating the array with sequence values
for (uint32_t i = 0; i < 4 * 1024 * 1024; i++) {
bigArray[i] = (char) i & 0xFF;
}
} |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
Board
ESP32-S3
Device Description
ESP32-S3-Korvo-2
Hardware Configuration
no
Version
latest stable Release (if not listed below)
IDE Name
Arduino IDE
Operating System
Windows 11
Flash frequency
240MHz
PSRAM enabled
yes
Upload speed
115200
Description
I need to use a big unsigned char array,but the Arduino IDE compile not passed because the array is too big.How can i solve this problem?
The array has 4M elements.
Sketch
Bandwidth exhausted or memory limit exceeded
Debug Message
Other Steps to Reproduce
No response
I have checked existing issues, online documentation and the Troubleshooting Guide
Beta Was this translation helpful? Give feedback.
All reactions