cancel
Showing results for 
Search instead for 
Did you mean: 

IntelliSense is not working in dual-core environment

haxellio
Associate II

Hi!

I've tried all day to make VSCode intellisense work in dual-core environment, but it just doesn't.

Firstly, here is the steps to reproduce:

  1. Open STM32CubeMX 6.12.1 (latest version as of right now), access MCU selector and select STM32H747BI MCU.
  2. When asked to apply default configuration - answer yes.
  3. Go to Connectivity and make UART4 available to both cores (tick both checkboxes) and set mode to Asynchronous (this is to get some files generated under Src/Inc directories in both cores).
  4. Go to Clock Configurator and fix clocks.
  5. Go to Project Manager and change toolchain to CMake. Set Project Location and under Code Generation tab on the left, tick "Generate peripheral initialization as a pair of .c/.h files per peripheral".
  6. Generate code, close CubeMX.
  7. Open VSCode and select STM32 VSCode Extension icon on the side panel.
  8. Click Import CMake Project and choose our newly created project path. Import project.
  9. Open CM7/Src/main.c and includes at the top of the file should look like this:haxellio_0-1732497896678.png

Why this happens? I don't know, but I have some clues.

If we click on the CMake icon on the side panel, it'll open current CMake configuration. Notice that under Project Outline, there are our two sub-projects for both cores, but there's no source code files attached to them.

haxellio_1-1732498070940.png

If we create project for any of the single-core devices using the same method as above (see reproduction steps), we will get this project outline:

haxellio_2-1732498252719.png

All source files now have working IntelliSense and all includes do resolve without errors.

Looking back into our dual-core project, I've noticed the mx-generated.cmake file under the root of out project. It contains two calls to ExternalProject_Add functions, which includes our sub-projects to root project to successfully build them. But they treat our sub-project as library and don't configure IntelliSense to look into their source/header files - that's why we get include errors.

My suggested fix is that instead of ExternalProject_Add, we can use add_subdirectory function. To test this, modify our mx-generated.cmake file contents to this:

set(ST_MULTICONTEXT DUAL_CORE CACHE STRING "Type of multi-context")

#-----------------------Build CM4 Project-----------------------#
if((${BUILD_CONTEXT} MATCHES .*CM4.*) OR (NOT DEFINED BUILD_CONTEXT))
message(" Build context: CM4")
# Add CM4 project as a subdirectory
add_subdirectory(${PROJECT_SOURCE_DIR}/CM4 ${CMAKE_SOURCE_DIR}/CM4/build)

# Define a build target for the CM4 project
set(ST_DUAL_CORE_CM4_PROJECT_BUILD_TARGET
${CMAKE_SOURCE_DIR}/CM4/build/test-h747bi-vscode_CM4${CMAKE_EXECUTABLE_SUFFIX_CXX}
CACHE FILEPATH "Path to CM4 project target"
)
endif()

#-----------------------Build CM7 Project-----------------------#
if((${BUILD_CONTEXT} MATCHES .*CM7.*) OR (NOT DEFINED BUILD_CONTEXT))
message(" Build context: CM7")
# Add CM7 project as a subdirectory
add_subdirectory(${PROJECT_SOURCE_DIR}/CM7 ${CMAKE_SOURCE_DIR}/CM7/build)

# Define a build target for the CM7 project
set(ST_DUAL_CORE_CM7_PROJECT_BUILD_TARGET
${CMAKE_SOURCE_DIR}/CM7/build/test-h747bi-vscode_CM7${CMAKE_EXECUTABLE_SUFFIX_CXX}
CACHE FILEPATH "Path to CM7 project target"
)
endif()

Now save it and we get this cmake error:

[cmake] Build context: CM4
[cmake] Build type: Debug
[cmake] CMake Error at CM4/CMakeLists.txt:37 (project):
[cmake] The CMAKE_C_COMPILER:
[cmake]
[cmake] arm-none-eabi-gcc
[cmake]
[cmake] is not a full path and was not found in the PATH.
[cmake]
[cmake] Tell CMake where to find the compiler by setting either the environment
[cmake] variable "CC" or the CMake cache entry CMAKE_C_COMPILER to the full path to
[cmake] the compiler, or to the compiler name if it is in the PATH.
[cmake]
[cmake]
[cmake] CMake Error at CM4/CMakeLists.txt:37 (project):
[cmake] The CMAKE_CXX_COMPILER:
[cmake]
[cmake] arm-none-eabi-g++
[cmake]
[cmake] is not a full path and was not found in the PATH.
[cmake]
[cmake] Tell CMake where to find the compiler by setting either the environment
[cmake] variable "CXX" or the CMake cache entry CMAKE_CXX_COMPILER to the full path
[cmake] to the compiler, or to the compiler name if it is in the PATH.
[cmake]
[cmake]
[cmake] -- Configuring incomplete, errors occurred!

The dirty fix (haven't brainstormed this one enough) for this error I found is to wrap some lines of gcc-arm-none-eabi.cmake file in the root of our project into if statement:

if(NOT DEFINED STM32_MCU_FLAGS)
set(CMAKE_C_COMPILER ${TOOLCHAIN_PREFIX}gcc)
set(CMAKE_ASM_COMPILER ${CMAKE_C_COMPILER})
set(CMAKE_CXX_COMPILER ${TOOLCHAIN_PREFIX}g++)
set(CMAKE_LINKER ${TOOLCHAIN_PREFIX}g++)
set(CMAKE_OBJCOPY ${TOOLCHAIN_PREFIX}objcopy)
set(CMAKE_SIZE ${TOOLCHAIN_PREFIX}size)
endif()

Now if we save, we get this much better project outline with the source files:

haxellio_3-1732499582118.png

If we visit any source file, we see no errors and we can open any header file by Ctrl-clicking on it and it will open each projects corresponding files (usart.h in CM7 main.c opens CM7 usart.h and the same file in CM4 opens CM4 file).

haxellio_4-1732499692398.png

It will still not build because the path to the linkerscript is wrong now. To fix this, add CMX/ to each of the sub-projects CMakeLists.txt files, as follows:

set(STM32_LINKER_SCRIPT CM7/stm32h747xx_flash_CM7.ld)
set(STM32_LINKER_SCRIPT CM4/stm32h747xx_flash_CM4.ld)

Now the root project and sub-projects successfully builds.

haxellio_5-1732499986779.png

This is A LOT of tinkering just to set up the project with properly working IntelliSense. My guess is that it's the problem in CubeMX CMake generation, because it doesn't care about IntelliSense in IDE's - it just makes build process work. And it works.

I've yet to test the MCU flashing functionality and dual-core debugging. Already a full day wasted on just one basic feature. Not to mention - this should be fixed ASAP. Working without IntelliSense is just like using nano or notepad for writing code - it's definitely possible, but why in 2024?

Hope this post will help somebody.

3 REPLIES 3
mƎALLEm
ST Employee

Hello @haxellio and welcome to the community,

See also: https://community.st.com/t5/stm32-vscode-extension-mcus/support-for-dual-core-h7/td-p/742704

To give better visibility on the answered topics, please click on "Accept as Solution" on the reply which solved your issue or answered your question.

Hi, @mƎALLEm.

Thank you for your reply.

The linked issue is not the same as mine.

gabkop
Associate

Hi @haxellio,

thanks a lot, your post helped me finally getting Intellisense working in vscode. I have had to do some more changes specifically the paths were referenced to the top level directory so i had to change them. The add_libraries() library names had to be changed as well so they have unique names for both subprojects.

The "git diff" output is below for anyone interested, note however that this git diff shows the changes after regenerating with cubemx. Cubemx does not seem to modify gcc-arm-none-eabi.cmake.

 

git diff:

diff --git a/Appli/CMakeLists.txt b/Appli/CMakeLists.txt
index a8ccc34..54b00ef 100644
--- a/Appli/CMakeLists.txt
+++ b/Appli/CMakeLists.txt
@@ -26,7 +26,7 @@ set(CMAKE_EXPORT_COMPILE_COMMANDS TRUE)
 set(STM32_MCU_FLAGS  "-mcpu=cortex-m7 -mfpu=fpv5-d16 -mfloat-abi=hard " )
 
 #Linker options
-set(STM32_LINKER_SCRIPT Appli/stm32h7s3xx_flash.ld)
+set(STM32_LINKER_SCRIPT stm32h7s3xx_flash.ld)
 set(STM32_LINKER_OPTION  )
 
 # Include toolchain file
diff --git a/Appli/mx-generated.cmake b/Appli/mx-generated.cmake
index 57dd2fa..00a32ad 100644
--- a/Appli/mx-generated.cmake
+++ b/Appli/mx-generated.cmake
@@ -8,41 +8,41 @@ set(MX_Defines_Syms
 )
 # STM32CubeMX generated include paths
 set(MX_Include_Dirs
-    ${CMAKE_SOURCE_DIR}/Appli/Core/Inc
-    ${CMAKE_SOURCE_DIR}/Appli/../Drivers/STM32H7RSxx_HAL_Driver/Inc
-    ${CMAKE_SOURCE_DIR}/Appli/../Drivers/STM32H7RSxx_HAL_Driver/Inc/Legacy
-    ${CMAKE_SOURCE_DIR}/Appli/../Drivers/CMSIS/Device/ST/STM32H7RSxx/Include
-    ${CMAKE_SOURCE_DIR}/Appli/../Drivers/CMSIS/Include
+    ${CMAKE_SOURCE_DIR}/Core/Inc
+    ${CMAKE_SOURCE_DIR}/../Drivers/STM32H7RSxx_HAL_Driver/Inc
+    ${CMAKE_SOURCE_DIR}/../Drivers/STM32H7RSxx_HAL_Driver/Inc/Legacy
+    ${CMAKE_SOURCE_DIR}/../Drivers/CMSIS/Device/ST/STM32H7RSxx/Include
+    ${CMAKE_SOURCE_DIR}/../Drivers/CMSIS/Include
 )
 # STM32CubeMX generated application sources
 set(MX_Application_Src
-    ${CMAKE_SOURCE_DIR}/Appli/Core/Src/main.c
-    ${CMAKE_SOURCE_DIR}/Appli/Core/Src/gpio.c
-    ${CMAKE_SOURCE_DIR}/Appli/Core/Src/spi.c
-    ${CMAKE_SOURCE_DIR}/Appli/Core/Src/stm32h7rsxx_it.c
-    ${CMAKE_SOURCE_DIR}/Appli/Core/Src/stm32h7rsxx_hal_msp.c
-    ${CMAKE_SOURCE_DIR}/Appli/Core/Src/sysmem.c
-    ${CMAKE_SOURCE_DIR}/Appli/Core/Src/syscalls.c
-    ${CMAKE_SOURCE_DIR}/Appli/Core/Startup/startup_stm32h7s3xx.s
+    ${CMAKE_SOURCE_DIR}/Core/Src/main.c
+    ${CMAKE_SOURCE_DIR}/Core/Src/gpio.c
+    ${CMAKE_SOURCE_DIR}/Core/Src/spi.c
+    ${CMAKE_SOURCE_DIR}/Core/Src/stm32h7rsxx_it.c
+    ${CMAKE_SOURCE_DIR}/Core/Src/stm32h7rsxx_hal_msp.c
+    ${CMAKE_SOURCE_DIR}/Core/Src/sysmem.c
+    ${CMAKE_SOURCE_DIR}/Core/Src/syscalls.c
+    ${CMAKE_SOURCE_DIR}/Core/Startup/startup_stm32h7s3xx.s
 )
 
 # STM32 HAL/LL Drivers
 set(STM32_Drivers_Src
-    ${CMAKE_SOURCE_DIR}/Appli/Core/Src/system_stm32h7rsxx.c
-    ${CMAKE_SOURCE_DIR}/Appli/../Drivers/STM32H7RSxx_HAL_Driver/Src/stm32h7rsxx_hal_cortex.c
-    ${CMAKE_SOURCE_DIR}/Appli/../Drivers/STM32H7RSxx_HAL_Driver/Src/stm32h7rsxx_hal_pwr.c
-    ${CMAKE_SOURCE_DIR}/Appli/../Drivers/STM32H7RSxx_HAL_Driver/Src/stm32h7rsxx_hal_pwr_ex.c
-    ${CMAKE_SOURCE_DIR}/Appli/../Drivers/STM32H7RSxx_HAL_Driver/Src/stm32h7rsxx_hal_rcc.c
-    ${CMAKE_SOURCE_DIR}/Appli/../Drivers/STM32H7RSxx_HAL_Driver/Src/stm32h7rsxx_hal_rcc_ex.c
-    ${CMAKE_SOURCE_DIR}/Appli/../Drivers/STM32H7RSxx_HAL_Driver/Src/stm32h7rsxx_hal_flash.c
-    ${CMAKE_SOURCE_DIR}/Appli/../Drivers/STM32H7RSxx_HAL_Driver/Src/stm32h7rsxx_hal_flash_ex.c
-    ${CMAKE_SOURCE_DIR}/Appli/../Drivers/STM32H7RSxx_HAL_Driver/Src/stm32h7rsxx_hal_gpio.c
-    ${CMAKE_SOURCE_DIR}/Appli/../Drivers/STM32H7RSxx_HAL_Driver/Src/stm32h7rsxx_hal_dma.c
-    ${CMAKE_SOURCE_DIR}/Appli/../Drivers/STM32H7RSxx_HAL_Driver/Src/stm32h7rsxx_hal_dma_ex.c
-    ${CMAKE_SOURCE_DIR}/Appli/../Drivers/STM32H7RSxx_HAL_Driver/Src/stm32h7rsxx_hal.c
-    ${CMAKE_SOURCE_DIR}/Appli/../Drivers/STM32H7RSxx_HAL_Driver/Src/stm32h7rsxx_hal_exti.c
-    ${CMAKE_SOURCE_DIR}/Appli/../Drivers/STM32H7RSxx_HAL_Driver/Src/stm32h7rsxx_hal_spi.c
-    ${CMAKE_SOURCE_DIR}/Appli/../Drivers/STM32H7RSxx_HAL_Driver/Src/stm32h7rsxx_hal_spi_ex.c
+    ${CMAKE_SOURCE_DIR}/Core/Src/system_stm32h7rsxx.c
+    ${CMAKE_SOURCE_DIR}/../Drivers/STM32H7RSxx_HAL_Driver/Src/stm32h7rsxx_hal_cortex.c
+    ${CMAKE_SOURCE_DIR}/../Drivers/STM32H7RSxx_HAL_Driver/Src/stm32h7rsxx_hal_pwr.c
+    ${CMAKE_SOURCE_DIR}/../Drivers/STM32H7RSxx_HAL_Driver/Src/stm32h7rsxx_hal_pwr_ex.c
+    ${CMAKE_SOURCE_DIR}/../Drivers/STM32H7RSxx_HAL_Driver/Src/stm32h7rsxx_hal_rcc.c
+    ${CMAKE_SOURCE_DIR}/../Drivers/STM32H7RSxx_HAL_Driver/Src/stm32h7rsxx_hal_rcc_ex.c
+    ${CMAKE_SOURCE_DIR}/../Drivers/STM32H7RSxx_HAL_Driver/Src/stm32h7rsxx_hal_flash.c
+    ${CMAKE_SOURCE_DIR}/../Drivers/STM32H7RSxx_HAL_Driver/Src/stm32h7rsxx_hal_flash_ex.c
+    ${CMAKE_SOURCE_DIR}/../Drivers/STM32H7RSxx_HAL_Driver/Src/stm32h7rsxx_hal_gpio.c
+    ${CMAKE_SOURCE_DIR}/../Drivers/STM32H7RSxx_HAL_Driver/Src/stm32h7rsxx_hal_dma.c
+    ${CMAKE_SOURCE_DIR}/../Drivers/STM32H7RSxx_HAL_Driver/Src/stm32h7rsxx_hal_dma_ex.c
+    ${CMAKE_SOURCE_DIR}/../Drivers/STM32H7RSxx_HAL_Driver/Src/stm32h7rsxx_hal.c
+    ${CMAKE_SOURCE_DIR}/../Drivers/STM32H7RSxx_HAL_Driver/Src/stm32h7rsxx_hal_exti.c
+    ${CMAKE_SOURCE_DIR}/../Drivers/STM32H7RSxx_HAL_Driver/Src/stm32h7rsxx_hal_spi.c
+    ${CMAKE_SOURCE_DIR}/../Drivers/STM32H7RSxx_HAL_Driver/Src/stm32h7rsxx_hal_spi_ex.c
 )
 
 # Drivers Midllewares
@@ -53,18 +53,18 @@ set(MX_LINK_DIRS
 )
 # Project libraries
 set (MX_LINK_LIBS 
-    STM32_Drivers_Appli
+    STM32_Drivers
     
 )
 # Interface library for includes and symbols
-add_library(stm32cubemx_Appli INTERFACE)
-target_include_directories(stm32cubemx_Appli INTERFACE ${MX_Include_Dirs})
-target_compile_definitions(stm32cubemx_Appli INTERFACE ${MX_Defines_Syms})
+add_library(stm32cubemx INTERFACE)
+target_include_directories(stm32cubemx INTERFACE ${MX_Include_Dirs})
+target_compile_definitions(stm32cubemx INTERFACE ${MX_Defines_Syms})
 
 # Create STM32_Drivers static library
-add_library(STM32_Drivers_Appli OBJECT)
-target_sources(STM32_Drivers_Appli PRIVATE ${STM32_Drivers_Src})
-target_link_libraries(STM32_Drivers_Appli PUBLIC stm32cubemx_Appli)
+add_library(STM32_Drivers OBJECT)
+target_sources(STM32_Drivers PRIVATE ${STM32_Drivers_Src})
+target_link_libraries(STM32_Drivers PUBLIC stm32cubemx)
 
 
 # Add STM32CubeMX generated application sources to the project
diff --git a/Boot/CMakeLists.txt b/Boot/CMakeLists.txt
index 2e48823..0ffc7d7 100644
--- a/Boot/CMakeLists.txt
+++ b/Boot/CMakeLists.txt
@@ -26,7 +26,7 @@ set(CMAKE_EXPORT_COMPILE_COMMANDS TRUE)
 set(STM32_MCU_FLAGS  "-mcpu=cortex-m7 -mfpu=fpv5-d16 -mfloat-abi=hard " )
 
 #Linker options
-set(STM32_LINKER_SCRIPT Boot/stm32h7s3xx_flash.ld)
+set(STM32_LINKER_SCRIPT stm32h7s3xx_flash.ld)
 set(STM32_LINKER_OPTION  )
 
 # Include toolchain file
diff --git a/Boot/mx-generated.cmake b/Boot/mx-generated.cmake
index 39c2f7d..c92ee92 100644
--- a/Boot/mx-generated.cmake
+++ b/Boot/mx-generated.cmake
@@ -8,59 +8,59 @@ set(MX_Defines_Syms
 )
 # STM32CubeMX generated include paths
 set(MX_Include_Dirs
-    ${CMAKE_SOURCE_DIR}/Boot/Core/Inc
-    ${CMAKE_SOURCE_DIR}/Boot/../Drivers/STM32H7RSxx_HAL_Driver/Inc
-    ${CMAKE_SOURCE_DIR}/Boot/../Drivers/STM32H7RSxx_HAL_Driver/Inc/Legacy
-    ${CMAKE_SOURCE_DIR}/Boot/../Drivers/CMSIS/Device/ST/STM32H7RSxx/Include
-    ${CMAKE_SOURCE_DIR}/Boot/../Drivers/CMSIS/Include
+    ${CMAKE_SOURCE_DIR}/Core/Inc
+    ${CMAKE_SOURCE_DIR}/../Drivers/STM32H7RSxx_HAL_Driver/Inc
+    ${CMAKE_SOURCE_DIR}/../Drivers/STM32H7RSxx_HAL_Driver/Inc/Legacy
+    ${CMAKE_SOURCE_DIR}/../Drivers/CMSIS/Device/ST/STM32H7RSxx/Include
+    ${CMAKE_SOURCE_DIR}/../Drivers/CMSIS/Include
 )
-
 # STM32CubeMX generated application sources
 set(MX_Application_Src
-    ${CMAKE_SOURCE_DIR}/Boot/Core/Src/main.c
-    ${CMAKE_SOURCE_DIR}/Boot/Core/Src/stm32h7rsxx_it.c
-    ${CMAKE_SOURCE_DIR}/Boot/Core/Src/stm32h7rsxx_hal_msp.c
-    ${CMAKE_SOURCE_DIR}/Boot/Core/Src/sysmem.c
-    ${CMAKE_SOURCE_DIR}/Boot/Core/Src/syscalls.c
-    ${CMAKE_SOURCE_DIR}/Boot/Core/Startup/startup_stm32h7s3xx.s
+    ${CMAKE_SOURCE_DIR}/Core/Src/main.c
+    ${CMAKE_SOURCE_DIR}/Core/Src/stm32h7rsxx_it.c
+    ${CMAKE_SOURCE_DIR}/Core/Src/stm32h7rsxx_hal_msp.c
+    ${CMAKE_SOURCE_DIR}/Core/Src/sysmem.c
+    ${CMAKE_SOURCE_DIR}/Core/Src/syscalls.c
+    ${CMAKE_SOURCE_DIR}/Core/Startup/startup_stm32h7s3xx.s
 )
 
 # STM32 HAL/LL Drivers
 set(STM32_Drivers_Src
-    ${CMAKE_SOURCE_DIR}/Boot/Core/Src/system_stm32h7rsxx.c
-    ${CMAKE_SOURCE_DIR}/Boot/../Drivers/STM32H7RSxx_HAL_Driver/Src/stm32h7rsxx_hal_cortex.c
-    ${CMAKE_SOURCE_DIR}/Boot/../Drivers/STM32H7RSxx_HAL_Driver/Src/stm32h7rsxx_hal_pwr.c
-    ${CMAKE_SOURCE_DIR}/Boot/../Drivers/STM32H7RSxx_HAL_Driver/Src/stm32h7rsxx_hal_pwr_ex.c
-    ${CMAKE_SOURCE_DIR}/Boot/../Drivers/STM32H7RSxx_HAL_Driver/Src/stm32h7rsxx_hal_rcc.c
-    ${CMAKE_SOURCE_DIR}/Boot/../Drivers/STM32H7RSxx_HAL_Driver/Src/stm32h7rsxx_hal_rcc_ex.c
-    ${CMAKE_SOURCE_DIR}/Boot/../Drivers/STM32H7RSxx_HAL_Driver/Src/stm32h7rsxx_hal_flash.c
-    ${CMAKE_SOURCE_DIR}/Boot/../Drivers/STM32H7RSxx_HAL_Driver/Src/stm32h7rsxx_hal_flash_ex.c
-    ${CMAKE_SOURCE_DIR}/Boot/../Drivers/STM32H7RSxx_HAL_Driver/Src/stm32h7rsxx_hal_gpio.c
-    ${CMAKE_SOURCE_DIR}/Boot/../Drivers/STM32H7RSxx_HAL_Driver/Src/stm32h7rsxx_hal_dma.c
-    ${CMAKE_SOURCE_DIR}/Boot/../Drivers/STM32H7RSxx_HAL_Driver/Src/stm32h7rsxx_hal_dma_ex.c
-    ${CMAKE_SOURCE_DIR}/Boot/../Drivers/STM32H7RSxx_HAL_Driver/Src/stm32h7rsxx_hal.c
-    ${CMAKE_SOURCE_DIR}/Boot/../Drivers/STM32H7RSxx_HAL_Driver/Src/stm32h7rsxx_hal_exti.c
+    ${CMAKE_SOURCE_DIR}/Core/Src/system_stm32h7rsxx.c
+    ${CMAKE_SOURCE_DIR}/../Drivers/STM32H7RSxx_HAL_Driver/Src/stm32h7rsxx_hal_cortex.c
+    ${CMAKE_SOURCE_DIR}/../Drivers/STM32H7RSxx_HAL_Driver/Src/stm32h7rsxx_hal_pwr.c
+    ${CMAKE_SOURCE_DIR}/../Drivers/STM32H7RSxx_HAL_Driver/Src/stm32h7rsxx_hal_pwr_ex.c
+    ${CMAKE_SOURCE_DIR}/../Drivers/STM32H7RSxx_HAL_Driver/Src/stm32h7rsxx_hal_rcc.c
+    ${CMAKE_SOURCE_DIR}/../Drivers/STM32H7RSxx_HAL_Driver/Src/stm32h7rsxx_hal_rcc_ex.c
+    ${CMAKE_SOURCE_DIR}/../Drivers/STM32H7RSxx_HAL_Driver/Src/stm32h7rsxx_hal_flash.c
+    ${CMAKE_SOURCE_DIR}/../Drivers/STM32H7RSxx_HAL_Driver/Src/stm32h7rsxx_hal_flash_ex.c
+    ${CMAKE_SOURCE_DIR}/../Drivers/STM32H7RSxx_HAL_Driver/Src/stm32h7rsxx_hal_gpio.c
+    ${CMAKE_SOURCE_DIR}/../Drivers/STM32H7RSxx_HAL_Driver/Src/stm32h7rsxx_hal_dma.c
+    ${CMAKE_SOURCE_DIR}/../Drivers/STM32H7RSxx_HAL_Driver/Src/stm32h7rsxx_hal_dma_ex.c
+    ${CMAKE_SOURCE_DIR}/../Drivers/STM32H7RSxx_HAL_Driver/Src/stm32h7rsxx_hal.c
+    ${CMAKE_SOURCE_DIR}/../Drivers/STM32H7RSxx_HAL_Driver/Src/stm32h7rsxx_hal_exti.c
 )
 
 # Drivers Midllewares
 
 # Link directories setup
 set(MX_LINK_DIRS
+
 )
 # Project libraries
 set (MX_LINK_LIBS 
-    STM32_Drivers_Boot
+    STM32_Drivers
+    
 )
-
 # Interface library for includes and symbols
-add_library(stm32cubemx_Boot INTERFACE)
-target_include_directories(stm32cubemx_Boot INTERFACE ${MX_Include_Dirs})
-target_compile_definitions(stm32cubemx_Boot INTERFACE ${MX_Defines_Syms})
+add_library(stm32cubemx INTERFACE)
+target_include_directories(stm32cubemx INTERFACE ${MX_Include_Dirs})
+target_compile_definitions(stm32cubemx INTERFACE ${MX_Defines_Syms})
 
 # Create STM32_Drivers static library
-add_library(STM32_Drivers_Boot OBJECT)
-target_sources(STM32_Drivers_Boot PRIVATE ${STM32_Drivers_Src})
-target_link_libraries(STM32_Drivers_Boot PUBLIC stm32cubemx_Boot)
+add_library(STM32_Drivers OBJECT)
+target_sources(STM32_Drivers PRIVATE ${STM32_Drivers_Src})
+target_link_libraries(STM32_Drivers PUBLIC stm32cubemx)
 
 
 # Add STM32CubeMX generated application sources to the project
@@ -72,7 +72,6 @@ target_link_directories(${CMAKE_PROJECT_NAME} PRIVATE ${MX_LINK_DIRS})
 # Add libraries to the project
 target_link_libraries(${CMAKE_PROJECT_NAME} ${MX_LINK_LIBS})
 
-
 # Add the map file to the list of files to be removed with 'clean' target
 set_target_properties(${CMAKE_PROJECT_NAME} PROPERTIES ADDITIONAL_CLEAN_FILES ${CMAKE_PROJECT_NAME}.map)
 
diff --git a/gcc-arm-none-eabi.cmake b/gcc-arm-none-eabi.cmake
index 3bf389d..cb46fe3 100644
--- a/gcc-arm-none-eabi.cmake
+++ b/gcc-arm-none-eabi.cmake
@@ -8,14 +8,12 @@ set(CMAKE_CXX_COMPILER_ID GNU)
 # arm-none-eabi- must be part of path environment
 set(TOOLCHAIN_PREFIX                arm-none-eabi-)
 
-if(NOT DEFINED STM32_MCU_FLAGS)
-    set(CMAKE_C_COMPILER                ${TOOLCHAIN_PREFIX}gcc)
-    set(CMAKE_ASM_COMPILER              ${CMAKE_C_COMPILER})
-    set(CMAKE_CXX_COMPILER              ${TOOLCHAIN_PREFIX}g++)
-    set(CMAKE_LINKER                    ${TOOLCHAIN_PREFIX}g++)
-    set(CMAKE_OBJCOPY                   ${TOOLCHAIN_PREFIX}objcopy)
-    set(CMAKE_SIZE                      ${TOOLCHAIN_PREFIX}size)
-endif()
+set(CMAKE_C_COMPILER                ${TOOLCHAIN_PREFIX}gcc)
+set(CMAKE_ASM_COMPILER              ${CMAKE_C_COMPILER})
+set(CMAKE_CXX_COMPILER              ${TOOLCHAIN_PREFIX}g++)
+set(CMAKE_LINKER                    ${TOOLCHAIN_PREFIX}g++)
+set(CMAKE_OBJCOPY                   ${TOOLCHAIN_PREFIX}objcopy)
+set(CMAKE_SIZE                      ${TOOLCHAIN_PREFIX}size)
 
 set(CMAKE_EXECUTABLE_SUFFIX_ASM     ".elf")
 set(CMAKE_EXECUTABLE_SUFFIX_C       ".elf")
diff --git a/mx-generated.cmake b/mx-generated.cmake
index 4c8c9aa..3622ba4 100644
--- a/mx-generated.cmake
+++ b/mx-generated.cmake
@@ -1,23 +1,35 @@
 # File automatically-generated by STM32CubeMX - Do not modify
 set(ST_MULTICONTEXT BOOT_FLASH CACHE STRING "Type of multi-context")
-
 #-----------------------Build Appli Project-----------------------#
 if((${BUILD_CONTEXT} MATCHES .*Appli.*) OR (NOT DEFINED BUILD_CONTEXT))
-message(" Build context: Appli")
-# Add Appli project as a subdirectory
-add_subdirectory(${PROJECT_SOURCE_DIR}/Appli ${CMAKE_SOURCE_DIR}/Appli/build)
+    message("   Build context: " Appli)
+    ExternalProject_Add(neues_cmake_test_lqfp100_Appli
+        BINARY_DIR                  ${CMAKE_SOURCE_DIR}/Appli/build
+        SOURCE_DIR                  ${PROJECT_SOURCE_DIR}/Appli
+        PREFIX                      Appli
+        CONFIGURE_HANDLED_BY_BUILD  true
+        INSTALL_COMMAND             ""
+        CMAKE_ARGS                  -DCMAKE_EXPORT_COMPILE_COMMANDS=ON  -DCMAKE_TOOLCHAIN_FILE=${CMAKE_TOOLCHAIN_FILE}
+        BUILD_ALWAYS                true
+    )
 
-# Define a build target for the Appli project
-set(ST_BOOT_FLASH_APPLI_PROJECT_BUILD_TARGET ${CMAKE_SOURCE_DIR}/Appli/build/neues_cmake_test_lqfp100_Appli${CMAKE_EXECUTABLE_SUFFIX_CXX} CACHE FILEPATH "Path to appli project target")
+	set_property(DIRECTORY APPEND PROPERTY ADDITIONAL_CLEAN_FILES "${CMAKE_SOURCE_DIR}/Appli/build")
+	set(ST_BOOT_FLASH_APPLI_PROJECT_BUILD_TARGET ${CMAKE_SOURCE_DIR}/Appli/build/neues_cmake_test_lqfp100_Appli${CMAKE_EXECUTABLE_SUFFIX_CXX} CACHE FILEPATH "Path to appli project target")
 endif()
-
-
-#-----------------------Build Appli Project-----------------------#
+#-----------------------Build Boot Project-----------------------#
 if((${BUILD_CONTEXT} MATCHES .*Boot.*) OR (NOT DEFINED BUILD_CONTEXT))
-message(" Build context: Boot")
-# Add Boot project as a subdirectory
-add_subdirectory(${PROJECT_SOURCE_DIR}/Boot ${CMAKE_SOURCE_DIR}/Boot/build)
+    message("   Build context: " Boot)
+    ExternalProject_Add(neues_cmake_test_lqfp100_Boot
+        BINARY_DIR                  ${CMAKE_SOURCE_DIR}/Boot/build
+        SOURCE_DIR                  ${PROJECT_SOURCE_DIR}/Boot
+        PREFIX                      Boot
+        CONFIGURE_HANDLED_BY_BUILD  true
+        INSTALL_COMMAND             ""
+        CMAKE_ARGS                  -DCMAKE_EXPORT_COMPILE_COMMANDS=ON  -DCMAKE_TOOLCHAIN_FILE=${CMAKE_TOOLCHAIN_FILE}
+        BUILD_ALWAYS                true
+    )
 
-# Define a build target for the Boot project
-set(ST_BOOT_FLASH_BOOT_PROJECT_BUILD_TARGET ${CMAKE_SOURCE_DIR}/Boot/build/neues_cmake_test_lqfp100_Boot${CMAKE_EXECUTABLE_SUFFIX_CXX} CACHE FILEPATH "Path to boot project target")
+	set_property(DIRECTORY APPEND PROPERTY ADDITIONAL_CLEAN_FILES "${CMAKE_SOURCE_DIR}/Boot/build")
+	set(ST_BOOT_FLASH_BOOT_PROJECT_BUILD_TARGET ${CMAKE_SOURCE_DIR}/Boot/build/neues_cmake_test_lqfp100_Boot${CMAKE_EXECUTABLE_SUFFIX_CXX} CACHE FILEPATH "Path to boot project target")
 endif()
+