2023-01-24 12:03 PM
Hi,
I am trying to add new folders in CubeIDE and get them compiled.
Taking STM32CubeU5 as an example.
I imported a GPIO example, under the file tree, it will show:
--include
--Application
--Startup
--User
--Drivers
--BSP
--CMSIS
--STM32U5xx_HAL_Driver
Now, what I want to do is to change the folders under Application folder:
--Application
--api
--inc
--src
--test
--inc
--src (contains main.c)
In order to make this structure work, how do I modify the project settings?
Thank you for the help
Solved! Go to Solution.
2023-02-07 04:40 AM
Your Makefile will need to include compiler options to include debugging information in the .o and .elf files and will also want to disable or reduce compiler optimizations. Here's a snippet that I used:
# debug build?
DEBUG ?= yes
# optimization
ifeq ($(DEBUG),yes)
OPT = -O0 -ggdb3 -gdwarf
else
OPT = -Os
endif
2023-01-24 12:19 PM
Also I have a working project, and would like to import it into CubeIDE by the option"Existing Code as Makefile Project". How do I configure it so that I can use ST-Link for debugging?
2023-01-24 01:35 PM
Please see the CubeIDE User manual (UM2609) ch. 3.8. This will create new makefile-based Eclipse project and let you debug the executable produced by your makefile.
2023-02-07 04:40 AM
Your Makefile will need to include compiler options to include debugging information in the .o and .elf files and will also want to disable or reduce compiler optimizations. Here's a snippet that I used:
# debug build?
DEBUG ?= yes
# optimization
ifeq ($(DEBUG),yes)
OPT = -O0 -ggdb3 -gdwarf
else
OPT = -Os
endif
2023-02-07 10:02 AM
The easy method is to add the folders outside the IDE, and once you have the structure you want, just right click on the project in project explorer, select refresh and the newly added files will be added to your project