Memory Overflow Issue on ESP32-C3 DevKit (Wi-Fi, HTTP with TLS, Firmware Update); Zephyr version: 4.1.99 #93548
Unanswered
pawankumar0099
asked this question in
Q&A
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Hi everyone,
I'm building an application on the ESP32-C3 DevKit that includes Wi-Fi, HTTP with TLS, and a firmware update section. I'm using examples from the zephyr samples as a reference.
However, I'm now running into a memory overflow issue, particularly related to DRAM usage.
Is there any way to optimize the memory layout — like reducing the DRAM usage or shifting some parts to IRAM instead? I’m stuck and would really appreciate suggestions or best practices to resolve this.
Logs:
-- west build: making build dir /home/pawan/zephyrproject/zephyr/build pristine
-- west build: generating a build system
Loading Zephyr default modules (Zephyr base).
-- Application: /home/pawan/zephyrproject/htttps_ota/hello_world
-- CMake version: 3.22.1
-- Found Python3: /home/pawan/zephyrproject/.venv/bin/python3 (found suitable version "3.10.12", minimum required is "3.10") found components: Interpreter
-- Cache files will be written to: /home/pawan/.cache/zephyr
-- Zephyr version: 4.1.99 (/home/pawan/zephyrproject/zephyr)
-- Found west (found suitable version "1.4.0", minimum required is "0.14.0")
-- Board: esp32c3_devkitm, qualifiers: esp32c3
-- ZEPHYR_TOOLCHAIN_VARIANT not set, trying to locate Zephyr SDK
-- Found host-tools: zephyr 0.17.1 (/home/pawan/zephyr-sdk-0.17.1)
-- Found toolchain: zephyr 0.17.1 (/home/pawan/zephyr-sdk-0.17.1)
-- Found Dtc: /home/pawan/zephyr-sdk-0.17.1/sysroots/x86_64-pokysdk-linux/usr/bin/dtc (found suitable version "1.7.0", minimum required is "1.4.6")
-- Found BOARD.dts: /home/pawan/zephyrproject/zephyr/boards/espressif/esp32c3_devkitm/esp32c3_devkitm.dts
-- Found devicetree overlay: /home/pawan/zephyrproject/htttps_ota/hello_world/boards/esp32c3_devkitm.overlay
-- Generated zephyr.dts: /home/pawan/zephyrproject/zephyr/build/zephyr/zephyr.dts
-- Generated pickled edt: /home/pawan/zephyrproject/zephyr/build/zephyr/edt.pickle
-- Generated devicetree_generated.h: /home/pawan/zephyrproject/zephyr/build/zephyr/include/generated/zephyr/devicetree_generated.h
Parsing /home/pawan/zephyrproject/zephyr/Kconfig
Loaded configuration '/home/pawan/zephyrproject/zephyr/boards/espressif/esp32c3_devkitm/esp32c3_devkitm_defconfig'
Merged configuration '/home/pawan/zephyrproject/htttps_ota/hello_world/prj.conf'
Merged configuration '/home/pawan/zephyrproject/htttps_ota/hello_world/overlay-tls.conf'
Configuration saved to '/home/pawan/zephyrproject/zephyr/build/zephyr/.config'
Kconfig header saved to '/home/pawan/zephyrproject/zephyr/build/zephyr/include/generated/zephyr/autoconf.h'
-- Found GnuLd: /home/pawan/zephyr-sdk-0.17.1/riscv64-zephyr-elf/riscv64-zephyr-elf/bin/ld.bfd (found version "2.38")
-- The C compiler identification is GNU 12.2.0
-- The CXX compiler identification is GNU 12.2.0
-- The ASM compiler identification is GNU
-- Found assembler: /home/pawan/zephyr-sdk-0.17.1/riscv64-zephyr-elf/bin/riscv64-zephyr-elf-gcc
-- Espressif HAL path: /home/pawan/zephyrproject/modules/hal/espressif
-- Image partition /soc/flash-controller@60002000/flash@0/partitions/partition@20000
-- Found gen_kobject_list: /home/pawan/zephyrproject/zephyr/scripts/build/gen_kobject_list.py
-- Including signing script: /home/pawan/zephyrproject/zephyr/cmake/mcuboot.cmake
-- Configuring done
-- Generating done
-- Build files have been written to: /home/pawan/zephyrproject/zephyr/build
-- west build: building application
[1/582] Preparing syscall dependency handling
[2/582] Generating include/generated/zephyr/app_version.h
-- git describe failed: fatal: not a git repository (or any of the parent directories): .git
[4/582] Generating include/generated/zephyr/version.h
-- Zephyr version: 4.1.99 (/home/pawan/zephyrproject/zephyr), build: v4.1.0-5752-ga4f702b85753
[577/582] Linking C executable zephyr/zephyr_pre0.elf
FAILED: zephyr/zephyr_pre0.elf zephyr/zephyr_pre0.map /home/pawan/zephyrproject/zephyr/build/zephyr/zephyr_pre0.map
: && /home/pawan/zephyr-sdk-0.17.1/riscv64-zephyr-elf/bin/riscv64-zephyr-elf-gcc -gdwarf-4 zephyr/CMakeFiles/zephyr_pre0.dir/misc/empty_file.c.obj -o zephyr/zephyr_pre0.elf zephyr/CMakeFiles/offsets.dir/./arch/riscv/core/offsets/offsets.c.obj -T zephyr/linker_zephyr_pre0.cmd -Wl,-Map=/home/pawan/zephyrproject/zephyr/build/zephyr/zephyr_pre0.map -Wl,--whole-archive app/libapp.a zephyr/libzephyr.a zephyr/arch/common/libarch__common.a zephyr/arch/arch/riscv/core/libarch__riscv__core.a zephyr/lib/libc/picolibc/liblib__libc__picolibc.a zephyr/lib/libc/common/liblib__libc__common.a zephyr/lib/posix/options/liblib__posix__options.a zephyr/lib/net_buf/liblib__net_buf.a zephyr/lib/os/zvfs/liblib__os__zvfs.a zephyr/subsys/fs/libsubsys__fs.a zephyr/subsys/random/libsubsys__random.a zephyr/subsys/dfu/boot/libsubsys__dfu__boot.a zephyr/subsys/net/libsubsys__net.a zephyr/subsys/net/l2/ethernet/libsubsys__net__l2__ethernet.a zephyr/subsys/net/l2/wifi/libsubsys__net__l2__wifi.a zephyr/subsys/net/ip/libsubsys__net__ip.a zephyr/subsys/net/lib/config/libsubsys__net__lib__config.a zephyr/subsys/net/lib/dhcpv4/libsubsys__net__lib__dhcpv4.a zephyr/subsys/net/lib/dns/libsubsys__net__lib__dns.a zephyr/subsys/net/lib/http/libsubsys__net__lib__http.a zephyr/drivers/interrupt_controller/libdrivers__interrupt_controller.a zephyr/drivers/clock_control/libdrivers__clock_control.a zephyr/drivers/console/libdrivers__console.a zephyr/drivers/entropy/libdrivers__entropy.a zephyr/drivers/flash/libdrivers__flash.a zephyr/drivers/gpio/libdrivers__gpio.a zephyr/drivers/hwinfo/libdrivers__hwinfo.a zephyr/drivers/pinctrl/libdrivers__pinctrl.a zephyr/drivers/serial/libdrivers__serial.a zephyr/drivers/timer/libdrivers__timer.a zephyr/drivers/wifi/libdrivers__wifi.a modules/mbedtls/libmbedTLSBase.a modules/mbedtls/libmbedTLSCrypto.a modules/mbedtls/libmbedTLSX509.a modules/mbedtls/libmodules__mbedtls.a modules/mcuboot/libmcuboot_util.a -Wl,--no-whole-archive zephyr/kernel/libkernel.a -L/home/pawan/zephyrproject/zephyr/build/zephyr zephyr/arch/common/libisr_tables.a modules/mbedtls/libmbedTLSBase.a modules/mbedtls/libmbedTLSCrypto.a modules/mbedtls/libmbedTLSX509.a -mabi=ilp32 -march=rv32imc_zicsr -fuse-ld=bfd -Wl,--gc-sections -Wl,--build-id=none -Wl,--sort-common=descending -Wl,--sort-section=alignment -Wl,-u,_OffsetAbsSyms -Wl,-u,_ConfigAbsSyms -nostdlib -static -Wl,-X -Wl,-N -Wl,--orphan-handling=warn -Wl,-no-pie -specs=picolibc.specs -DPICOLIBC_LONG_LONG_PRINTF_SCANF -T/home/pawan/zephyrproject/modules/hal/espressif/zephyr/esp32c3/src/linker/esp32c3.rom.alias.ld -T/home/pawan/zephyrproject/modules/hal/espressif/zephyr/esp32c3/../../components/esp_rom/esp32c3/ld/esp32c3.rom.ld -T/home/pawan/zephyrproject/modules/hal/espressif/zephyr/esp32c3/../../components/esp_rom/esp32c3/ld/esp32c3.rom.api.ld -T/home/pawan/zephyrproject/modules/hal/espressif/zephyr/esp32c3/../../components/esp_rom/esp32c3/ld/esp32c3.rom.libgcc.ld -T/home/pawan/zephyrproject/modules/hal/espressif/zephyr/esp32c3/../../components/esp_rom/esp32c3/ld/esp32c3.rom.newlib.ld -T/home/pawan/zephyrproject/modules/hal/espressif/zephyr/esp32c3/../../components/esp_rom/esp32c3/ld/esp32c3.rom.version.ld -T/home/pawan/zephyrproject/modules/hal/espressif/zephyr/esp32c3/../../components/soc/esp32c3/ld/esp32c3.peripherals.ld -T/home/pawan/zephyrproject/modules/hal/espressif/zephyr/esp32c3/../../components/esp_rom/esp32c3/ld/esp32c3.rom.eco3.ld -lgcc -lnet80211 -lcore -lpp -lphy -lmesh -lgcc -lnet80211 -lcore -lpp -lphy -lmesh -L/home/pawan/zephyrproject/modules/hal/espressif/zephyr/esp32c3/../blobs/lib/esp32c3 -L"/home/pawan/zephyr-sdk-0.17.1/riscv64-zephyr-elf/bin/../lib/gcc/riscv64-zephyr-elf/12.2.0" -lc -lgcc && cd /home/pawan/zephyrproject/zephyr/build/zephyr && /usr/bin/cmake -E true
/home/pawan/zephyr-sdk-0.17.1/riscv64-zephyr-elf/bin/../lib/gcc/riscv64-zephyr-elf/12.2.0/../../../../riscv64-zephyr-elf/bin/ld.bfd: zephyr/zephyr_pre0.elf section
.dram0.bss' will not fit in region
dram0_0_seg'/home/pawan/zephyr-sdk-0.17.1/riscv64-zephyr-elf/bin/../lib/gcc/riscv64-zephyr-elf/12.2.0/../../../../riscv64-zephyr-elf/bin/ld.bfd: SRAM instruction/data does not fit.
/home/pawan/zephyr-sdk-0.17.1/riscv64-zephyr-elf/bin/../lib/gcc/riscv64-zephyr-elf/12.2.0/../../../../riscv64-zephyr-elf/bin/ld.bfd: region `dram0_0_seg' overflowed by 1520 bytes
collect2: error: ld returned 1 exit status
ninja: build stopped: subcommand failed.
Beta Was this translation helpful? Give feedback.
All reactions