How to increase .bss size for ULP?

jshnaidm
Posts: 6
Joined: Mon Jul 05, 2021 3:47 am

How to increase .bss size for ULP?

Postby jshnaidm » Sun Jul 18, 2021 9:52 pm

Hi. I'm using the vscode extension to program and build my project. I've used the SDK Configuration editor to increase the RTC slow memory reserved for the coprocessor, but regardless of how high I put it, it always tells me that the ram region overflows by 64 bytes:

Code: Select all

[3/83] Performing build step for 'ulp_main'
FAILED: esp-idf/main/ulp_main-prefix/src/ulp_main-stamp/ulp_main-build esp-idf/main/ulp_main/ulp_main.bin esp-idf/main/ulp_main/ulp_main.ld esp-idf/main/ulp_main/ulp_main.h esp-idf/main/ulp_main/ulp_main.map esp-idf/main/ulp_main/ulp_main.sym esp-idf/main/ulp_main/esp32.ulp.ld esp-idf/main/ulp_main/ulp_main 
cmd.exe /C "cd /D D:\Projects\moist_plants_idf\build\esp-idf\main\ulp_main && C:\Users\jacob\.espressif\tools\cmake\3.16.4\bin\cmake.exe --build D:/Projects/moist_plants_idf/build/esp-idf/main/ulp_main --target build"        
[1/4] Linking ASM executable ulp_main
FAILED: ulp_main 
cmd.exe /C "cd . && esp32ulp-elf-ld                                   -A elf32-esp32ulp -nostdlib CMakeFiles/ulp_main.dir/adc.ulp.S.obj -o ulp_main  -TD:/Projects/moist_plants_idf/build/esp-idf/main/ulp_main/esp32.ulp.ld  -Map=D:/Projects/moist_plants_idf/build/esp-idf/main/ulp_main/ulp_main.map && cd ."
esp32ulp-elf-ld: ulp_main section `.bss' will not fit in region `ram'
esp32ulp-elf-ld: region `ram' overflowed by 64 bytes
ninja: build stopped: subcommand failed.
[4/83] Linking C static library esp-idf\esp_serial_slave_link\libesp_serial_slave_link.a
ninja: build stopped: subcommand failed.
The terminal process "C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe -Command cmake --build ." terminated with exit code: 1.
I can confirm that my sdkconfig has at least 2kb reserved for the ULP:

Code: Select all

CONFIG_ULP_COPROC_ENABLED=y
CONFIG_ULP_COPROC_RESERVE_MEM=2048
How do I allocate more memory for my ulp program? Thanks in advance for any help.

louis___
Posts: 6
Joined: Mon Jul 19, 2021 9:42 am

Re: How to increase .bss size for ULP?

Postby louis___ » Mon Jul 19, 2021 9:46 am

I'm also facing this issue. I see this issue both in Eclipse and using the cmdline tool. I'm using IDF 4.3. My colleague who doesn't see this issue is using 4.2. No matter how I change the sdk config file (either though the Eclipse json file or the cmdline menuconfig) I still see this issue. I don't really want to change version.

felmue
Posts: 70
Joined: Mon Nov 16, 2020 2:55 pm

Re: How to increase .bss size for ULP?

Postby felmue » Mon Jul 19, 2021 5:12 pm

Hello @jshnaidm

when I change the RTC slow memory value via 'menuconfig' I see it in two places:

Code: Select all

sdkconfig:CONFIG_ESP32_ULP_COPROC_RESERVE_MEM=2048
sdkconfig:CONFIG_ULP_COPROC_RESERVE_MEM=2048
It looks like some options have been deprecated and replaced with others: https://docs.espressif.com/projects/esp ... placements
Maybe that is the issue you are facing?

Thanks
Felix

jshnaidm
Posts: 6
Joined: Mon Jul 05, 2021 3:47 am

Re: How to increase .bss size for ULP?

Postby jshnaidm » Mon Jul 19, 2021 11:32 pm

felmue wrote:
Mon Jul 19, 2021 5:12 pm
Hello @jshnaidm

when I change the RTC slow memory value via 'menuconfig' I see it in two places:

Code: Select all

sdkconfig:CONFIG_ESP32_ULP_COPROC_RESERVE_MEM=2048
sdkconfig:CONFIG_ULP_COPROC_RESERVE_MEM=2048
It looks like some options have been deprecated and replaced with others: https://docs.espressif.com/projects/esp ... placements
Maybe that is the issue you are facing?

Thanks
Felix
Ah, I should have included both, but I have those options configured as well.

Code: Select all

CONFIG_ULP_COPROC_ENABLED=y
CONFIG_ULP_COPROC_RESERVE_MEM=2048
CONFIG_ESP32_ULP_COPROC_ENABLED=y
CONFIG_ESP32_ULP_COPROC_RESERVE_MEM=2048

ESP-Marius
Posts: 74
Joined: Wed Oct 23, 2019 1:49 am

Re: How to increase .bss size for ULP?

Postby ESP-Marius » Tue Jul 20, 2021 1:46 am

Code: Select all

CONFIG_ESP32_ULP_COPROC_RESERVE_MEM
Should be the correct way of increasing it. Any chance CONFIG_ESP32S2_ULP_COPROC_RESERVE_MEM is defined in your sdkconfig as well? That could potentially overwrite the setting.

Are you able to provide a simple example that reproduce this behaviour? If so I'd be happy to take a look at what's going wrong.

jshnaidm
Posts: 6
Joined: Mon Jul 05, 2021 3:47 am

Re: How to increase .bss size for ULP?

Postby jshnaidm » Tue Jul 20, 2021 6:09 am

ESP-Marius wrote:
Tue Jul 20, 2021 1:46 am

Code: Select all

CONFIG_ESP32_ULP_COPROC_RESERVE_MEM
Should be the correct way of increasing it. Any chance CONFIG_ESP32S2_ULP_COPROC_RESERVE_MEM is defined in your sdkconfig as well? That could potentially overwrite the setting.

Are you able to provide a simple example that reproduce this behaviour? If so I'd be happy to take a look at what's going wrong.
In the process of committing my code to a github repository to share my example, I cleaned my project. After I made the commit I tried rebuilding, and I can't reproduce the error anymore. I didn't have CONFIG_ESP32S2_ULP_COPROC_RESERVE_MEM defined or anything. Odd! Doing a clean build has solved so many problems for me in the past, I don't know why I didn't try it earlier.

Thanks for the help.
Jacob

Who is online

Users browsing this forum: No registered users and 199 guests