Menu

#23 ESP32: DRAM segment data does not fit

trunk
open
ESP32 (1)
5
2020-04-17
2018-10-30
Klaus
No

I tried to integrate the ESP32 port into the recent CMake-based build system for the ESP32. After some minor tweaks on pots/lwip/net.h and ports/esp32/src/device.c I was able to compile the example given in teh esp32Port without errors.
However, the linker complains about a too large DRAM segment:

Linking CXX executable bacnetsmartactor.elf
FAILED: bacnetsmartactor.elf
cmd.exe /C "cd . && C:\esp32\idftools\tools\bin\xtensa-esp32-elf-g++.exe    -nostdlib CMakeFiles/bacnetsmartactor.elf.dir/dummy_main_src.c.obj  -o bacnetsmartactor.elf  -Wl,--gc-sections -Wl,--cref -Wl,--Map=bacnetsmartactor.map -Wl,--start-group soc/libsoc.a log/liblog.a heap/libheap.a xtensa-debug-module/libxtensa-debug-module.a app_trace/libapp_trace.a freertos/libfreertos.a vfs/libvfs.a newlib/libnewlib.a esp_ringbuf/libesp_ringbuf.a driver/libdriver.a esp_event/libesp_event.a ethernet/libethernet.a lwip/liblwip.a tcpip_adapter/libtcpip_adapter.a app_update/libapp_update.a spi_flash/libspi_flash.a mbedtls/libmbedtls.a micro-ecc/libmicro-ecc.a bootloader_support/libbootloader_support.a nvs_flash/libnvs_flash.a pthread/libpthread.a smartconfig_ack/libsmartconfig_ack.a wpa_supplicant/libwpa_supplicant.a esp32/libesp32.a cxx/libcxx.a bacnet-stack/libbacnet-stack.a asio/libasio.a jsmn/libjsmn.a coap/libcoap.a console/libconsole.a nghttp/libnghttp.a esp-tls/libesp-tls.a esp_adc_cal/libesp_adc_cal.a tcp_transport/libtcp_transport.a esp_http_client/libesp_http_client.a esp_http_server/libesp_http_server.a esp_https_ota/libesp_https_ota.a expat/libexpat.a wear_levelling/libwear_levelling.a sdmmc/libsdmmc.a fatfs/libfatfs.a freemodbus/libfreemodbus.a json/libjson.a libsodium/liblibsodium.a mdns/libmdns.a mqtt/libmqtt.a openssl/libopenssl.a protobuf-c/libprotobuf-c.a protocomm/libprotocomm.a spiffs/libspiffs.a ulp/libulp.a wifi_provisioning/libwifi_provisioning.a main/libmain.a -lgcov -Wl,--undefined=uxTopUsedPriority -L C:/esp32/esp-idf/components/newlib/lib -lc -lm -L C:/esp32/esp-idf/components/esp32/lib -lcoexist -lcore -lespnow -lmesh -lnet80211 -lphy -lpp -lrtc -lsmartconfig -lwpa2 -lwpa -lwps -L C:/esp32/bacnetsmartactor/build/esp32 -T esp32_out.ld -L C:/esp32/esp-idf/components/esp32/ld -T esp32.common.ld -T esp32.rom.ld -T esp32.peripherals.ld -T esp32.rom.libgcc.ld -T esp32.rom.spiram_incompatible_fns.ld C:/esp32/esp-idf/components/esp32/libhal.a -lgcc -u call_user_start_cpu0 -u ld_include_panic_highint_hdl -lstdc++ -u __cxa_guard_dummy -u __cxx_fatal_exception && cd ."
c:/esp32/idftools/tools/bin/../lib/gcc/xtensa-esp32-elf/5.2.0/../../../../xtensa-esp32-elf/bin/ld.exe: bacnetsmartactor.elf section `.dram0.bss' will not fit in region `dram0_0_seg'
c:/esp32/idftools/tools/bin/../lib/gcc/xtensa-esp32-elf/5.2.0/../../../../xtensa-esp32-elf/bin/ld.exe: DRAM segment data does not fit.
c:/esp32/idftools/tools/bin/../lib/gcc/xtensa-esp32-elf/5.2.0/../../../../xtensa-esp32-elf/bin/ld.exe: region `dram0_0_seg' overflowed by 276400 bytes
collect2.exe: error: ld returned 1 exit status
ninja: build stopped: subcommand failed.
ninja failed with exit code 1

Do you have any advice how to solve this?

Thank you in advance!

Discussion

  • Klaus

    Klaus - 2018-11-08

    I successfully solved this issue on my own. Using https://esp32.com/viewtopic.php?t=3059 I learned how to read the <project_name>.map file and I found out, that tsm.c, Array TSM_List caused a huge memory allocation. Unfortunately, my setting of "MAX_TSM_TRANSACTIONS=10" in a CMakeLists.txt had no effect:-( So I changed this directly in config.h....and compilation was successful :-)</project_name>

     
  • Anonymous

    Anonymous - 2019-06-15

    can u explain where <project_name>.map? i'am not found it </project_name>

     
  • Anonymous

    Anonymous - 2020-04-17

    Hi @Klaus,
    I'm also trying to compile Bacnet for ESP32. But I have no chance to get it done. Maybe you can tell us wich tweaks are needed to get it working?

     

Anonymous
Anonymous

Add attachments
Cancel