project structure changes when switching from debug to release mode
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2023-10-29 7:40 PM
I have a compilation error when I switch from debug mode to release mode, as showed in the pic below:
What did I miss?
Solved! Go to Solution.
- Labels:
-
STM32CubeIDE
Accepted Solutions
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2023-10-29 9:48 PM
Check the Include Paths settings for the "Release" build vs prior "Debug" ones that worked and found the include file.
Up vote any posts that you find helpful, it shows what's working..
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2023-10-29 9:37 PM - edited ‎2023-10-29 9:38 PM
Below are the compiling commands:
- Debug compiling command:
arm-none-eabi-gcc "../Core/Src/main.c" -mcpu=cortex-m4 -std=gnu11 -g3 -DDEBUG -DUSE_HAL_DRIVER -DSTM32F411xE -DUSE_FULL_LL_DRIVER -c -I../Core/Inc -I../Drivers/STM32F4xx_HAL_Driver/Inc -I../Drivers/STM32F4xx_HAL_Driver/Inc/Legacy -I../Drivers/CMSIS/Device/ST/STM32F4xx/Include -I../Drivers/CMSIS/Include -I"D:/ST/workspace_CoTSHM/I2C_HAL/FATFS/App" -I"D:/ST/workspace_CoTSHM/I2C_HAL/FATFS/Target" -I"D:/ST/workspace_CoTSHM/I2C_HAL/Middlewares/Third_Party/FatFs/src" -O0 -ffunction-sections -fdata-sections -Wall -fstack-usage -MMD -MP -MF"Core/Src/main.d" -MT"Core/Src/main.o" --specs=nano.specs -mfloat-abi=hard -mthumb -o "Core/Src/main.o" - Release compiling command:
arm-none-eabi-gcc "../Core/Src/main.c" -mcpu=cortex-m4 -std=gnu11 -DUSE_HAL_DRIVER -DSTM32F411xE -DUSE_FULL_LL_DRIVER -c -I../Core/Inc -I../Drivers/STM32F4xx_HAL_Driver/Inc -I../Drivers/STM32F4xx_HAL_Driver/Inc/Legacy -I../Drivers/CMSIS/Device/ST/STM32F4xx/Include -I../Drivers/CMSIS/Include -Os -ffunction-sections -fdata-sections -Wall -fstack-usage -MMD -MP -MF"Core/Src/main.d" -MT"Core/Src/main.o" --specs=nano.specs -mfpu=fpv4-sp-d16 -mfloat-abi=hard -mthumb -o "Core/Src/main.o"
In the release case, two folders were omitted strangely by the IDE.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2023-10-29 9:48 PM
Check the Include Paths settings for the "Release" build vs prior "Debug" ones that worked and found the include file.
Up vote any posts that you find helpful, it shows what's working..
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2023-10-29 10:02 PM
I thought IDE would take care of that. :thinking_face:
I just did and the compilation error is gone; but got error of undefined reference to a few functions. I guess there is still some diff in setting details.
I am trying to optimize my code to increase its running speed.
- Do you have any good reference or guideline on how to do it, @Tesla DeLorean ?
- Generally how much faster can release mode achieve than debug one?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2023-10-29 10:18 PM
Depends, the IDE treats the two contexts differently, so if you, or whomever created the project, add paths to one they won't automatically appear in the other.
The Release built typically enables optimization, removes assert and other verbose debug information. How much it improves things depends on the code, but it should shrink the size, and increase the speed in measurable amounts. Review the .MAP file output, and perhaps benchmark your critical code.
Up vote any posts that you find helpful, it shows what's working..
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2023-10-30 1:38 AM
It looks to me Debug and Release are two totally different projects.
I have to add source folders other than Core and Drivers manually to project Release mode. Otherwise, IDE won't compile them, thus leading to linking errors.
