Open UmbraMalison opened 1 week ago
Hi @UmbraMalison! We appreciate you submitting your first issue for our open-source project. 🌟
Even though I'm a bot, I can assure you that the whole community is genuinely grateful for your time and effort. 🤖💙
I took a brief look at this, I don't think this really has anything to do with the ADC and more with the ALWAYS_INLINE
flag being used. Specifically I believe in LTO builds that flag probably would do better to evaluate out to just the inline
flag (which is more a compiler hint/suggestion) and not the attribute(always_inline)
(which is more a demand on the compiler) as the LTO process really doesn't like competition with determining who/what to inline.
Description ZEPHYR-v3.6.0 release notes indicate the availability of Link-Time-Optimisations, which were suggested to me as a opportunity to reduce ROM size. In release mode, (without CONFIG_DEBUG_OPTIMIZATIONS) LTO saved me about 3KB (from a flash size of 32KB, so I was very happy).
My project compiles just fine with the following options:
or with:
but ADC will error when LTO is combined with DEBUG_OPTIMIZATIONS:
To Reproduce Steps to reproduce the behavior:
west build -b nucleo_g071rb .\samples\basic\blinky\ --pristine -- -DCONFIG_ADC=y -DCONFIG_DEBUG_OPTIMIZATIONS=y -DCONFIG_LTO=y -DCONFIG_ISR_TABLES_LOCAL_DECLARATION=y
Expected behavior Expected the build to complete with same or less flash utilisation for debugging/development builds.
Impact without LTO, on this uC (32KB) it's much closer to overflowing the flash available. For debugging, I need more space for debug symbols. Without LTO: 89%, with LTO it's 83%. With debugging optimisations it's 98%, if LTO can help achieve the same improvements then I might see 92% with debug symbols - which would be great.
Logs and console output None
Environment (please complete the following information):