Hi,
I tried to search on the forum but could not find the info.
I wrote a code for the esp32d that works well in debug mode. I try to compile in release mode and I get an error message about iram overflow. I was always thinking that a code for debug was always bigger than a release one… ? There might be different flags for optimization , and I read o2 is the fastest, but maybe gives a larger code. Any hint appreciated. Thanks
Code links in debug mode but not in release
Re: Code links in debug mode but not in release
To be more precise I compile the code using vscode and pkatformio. In platformio.ini you have a flag for build_type and I either set it to debug and the code links and runs or release and then I get a linker error with iram overflow.
This seems redundant with menu config where we can also select the code optimization. I will try menu config to see whether or not I get the same result.
This seems redundant with menu config where we can also select the code optimization. I will try menu config to see whether or not I get the same result.
-
MicroController
- Posts: 2661
- Joined: Mon Oct 17, 2022 7:38 pm
- Location: Europe, Germany
Re: Code links in debug mode but not in release
It often is. However, there are also opposite effects. For instance, in release/performance-optimizing mode, (more) inlining of function calls takes place, which can increase the size of the calling functions..I was always thinking that a code for debug was always bigger than a release one… ?
The increased use of IRAM you observe may also indicate that some IRAM code makes calls to non-IRAM code which becomes IRAM code only through inlining.
Also, some code may conditionally put itself into IRAM for performance if optimizing for speed.
You can try to optimize for code size (-Os) instead of speed (-O2) and see if that makes a difference.
Re: Code links in debug mode but not in release
Hi again
If I go in menuconfig, and selects the o2 directive for the compiler it does compile and link.
If I go in platformio.ini and write build_type=debug it compiles and link. If I write build_type=release it compiles but linker fails with iram overflow.
I suspect the linker script generated is different but I need to check the details. Devil is always in the details .
If I go in menuconfig, and selects the o2 directive for the compiler it does compile and link.
If I go in platformio.ini and write build_type=debug it compiles and link. If I write build_type=release it compiles but linker fails with iram overflow.
I suspect the linker script generated is different but I need to check the details. Devil is always in the details .
Who is online
Users browsing this forum: Amazon [Bot], PerplexityBot, Sprite and 5 guests