After export Arduino IDE project, i have errors: .dram0.bss' will not fit in region dram0_0_seg' \ DRAM segment data does not fit \ region `dram0_0_seg' overflowed by 488 byte

I created this topic in github, but I don’t know where is best place

This project ESP32-Oscilloscope/ESP32_Oscilloscope at main · Circuit-Digest/ESP32-Oscilloscope · GitHub
, i converted to PIO format for three ways:

  1. Classic C++: created file structure with .cpp and .h files
  2. All .ino files cobine in one big .cpp file
  3. Using PIO option “Import Arduino Project”.

In all three ways, i have the same error:

Linking .pio\build\esp32dev\firmware.elf
c:/users/user/.platformio/packages/toolchain-xtensa-esp32/bin/../lib/gcc/xtensa-esp32-elf/8.4.0/../../../../xtensa-esp32-elf/bin/ld.exe: .pio\build\esp32dev\firmware.elf section `.dram0.bss' will not fit in region `dram0_0_seg'
c:/users/user/.platformio/packages/toolchain-xtensa-esp32/bin/../lib/gcc/xtensa-esp32-elf/8.4.0/../../../../xtensa-esp32-elf/bin/ld.exe: DRAM segment data does not fit.
c:/users/user/.platformio/packages/toolchain-xtensa-esp32/bin/../lib/gcc/xtensa-esp32-elf/8.4.0/../../../../xtensa-esp32-elf/bin/ld.exe: DRAM segment data does not fit.
c:/users/user/.platformio/packages/toolchain-xtensa-esp32/bin/../lib/gcc/xtensa-esp32-elf/8.4.0/../../../../xtensa-esp32-elf/bin/ld.exe: region `dram0_0_seg' overflowed by 488 bytes
collect2.exe: error: ld returned 1 exit status
*** [.pio\build\esp32dev\firmware.elf] Error 1

But in Arduino IDE its project compiling and working well.

If You want to check this project, keep in mind - its project for ESP32 1.xx version. For ESP32 versions 2.xx need the little change. The line:

i2s_read_bytes(I2S_NUM_0, (char*)&i2s_buff[i * NUM_SAMPLES], NUM_SAMPLES * sizeof(uint16_t), portMAX_DELAY);

change to:

size_t bytes = 0;    
   i2s_read(I2S_NUM_0, (char*)&i2s_buff[i * NUM_SAMPLES],  NUM_SAMPLES * sizeof(uint16_t), &bytes, portMAX_DELAY); 

With which Arduino-ESP32 core version and Tools settings does it compile correctly in the Arduino IDE?

Thank You, I cheked its.
Yes, You are wright. This project compile correctly only when ESP32 core version 2.05 or lover.
With ESP32 core version 2.06 and 2.07 Arduino IDE has some errors

If 2.0.5 is fine then you could do platform = 5.2.0 in the platformio.ini.

2 Likes

Dear friend,
in platformio.ini (> $HOME/PlatformIO/Projects/Esp32-Oscilloscope/platformio.ini) I replaced

platform = espressif32
with this
platform = 5.2.0

and generates this error

Resolving esp32dev dependencies...
Platform Manager: Installing 5.2.0
Error: Could not find the package with '5.2.0' requirements for your system 'linux_x86_64'

can you explain exactly which file to modify for setting platform = 5.2.0

Postscriptum: in my case [overflowed by 232 byte] and PLATFORM: Espressif 32 (6.0.1)

Processing esp32dev (platform: espressif32; board: esp32dev; framework: arduino)
---------------------------------------------------------------------------------------------------------------------------
Verbose mode can be enabled via `-v, --verbose` option
CONFIGURATION: https://docs.platformio.org/page/boards/espressif32/esp32dev.html
PLATFORM: Espressif 32 (6.0.1) > Espressif ESP32 Dev Module
HARDWARE: ESP32 240MHz, 320KB RAM, 4MB Flash
DEBUG: Current (cmsis-dap) External (cmsis-dap, esp-bridge, esp-prog, iot-bus-jtag, jlink, minimodule, olimex-arm-usb-ocd, olimex-arm-usb-ocd-h, olimex-arm-usb-tiny-h, olimex-jtag-tiny, tumpa)
PACKAGES: 
 - framework-arduinoespressif32 @ 3.20006.221224 (2.0.6) 
 - tool-esptoolpy @ 1.40400.0 (4.4.0) 
 - toolchain-xtensa-esp32 @ 8.4.0+2021r2-patch5
LDF: Library Dependency Finder -> https://bit.ly/configure-pio-ldf
LDF Modes: Finder ~ chain, Compatibility ~ soft
Found 35 compatible libraries
Scanning dependencies...
Dependency Graph
|-- SPI @ 2.0.0
|-- TFT_eSPI @ 2.4.51
|   |-- SPI @ 2.0.0
|   |-- SPIFFS @ 2.0.0
|   |   |-- FS @ 2.0.0
|   |-- FS @ 2.0.0
|   |-- LittleFS @ 2.0.0
|   |   |-- FS @ 2.0.0
Building in release mode
Linking .pio/build/esp32dev/firmware.elf
/home/dirigente/.platformio/packages/toolchain-xtensa-esp32/bin/../lib/gcc/xtensa-esp32-elf/8.4.0/../../../../xtensa-esp32-elf/bin/ld: .pio/build/esp32dev/firmware.elf section `.dram0.bss' will not fit in region `dram0_0_seg'
/home/dirigente/.platformio/packages/toolchain-xtensa-esp32/bin/../lib/gcc/xtensa-esp32-elf/8.4.0/../../../../xtensa-esp32-elf/bin/ld: DRAM segment data does not fit.
/home/dirigente/.platformio/packages/toolchain-xtensa-esp32/bin/../lib/gcc/xtensa-esp32-elf/8.4.0/../../../../xtensa-esp32-elf/bin/ld: DRAM segment data does not fit.
/home/dirigente/.platformio/packages/toolchain-xtensa-esp32/bin/../lib/gcc/xtensa-esp32-elf/8.4.0/../../../../xtensa-esp32-elf/bin/ld: region `dram0_0_seg' overflowed by 232 bytes
collect2: error: ld returned 1 exit status
*** [.pio/build/esp32dev/firmware.elf] Error 1

Best regards
Salvatore

There is no platform named “5.2.0”. However, there is espressif32 at the version 5.2.0, which you write as espressif32@5.2.0, as written in the official documentation.