I've working in firmware programming with STM32 and VSCode.
My actual situation in extensions in VScode are: C/C++, cmake, cmake-tools, STM32 VS Code extension, and cortex-debug.
As "STM32 VS Code extension" I've intalled the program STM32CubeIDE and STM32CubeMX.
I've created the project by STM32CubeMX and I modify my CMakeFileList.txt.
This is my project estructure:
TFT_STM32
├─ .cproject
├─ .mxproject
├─ .project
├─ .settings
│ ├─ language.settings.xml
│ └─ stm32cubeide.project.prefs
├─ .vs
│ └─ launch.vs.json
├─ .vscode
│ ├─ extensions.json
│ ├─ launch.json
│ ├─ settings.json
│ └─ tasks.json
├─ build
│ └─ release
│ └─ build
│ ├─ .cmake
│ │ └─ api
│ │ └─ v1
│ │ ├─ query
│ │ │ └─ client-vscode
│ │ │ └─ query.json
│ │ └─ reply
│ │ ├─ cache-v2-45a28c30da73a9f50c5f.json
│ │ ├─ cmakeFiles-v1-41116acbc216fa81de8e.json
│ │ ├─ codemodel-v2-45a7f5e4f1b4419b5be9.json
│ │ ├─ directory-.-Release-d0094a50bb2071803777.json
│ │ ├─ index-2023-12-04T11-32-04-0433.json
│ │ ├─ target-TFT_STM32-Release-74a645a5d2f455f874dc.json
│ │ └─ toolchains-v1-7576d739f273a178801d.json
│ ├─ .ninja_deps
│ ├─ .ninja_log
│ ├─ build.ninja
│ ├─ CMakeCache.txt
│ ├─ CMakeFiles
│ │ ├─ 3.20.0
│ │ │ ├─ CMakeASMCompiler.cmake
│ │ │ ├─ CMakeCCompiler.cmake
│ │ │ ├─ CMakeCXXCompiler.cmake
│ │ │ ├─ CMakeDetermineCompilerABI_C.bin
│ │ │ ├─ CMakeDetermineCompilerABI_CXX.bin
│ │ │ ├─ CMakeSystem.cmake
│ │ │ ├─ CompilerIdASM
│ │ │ ├─ CompilerIdC
│ │ │ │ ├─ CMakeCCompilerId.c
│ │ │ │ ├─ CMakeCCompilerId.o
│ │ │ │ └─ tmp
│ │ │ └─ CompilerIdCXX
│ │ │ ├─ CMakeCXXCompilerId.cpp
│ │ │ ├─ CMakeCXXCompilerId.o
│ │ │ └─ tmp
│ │ ├─ 3.28.0-rc5
│ │ │ ├─ CMakeASMCompiler.cmake
│ │ │ ├─ CMakeCCompiler.cmake
│ │ │ ├─ CMakeCXXCompiler.cmake
│ │ │ ├─ CMakeDetermineCompilerABI_C.bin
│ │ │ ├─ CMakeDetermineCompilerABI_CXX.bin
│ │ │ ├─ CMakeSystem.cmake
│ │ │ ├─ CompilerIdASM
│ │ │ ├─ CompilerIdC
│ │ │ │ ├─ CMakeCCompilerId.c
│ │ │ │ ├─ CMakeCCompilerId.o
│ │ │ │ └─ tmp
│ │ │ └─ CompilerIdCXX
│ │ │ ├─ CMakeCXXCompilerId.cpp
│ │ │ ├─ CMakeCXXCompilerId.o
│ │ │ └─ tmp
│ │ ├─ cmake.check_cache
│ │ ├─ CMakeConfigureLog.yaml
│ │ ├─ CMakeError.log
│ │ ├─ CMakeOutput.log
│ │ ├─ CMakeTmp
│ │ ├─ pkgRedirects
│ │ ├─ rules.ninja
│ │ ├─ TargetDirectories.txt
│ │ └─ TFT_STM32.dir
│ │ ├─ CMakeFiles
│ │ │ ├─ 3.20.0
│ │ │ │ └─ CompilerIdC
│ │ │ └─ 3.28.0-rc5
│ │ │ └─ CompilerIdC
│ │ ├─ Core
│ │ │ ├─ Src
│ │ │ │ ├─ main.c.obj
│ │ │ │ ├─ stm32f4xx_hal_msp.c.obj
│ │ │ │ ├─ stm32f4xx_it.c.obj
│ │ │ │ ├─ syscalls.c.obj
│ │ │ │ ├─ sysmem.c.obj
│ │ │ │ └─ system_stm32f4xx.c.obj
│ │ │ ├─ st7735
│ │ │ └─ Startup
│ │ │ └─ startup_stm32f411ceux.s.obj
│ │ ├─ Drivers
│ │ │ └─ STM32F4xx_HAL_Driver
│ │ │ └─ Src
│ │ │ ├─ stm32f4xx_hal.c.obj
│ │ │ ├─ stm32f4xx_hal_cortex.c.obj
│ │ │ ├─ stm32f4xx_hal_dma.c.obj
│ │ │ ├─ stm32f4xx_hal_dma_ex.c.obj
│ │ │ ├─ stm32f4xx_hal_exti.c.obj
│ │ │ ├─ stm32f4xx_hal_flash.c.obj
│ │ │ ├─ stm32f4xx_hal_flash_ex.c.obj
│ │ │ ├─ stm32f4xx_hal_flash_ramfunc.c.obj
│ │ │ ├─ stm32f4xx_hal_gpio.c.obj
│ │ │ ├─ stm32f4xx_hal_i2c.c.obj
│ │ │ ├─ stm32f4xx_hal_i2c_ex.c.obj
│ │ │ ├─ stm32f4xx_hal_pcd.c.obj
│ │ │ ├─ stm32f4xx_hal_pcd_ex.c.obj
│ │ │ ├─ stm32f4xx_hal_pwr.c.obj
│ │ │ ├─ stm32f4xx_hal_pwr_ex.c.obj
│ │ │ ├─ stm32f4xx_hal_rcc.c.obj
│ │ │ ├─ stm32f4xx_hal_rcc_ex.c.obj
│ │ │ ├─ stm32f4xx_hal_tim.c.obj
│ │ │ ├─ stm32f4xx_hal_tim_ex.c.obj
│ │ │ └─ stm32f4xx_ll_usb.c.obj
│ │ ├─ Middlewares
│ │ │ └─ ST
│ │ │ └─ STM32_USB_Device_Library
│ │ │ ├─ Class
│ │ │ │ └─ CDC
│ │ │ │ └─ Src
│ │ │ │ └─ usbd_cdc.c.obj
│ │ │ └─ Core
│ │ │ └─ Src
│ │ │ ├─ usbd_core.c.obj
│ │ │ ├─ usbd_ctlreq.c.obj
│ │ │ └─ usbd_ioreq.c.obj
│ │ └─ USB_DEVICE
│ │ ├─ App
│ │ │ ├─ usbd_cdc_if.c.obj
│ │ │ ├─ usbd_desc.c.obj
│ │ │ └─ usb_device.c.obj
│ │ └─ Target
│ │ └─ usbd_conf.c.obj
│ ├─ cmake_install.cmake
│ ├─ TFT_STM32.bin
│ ├─ TFT_STM32.elf
│ └─ TFT_STM32.hex
├─ cmake
│ ├─ gcc-arm-none-eabi.cmake
│ └─ st-project.cmake
├─ CMakeLists.txt
├─ CMakePresets.json
├─ Core
│ ├─ Inc
│ │ ├─ fonts.h
│ │ ├─ main.h
│ │ ├─ st7735.h
│ │ ├─ stm32f4xx_hal_conf.h
│ │ ├─ stm32f4xx_it.h
│ │ └─ testimg.h
│ ├─ Src
│ │ ├─ fonts.c
│ │ ├─ main.c
│ │ ├─ st7735.c
│ │ ├─ stm32f4xx_hal_msp.c
│ │ ├─ stm32f4xx_it.c
│ │ ├─ syscalls.c
│ │ ├─ sysmem.c
│ │ └─ system_stm32f4xx.c
│ └─ Startup
│ └─ startup_stm32f411ceux.s
├─ Debug
│ ├─ Core
│ │ ├─ Src
│ │ │ ├─ fonts.cyclo
│ │ │ ├─ fonts.d
│ │ │ ├─ fonts.o
│ │ │ ├─ fonts.su
│ │ │ ├─ main.cyclo
│ │ │ ├─ main.d
│ │ │ ├─ main.o
│ │ │ ├─ main.su
│ │ │ ├─ st7735.cyclo
│ │ │ ├─ st7735.d
│ │ │ ├─ st7735.o
│ │ │ ├─ st7735.su
│ │ │ ├─ stm32f4xx_hal_msp.cyclo
│ │ │ ├─ stm32f4xx_hal_msp.d
│ │ │ ├─ stm32f4xx_hal_msp.o
│ │ │ ├─ stm32f4xx_hal_msp.su
│ │ │ ├─ stm32f4xx_it.cyclo
│ │ │ ├─ stm32f4xx_it.d
│ │ │ ├─ stm32f4xx_it.o
│ │ │ ├─ stm32f4xx_it.su
│ │ │ ├─ subdir.mk
│ │ │ ├─ syscalls.cyclo
│ │ │ ├─ syscalls.d
│ │ │ ├─ syscalls.o
│ │ │ ├─ syscalls.su
│ │ │ ├─ sysmem.cyclo
│ │ │ ├─ sysmem.d
│ │ │ ├─ sysmem.o
│ │ │ ├─ sysmem.su
│ │ │ ├─ system_stm32f4xx.cyclo
│ │ │ ├─ system_stm32f4xx.d
│ │ │ ├─ system_stm32f4xx.o
│ │ │ └─ system_stm32f4xx.su
│ │ └─ Startup
│ │ ├─ startup_stm32f411ceux.d
│ │ ├─ startup_stm32f411ceux.o
│ │ └─ subdir.mk
│ ├─ Drivers
│ │ └─ STM32F4xx_HAL_Driver
│ │ └─ Src
│ │ ├─ stm32f4xx_hal.cyclo
│ │ ├─ stm32f4xx_hal.d
│ │ ├─ stm32f4xx_hal.o
│ │ ├─ stm32f4xx_hal.su
│ │ ├─ stm32f4xx_hal_cortex.cyclo
│ │ ├─ stm32f4xx_hal_cortex.d
│ │ ├─ stm32f4xx_hal_cortex.o
│ │ ├─ stm32f4xx_hal_cortex.su
│ │ ├─ stm32f4xx_hal_dma.cyclo
│ │ ├─ stm32f4xx_hal_dma.d
│ │ ├─ stm32f4xx_hal_dma.o
│ │ ├─ stm32f4xx_hal_dma.su
│ │ ├─ stm32f4xx_hal_dma_ex.cyclo
│ │ ├─ stm32f4xx_hal_dma_ex.d
│ │ ├─ stm32f4xx_hal_dma_ex.o
│ │ ├─ stm32f4xx_hal_dma_ex.su
│ │ ├─ stm32f4xx_hal_exti.cyclo
│ │ ├─ stm32f4xx_hal_exti.d
│ │ ├─ stm32f4xx_hal_exti.o
│ │ ├─ stm32f4xx_hal_exti.su
│ │ ├─ stm32f4xx_hal_flash.cyclo
│ │ ├─ stm32f4xx_hal_flash.d
│ │ ├─ stm32f4xx_hal_flash.o
│ │ ├─ stm32f4xx_hal_flash.su
│ │ ├─ stm32f4xx_hal_flash_ex.cyclo
│ │ ├─ stm32f4xx_hal_flash_ex.d
│ │ ├─ stm32f4xx_hal_flash_ex.o
│ │ ├─ stm32f4xx_hal_flash_ex.su
│ │ ├─ stm32f4xx_hal_flash_ramfunc.cyclo
│ │ ├─ stm32f4xx_hal_flash_ramfunc.d
│ │ ├─ stm32f4xx_hal_flash_ramfunc.o
│ │ ├─ stm32f4xx_hal_flash_ramfunc.su
│ │ ├─ stm32f4xx_hal_gpio.cyclo
│ │ ├─ stm32f4xx_hal_gpio.d
│ │ ├─ stm32f4xx_hal_gpio.o
│ │ ├─ stm32f4xx_hal_gpio.su
│ │ ├─ stm32f4xx_hal_i2c.cyclo
│ │ ├─ stm32f4xx_hal_i2c.d
│ │ ├─ stm32f4xx_hal_i2c.o
│ │ ├─ stm32f4xx_hal_i2c.su
│ │ ├─ stm32f4xx_hal_i2c_ex.cyclo
│ │ ├─ stm32f4xx_hal_i2c_ex.d
│ │ ├─ stm32f4xx_hal_i2c_ex.o
│ │ ├─ stm32f4xx_hal_i2c_ex.su
│ │ ├─ stm32f4xx_hal_pcd.cyclo
│ │ ├─ stm32f4xx_hal_pcd.d
│ │ ├─ stm32f4xx_hal_pcd.o
│ │ ├─ stm32f4xx_hal_pcd.su
│ │ ├─ stm32f4xx_hal_pcd_ex.cyclo
│ │ ├─ stm32f4xx_hal_pcd_ex.d
│ │ ├─ stm32f4xx_hal_pcd_ex.o
│ │ ├─ stm32f4xx_hal_pcd_ex.su
│ │ ├─ stm32f4xx_hal_pwr.cyclo
│ │ ├─ stm32f4xx_hal_pwr.d
│ │ ├─ stm32f4xx_hal_pwr.o
│ │ ├─ stm32f4xx_hal_pwr.su
│ │ ├─ stm32f4xx_hal_pwr_ex.cyclo
│ │ ├─ stm32f4xx_hal_pwr_ex.d
│ │ ├─ stm32f4xx_hal_pwr_ex.o
│ │ ├─ stm32f4xx_hal_pwr_ex.su
│ │ ├─ stm32f4xx_hal_rcc.cyclo
│ │ ├─ stm32f4xx_hal_rcc.d
│ │ ├─ stm32f4xx_hal_rcc.o
│ │ ├─ stm32f4xx_hal_rcc.su
│ │ ├─ stm32f4xx_hal_rcc_ex.cyclo
│ │ ├─ stm32f4xx_hal_rcc_ex.d
│ │ ├─ stm32f4xx_hal_rcc_ex.o
│ │ ├─ stm32f4xx_hal_rcc_ex.su
│ │ ├─ stm32f4xx_hal_spi.cyclo
│ │ ├─ stm32f4xx_hal_spi.d
│ │ ├─ stm32f4xx_hal_spi.o
│ │ ├─ stm32f4xx_hal_spi.su
│ │ ├─ stm32f4xx_hal_tim.cyclo
│ │ ├─ stm32f4xx_hal_tim.d
│ │ ├─ stm32f4xx_hal_tim.o
│ │ ├─ stm32f4xx_hal_tim.su
│ │ ├─ stm32f4xx_hal_tim_ex.cyclo
│ │ ├─ stm32f4xx_hal_tim_ex.d
│ │ ├─ stm32f4xx_hal_tim_ex.o
│ │ ├─ stm32f4xx_hal_tim_ex.su
│ │ ├─ stm32f4xx_ll_usb.cyclo
│ │ ├─ stm32f4xx_ll_usb.d
│ │ ├─ stm32f4xx_ll_usb.o
│ │ ├─ stm32f4xx_ll_usb.su
│ │ └─ subdir.mk
│ ├─ makefile
│ ├─ Middlewares
│ │ └─ ST
│ │ └─ STM32_USB_Device_Library
│ │ ├─ Class
│ │ │ └─ CDC
│ │ │ └─ Src
│ │ │ ├─ subdir.mk
│ │ │ ├─ usbd_cdc.cyclo
│ │ │ ├─ usbd_cdc.d
│ │ │ ├─ usbd_cdc.o
│ │ │ └─ usbd_cdc.su
│ │ └─ Core
│ │ └─ Src
│ │ ├─ subdir.mk
│ │ ├─ usbd_core.cyclo
│ │ ├─ usbd_core.d
│ │ ├─ usbd_core.o
│ │ ├─ usbd_core.su
│ │ ├─ usbd_ctlreq.cyclo
│ │ ├─ usbd_ctlreq.d
│ │ ├─ usbd_ctlreq.o
│ │ ├─ usbd_ctlreq.su
│ │ ├─ usbd_ioreq.cyclo
│ │ ├─ usbd_ioreq.d
│ │ ├─ usbd_ioreq.o
│ │ └─ usbd_ioreq.su
│ ├─ objects.list
│ ├─ objects.mk
│ ├─ sources.mk
│ ├─ TFT_STM32.elf
│ ├─ TFT_STM32.list
│ ├─ TFT_STM32.map
│ └─ USB_DEVICE
│ ├─ App
│ │ ├─ subdir.mk
│ │ ├─ usbd_cdc_if.cyclo
│ │ ├─ usbd_cdc_if.d
│ │ ├─ usbd_cdc_if.o
│ │ ├─ usbd_cdc_if.su
│ │ ├─ usbd_desc.cyclo
│ │ ├─ usbd_desc.d
│ │ ├─ usbd_desc.o
│ │ ├─ usbd_desc.su
│ │ ├─ usb_device.cyclo
│ │ ├─ usb_device.d
│ │ ├─ usb_device.o
│ │ └─ usb_device.su
│ └─ Target
│ ├─ subdir.mk
│ ├─ usbd_conf.cyclo
│ ├─ usbd_conf.d
│ ├─ usbd_conf.o
│ └─ usbd_conf.su
├─ Drivers
│ ├─ CMSIS
│ │ ├─ Device
│ │ │ └─ ST
│ │ │ └─ STM32F4xx
│ │ │ ├─ Include
│ │ │ │ ├─ stm32f411xe.h
│ │ │ │ ├─ stm32f4xx.h
│ │ │ │ └─ system_stm32f4xx.h
│ │ │ ├─ LICENSE.txt
│ │ │ └─ Source
│ │ │ └─ Templates
│ │ ├─ Include
│ │ │ ├─ cmsis_armcc.h
│ │ │ ├─ cmsis_armclang.h
│ │ │ ├─ cmsis_compiler.h
│ │ │ ├─ cmsis_gcc.h
│ │ │ ├─ cmsis_iccarm.h
│ │ │ ├─ cmsis_version.h
│ │ │ ├─ core_armv8mbl.h
│ │ │ ├─ core_armv8mml.h
│ │ │ ├─ core_cm0.h
│ │ │ ├─ core_cm0plus.h
│ │ │ ├─ core_cm1.h
│ │ │ ├─ core_cm23.h
│ │ │ ├─ core_cm3.h
│ │ │ ├─ core_cm33.h
│ │ │ ├─ core_cm4.h
│ │ │ ├─ core_cm7.h
│ │ │ ├─ core_sc000.h
│ │ │ ├─ core_sc300.h
│ │ │ ├─ mpu_armv7.h
│ │ │ ├─ mpu_armv8.h
│ │ │ └─ tz_context.h
│ │ └─ LICENSE.txt
│ └─ STM32F4xx_HAL_Driver
│ ├─ Inc
│ │ ├─ Legacy
│ │ │ └─ stm32_hal_legacy.h
│ │ ├─ stm32f4xx_hal.h
│ │ ├─ stm32f4xx_hal_cortex.h
│ │ ├─ stm32f4xx_hal_def.h
│ │ ├─ stm32f4xx_hal_dma.h
│ │ ├─ stm32f4xx_hal_dma_ex.h
│ │ ├─ stm32f4xx_hal_exti.h
│ │ ├─ stm32f4xx_hal_flash.h
│ │ ├─ stm32f4xx_hal_flash_ex.h
│ │ ├─ stm32f4xx_hal_flash_ramfunc.h
│ │ ├─ stm32f4xx_hal_gpio.h
│ │ ├─ stm32f4xx_hal_gpio_ex.h
│ │ ├─ stm32f4xx_hal_pcd.h
│ │ ├─ stm32f4xx_hal_pcd_ex.h
│ │ ├─ stm32f4xx_hal_pwr.h
│ │ ├─ stm32f4xx_hal_pwr_ex.h
│ │ ├─ stm32f4xx_hal_rcc.h
│ │ ├─ stm32f4xx_hal_rcc_ex.h
│ │ ├─ stm32f4xx_hal_spi.h
│ │ ├─ stm32f4xx_hal_tim.h
│ │ ├─ stm32f4xx_hal_tim_ex.h
│ │ ├─ stm32f4xx_ll_bus.h
│ │ ├─ stm32f4xx_ll_cortex.h
│ │ ├─ stm32f4xx_ll_dma.h
│ │ ├─ stm32f4xx_ll_exti.h
│ │ ├─ stm32f4xx_ll_gpio.h
│ │ ├─ stm32f4xx_ll_pwr.h
│ │ ├─ stm32f4xx_ll_rcc.h
│ │ ├─ stm32f4xx_ll_spi.h
│ │ ├─ stm32f4xx_ll_system.h
│ │ ├─ stm32f4xx_ll_usb.h
│ │ └─ stm32f4xx_ll_utils.h
│ ├─ LICENSE.txt
│ └─ Src
│ ├─ stm32f4xx_hal.c
│ ├─ stm32f4xx_hal_cortex.c
│ ├─ stm32f4xx_hal_dma.c
│ ├─ stm32f4xx_hal_dma_ex.c
│ ├─ stm32f4xx_hal_exti.c
│ ├─ stm32f4xx_hal_flash.c
│ ├─ stm32f4xx_hal_flash_ex.c
│ ├─ stm32f4xx_hal_flash_ramfunc.c
│ ├─ stm32f4xx_hal_gpio.c
│ ├─ stm32f4xx_hal_pcd.c
│ ├─ stm32f4xx_hal_pcd_ex.c
│ ├─ stm32f4xx_hal_pwr.c
│ ├─ stm32f4xx_hal_pwr_ex.c
│ ├─ stm32f4xx_hal_rcc.c
│ ├─ stm32f4xx_hal_rcc_ex.c
│ ├─ stm32f4xx_hal_spi.c
│ ├─ stm32f4xx_hal_tim.c
│ ├─ stm32f4xx_hal_tim_ex.c
│ └─ stm32f4xx_ll_usb.c
├─ Middlewares
│ └─ ST
│ └─ STM32_USB_Device_Library
│ ├─ Class
│ │ └─ CDC
│ │ ├─ Inc
│ │ │ └─ usbd_cdc.h
│ │ └─ Src
│ │ └─ usbd_cdc.c
│ ├─ Core
│ │ ├─ Inc
│ │ │ ├─ usbd_core.h
│ │ │ ├─ usbd_ctlreq.h
│ │ │ ├─ usbd_def.h
│ │ │ └─ usbd_ioreq.h
│ │ └─ Src
│ │ ├─ usbd_core.c
│ │ ├─ usbd_ctlreq.c
│ │ └─ usbd_ioreq.c
│ └─ LICENSE.txt
├─ rutasC.txt
├─ rutasH.txt
├─ STM32F411CEUX_FLASH.ld
├─ STM32F411CEUX_RAM.ld
├─ TFT_STM32.ioc
├─ USB_DEVICE
│ ├─ App
│ │ ├─ usbd_cdc_if.c
│ │ ├─ usbd_cdc_if.h
│ │ ├─ usbd_desc.c
│ │ ├─ usbd_desc.h
│ │ ├─ usb_device.c
│ │ └─ usb_device.h
│ └─ Target
│ ├─ usbd_conf.c
│ └─ usbd_conf.h
└─ vcpkg-configuration.json
In other hand, here I have my CMakeList.txt:
cmake_minimum_required(VERSION 3.22)
# Setup compiler settings
set(CMAKE_C_STANDARD 11)
set(CMAKE_C_STANDARD_REQUIRED ON)
set(CMAKE_C_EXTENSIONS ON)
set(CMAKE_CXX_STANDARD 20)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
set(CMAKE_CXX_EXTENSIONS ON)
set(PROJ_PATH ${CMAKE_CURRENT_SOURCE_DIR})
message("Build type: " ${CMAKE_BUILD_TYPE})
#
# Core project settings
#
project(TFT_STM32)
enable_language(C CXX ASM)
#
# Core MCU flags, CPU, instruction set and FPU setup
# Needs to be set properly for your MCU
#
set(CPU_PARAMETERS
-mthumb
# This needs attention to properly set for used MCU
-mcpu=cortex-m4
-mfpu=fpv4-sp-d16
-mfloat-abi=hard
)
# Set linker script
set(linker_script_SRC ${PROJ_PATH}/STM32F411CEUX_FLASH.ld)
set(EXECUTABLE ${CMAKE_PROJECT_NAME})
#
# List of source files to compile
#
set(sources_SRCS
# Put here your source files, one in each line, relative to CMakeLists.txt file location
${PROJ_PATH}/Core/Src/main.c
${PROJ_PATH}/Core/Src/fonts.c
${PROJ_PATH}/Core/Src/st7735.c
${PROJ_PATH}/Core/Src/stm32f4xx_hal_msp.c
${PROJ_PATH}/Core/Src/stm32f4xx_it.c
${PROJ_PATH}/Core/Src/syscalls.c
${PROJ_PATH}/Core/Src/sysmem.c
${PROJ_PATH}/Core/Src/system_stm32f4xx.c
${PROJ_PATH}/USB_DEVICE/App/usb_device.c
${PROJ_PATH}/USB_DEVICE/App/usbd_cdc_if.c
${PROJ_PATH}/USB_DEVICE/App/usbd_desc.c
${PROJ_PATH}/USB_DEVICE/Target
)
#
# Include directories
#
set(include_path_DIRS
# Put here your include dirs, one in each line, relative to CMakeLists.txt file location
${PROJ_PATH}/Core/Inc/
${PROJ_PATH}/Drivers/CMSIS/Device/ST/STM32F4xx/Include
${PROJ_PATH}/Drivers/CMSIS/Include
${PROJ_PATH}/Drivers/STM32F4xx_HAL_Driver/Inc
${PROJ_PATH}/USB_DEVICE/App
${PROJ_PATH}/USB_DEVICE/Target
)
#
# Symbols definition
#
set(symbols_SYMB
# Put here your symbols (preprocessor defines), one in each line
# Encapsulate them with double quotes for safety purpose
)
# Executable files
add_executable(${EXECUTABLE} ${sources_SRCS})
# Include paths
target_include_directories(${EXECUTABLE} PRIVATE ${include_path_DIRS})
# Project symbols
target_compile_definitions(${EXECUTABLE} PRIVATE ${symbols_SYMB})
# Compiler options
target_compile_options(${EXECUTABLE} PRIVATE
${CPU_PARAMETERS}
-Wall
-Wextra
-Wpedantic
-Wno-unused-parameter
# Full debug configuration
-Og -g3 -ggdb
)
# Linker options
target_link_options(${EXECUTABLE} PRIVATE
-T${linker_script_SRC}
${CPU_PARAMETERS}
-Wl,-Map=${CMAKE_PROJECT_NAME}.map
--specs=nosys.specs
-u _printf_float # STDIO float formatting support
-Wl,--start-group
-lc
-lm
-lstdc++
-lsupc++
-Wl,--end-group
-Wl,--print-memory-usage
)
# Execute post-build to print size
add_custom_command(TARGET ${EXECUTABLE} POST_BUILD
COMMAND ${CMAKE_SIZE} $<TARGET_FILE:${EXECUTABLE}>
)
# Convert output to hex and binary
add_custom_command(TARGET ${EXECUTABLE} POST_BUILD
COMMAND ${CMAKE_OBJCOPY} -O ihex $<TARGET_FILE:${EXECUTABLE}> ${EXECUTABLE}.hex
)
# Convert to bin file -> add conditional check?
add_custom_command(TARGET ${EXECUTABLE} POST_BUILD
COMMAND ${CMAKE_OBJCOPY} -O binary $<TARGET_FILE:${EXECUTABLE}> ${EXECUTABLE}.bin
)
My include problem is with #include "usb_device.h" and... I don't know why, this archives is in USB_DEVICE and I don't undertand why the rest of libraries and includes ara fine, but this no.
Thanks a lot
I've been modifying my includes list in CMakeList.txt and I fixed all my include problems, but I can't fix this