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

M5Stack Core2 issue: ESP32-WiFi-Hash-Monster.ino.elf section .dram0.bss' will not fit in region dram0_0_seg' #45

Open
Hans0lo opened this issue Jan 13, 2023 · 2 comments

Comments

@Hans0lo
Copy link

Hans0lo commented Jan 13, 2023

Hi there,
I try to compile on Arduino IDE 2.03, but it fails due to this error:

ESP32-WiFi-Hash-Monster.ino.elf section `.dram0.bss' will not fit in region `dram0_0_seg'
region `dram0_0_seg' overflowed by 1392 bytes
c:/users/user.name/appdata/local/arduino15/packages/m5stack/tools/xtensa-esp32-elf-gcc/gcc8_4_0-esp-2021r2-patch5/bin/../lib/gcc/xtensa-esp32-elf/8.4.0/../../../../xtensa-esp32-elf/bin/ld.exe: C:\Users\user.name\AppData\Local\Temp\arduino-sketch-0A9AEE5B2B635D40CC623E13BC0C4B31/ESP32-WiFi-Hash-Monster.ino.elf section `.dram0.bss' will not fit in region `dram0_0_seg'
c:/users/user.name/appdata/local/arduino15/packages/m5stack/tools/xtensa-esp32-elf-gcc/gcc8_4_0-esp-2021r2-patch5/bin/../lib/gcc/xtensa-esp32-elf/8.4.0/../../../../xtensa-esp32-elf/bin/ld.exe: DRAM segment data does not fit.
c:/users/user.name/appdata/local/arduino15/packages/m5stack/tools/xtensa-esp32-elf-gcc/gcc8_4_0-esp-2021r2-patch5/bin/../lib/gcc/xtensa-esp32-elf/8.4.0/../../../../xtensa-esp32-elf/bin/ld.exe: DRAM segment data does not fit.
c:/users/user.name/appdata/local/arduino15/packages/m5stack/tools/xtensa-esp32-elf-gcc/gcc8_4_0-esp-2021r2-patch5/bin/../lib/gcc/xtensa-esp32-elf/8.4.0/../../../../xtensa-esp32-elf/bin/ld.exe: region `dram0_0_seg' overflowed by 1392 bytes
collect2.exe: error: ld returned 1 exit status
exit status 1

Compilation error: exit status 1

I tried to help myself and found a few hints that point to lv_conf.h:
https://community.platformio.org/t/esp32-ld-region-dram0-0-seg-overflowed-by-156768-bytes/18753/2

and:
lvgl/lv_port_esp32#252

so i tried my luck by editing said lv_conf.h to use less RAM, but sadly no succes, compiling will still throw the same error.
Any idea what else I could do/try to make this work?

thnx in advance!

@Hans0lo Hans0lo changed the title Core2 compliation issue: ESP32-WiFi-Hash-Monster.ino.elf section .dram0.bss' will not fit in region dram0_0_seg' Core2 compilation issue: ESP32-WiFi-Hash-Monster.ino.elf section .dram0.bss' will not fit in region dram0_0_seg' Jan 13, 2023
@Hans0lo Hans0lo changed the title Core2 compilation issue: ESP32-WiFi-Hash-Monster.ino.elf section .dram0.bss' will not fit in region dram0_0_seg' M5Stack Core2 issue: ESP32-WiFi-Hash-Monster.ino.elf section .dram0.bss' will not fit in region dram0_0_seg' Jan 14, 2023
@Hans0lo
Copy link
Author

Hans0lo commented Jan 18, 2023

and I found a solution on my own :)
in case anyone reads this, please check this article:
https://esp32.com/viewtopic.php?t=3059

basically you can check a .map file that (on Windows) you will find in your /temp folder, e.g.:
C:\Users\user.name\AppData\Local\Temp\arduino-sketch-0A9AEE5B2B635D40CC623E13BC0C4B31

and then you open that file in a text editor and search for '.dram0.bss'
after that word you find a list of all variables that affect dram usage.

for this wifi monster the culprit is:
.bss.ssid_known
0x000000003ffc4af8 0x11f00

then searching the source for 'ssid_known' gives us this:
ssid_info ssid_known[MAX_SSIDs];

and then MAX_SSIDs is set to:
#define MAX_SSIDs 1792

I decreased this value to 1750 and then the project compiled and uploaded just fine

@ShortyDeVKit
Copy link

Thanks i have this issue. and i solved.

But on M5StackCore2 AWS LED bars do not work.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants