Skip to content

Commit

Permalink
Update vscode & CMake related points
Browse files Browse the repository at this point in the history
  • Loading branch information
MaJerle committed May 18, 2022
1 parent 2e98e50 commit e2cef42
Show file tree
Hide file tree
Showing 8 changed files with 239 additions and 153 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"version": 4,
"configurations": [
{
/* ms-vscode.cmake-tools plugin shall to be installed, which provides include paths and defines through CMake file */
/* ms-vscode.cmake-tools plugin should be installed; it provides include paths and defines through CMake file */
"name": "STM32",
"includePath": [],
"defines": [],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
"runToMain": true,
"svdFile": "path/to/file.svd", //Path to SVD file to see registers
"v1": false,
"showDevDebugOutput": true,
"showDevDebugOutput": "both",

/* Will get automatically detected if STM32CubeIDE is installed to default directory
or it can be manually provided if necessary.. */
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,49 @@
"cwd": "${workspaceFolder}"
},
"problemMatcher": []
}
},
{
"type": "shell",
"label": "CubeProg: Flash project (SWD)",
"command": "STM32_Programmer_CLI",
"args": [
"--connect",
"port=swd",
"--download", "${command:cmake.launchTargetPath}",
"-hardRst"
],
"options": {
"cwd": "${workspaceFolder}"
},
"problemMatcher": []
},
{
"type": "shell",
"label": "CubeProg: Flash project with defined serial number (SWD) - you must set serial number first",
"command": "STM32_Programmer_CLI",
"args": [
"--connect",
"port=swd",
"sn=<yourserialnumber>",
"--download", "${command:cmake.launchTargetPath}",
"-hardRst"
],
"options": {
"cwd": "${workspaceFolder}"
},
"problemMatcher": []
},
{
"type": "shell",
"label": "CubeProg: List all available communication interfaces",
"command": "STM32_Programmer_CLI",
"args": [
"--list",
],
"options": {
"cwd": "${workspaceFolder}"
},
"problemMatcher": []
},
]
}
152 changes: 76 additions & 76 deletions examples/stm32/mqtt_client_api_rtos_stm32f429zi_nucleo/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,8 @@ set(CPU_PARAMETERS
# Other parameters
# -mcpu, -mfloat, -mfloat-abi, ...
-mcpu=cortex-m4
-mfpu=fpv4-sp-d16
-mfloat-abi=hard
-mfpu=fpv4-sp-d16
-mfloat-abi=hard
)

# Set linker script
Expand All @@ -38,87 +38,87 @@ set(EXECUTABLE ${CMAKE_PROJECT_NAME})
# Source files
#
set(src_freertos_SRCS
${PROJ_PATH}/../../lib/FreeRTOS/CMSIS_RTOS_V2/cmsis_os2.c
${PROJ_PATH}/../../lib/FreeRTOS/croutine.c
${PROJ_PATH}/../../lib/FreeRTOS/event_groups.c
${PROJ_PATH}/../../lib/FreeRTOS/portable/MemMang/heap_4.c
${PROJ_PATH}/../../lib/FreeRTOS/list.c
${PROJ_PATH}/../../lib/FreeRTOS/portable/GCC/ARM_CM4F/port.c
${PROJ_PATH}/../../lib/FreeRTOS/queue.c
${PROJ_PATH}/../../lib/FreeRTOS/tasks.c
${PROJ_PATH}/../../lib/FreeRTOS/timers.c)
${PROJ_PATH}/../../lib/FreeRTOS/CMSIS_RTOS_V2/cmsis_os2.c
${PROJ_PATH}/../../lib/FreeRTOS/croutine.c
${PROJ_PATH}/../../lib/FreeRTOS/event_groups.c
${PROJ_PATH}/../../lib/FreeRTOS/portable/MemMang/heap_4.c
${PROJ_PATH}/../../lib/FreeRTOS/list.c
${PROJ_PATH}/../../lib/FreeRTOS/portable/GCC/ARM_CM4F/port.c
${PROJ_PATH}/../../lib/FreeRTOS/queue.c
${PROJ_PATH}/../../lib/FreeRTOS/tasks.c
${PROJ_PATH}/../../lib/FreeRTOS/timers.c)

set(src_stm32f4xx_hal_driver_SRCS
${PROJ_PATH}/../../lib/st/STM32F4xx_HAL_Driver/Src/stm32f4xx_ll_dma.c
${PROJ_PATH}/../../lib/st/STM32F4xx_HAL_Driver/Src/stm32f4xx_ll_exti.c
${PROJ_PATH}/../../lib/st/STM32F4xx_HAL_Driver/Src/stm32f4xx_ll_gpio.c
${PROJ_PATH}/../../lib/st/STM32F4xx_HAL_Driver/Src/stm32f4xx_ll_pwr.c
${PROJ_PATH}/../../lib/st/STM32F4xx_HAL_Driver/Src/stm32f4xx_ll_rcc.c
${PROJ_PATH}/../../lib/st/STM32F4xx_HAL_Driver/Src/stm32f4xx_ll_usart.c
${PROJ_PATH}/../../lib/st/STM32F4xx_HAL_Driver/Src/stm32f4xx_ll_utils.c)
${PROJ_PATH}/../../lib/st/STM32F4xx_HAL_Driver/Src/stm32f4xx_ll_dma.c
${PROJ_PATH}/../../lib/st/STM32F4xx_HAL_Driver/Src/stm32f4xx_ll_exti.c
${PROJ_PATH}/../../lib/st/STM32F4xx_HAL_Driver/Src/stm32f4xx_ll_gpio.c
${PROJ_PATH}/../../lib/st/STM32F4xx_HAL_Driver/Src/stm32f4xx_ll_pwr.c
${PROJ_PATH}/../../lib/st/STM32F4xx_HAL_Driver/Src/stm32f4xx_ll_rcc.c
${PROJ_PATH}/../../lib/st/STM32F4xx_HAL_Driver/Src/stm32f4xx_ll_usart.c
${PROJ_PATH}/../../lib/st/STM32F4xx_HAL_Driver/Src/stm32f4xx_ll_utils.c)

set(src_user_SRCS
${PROJ_PATH}/src/main.c
${PROJ_PATH}/src/stm32f4xx_it.c
${PROJ_PATH}/src/syscalls.c
${PROJ_PATH}/src/system_stm32f4xx.c)
${PROJ_PATH}/src/main.c
${PROJ_PATH}/src/stm32f4xx_it.c
${PROJ_PATH}/src/syscalls.c
${PROJ_PATH}/src/system_stm32f4xx.c)

set(src_lwesp_SRCS
${PROJ_PATH}/../../../lwesp/src/lwesp/lwesp.c
${PROJ_PATH}/../../../lwesp/src/lwesp/lwesp_ap.c
${PROJ_PATH}/../../../lwesp/src/lwesp/lwesp_buff.c
${PROJ_PATH}/../../../lwesp/src/lwesp/lwesp_conn.c
${PROJ_PATH}/../../../lwesp/src/lwesp/lwesp_debug.c
${PROJ_PATH}/../../../lwesp/src/lwesp/lwesp_dns.c
${PROJ_PATH}/../../../lwesp/src/lwesp/lwesp_evt.c
${PROJ_PATH}/../../../lwesp/src/lwesp/lwesp_input.c
${PROJ_PATH}/../../../lwesp/src/lwesp/lwesp_int.c
${PROJ_PATH}/../../../lwesp/src/lwesp/lwesp_mem.c
${PROJ_PATH}/../../../lwesp/src/lwesp/lwesp_parser.c
${PROJ_PATH}/../../../lwesp/src/lwesp/lwesp_pbuf.c
${PROJ_PATH}/../../../lwesp/src/lwesp/lwesp_server.c
${PROJ_PATH}/../../../lwesp/src/lwesp/lwesp_sntp.c
${PROJ_PATH}/../../../lwesp/src/lwesp/lwesp_sta.c
${PROJ_PATH}/../../../lwesp/src/lwesp/lwesp_threads.c
${PROJ_PATH}/../../../lwesp/src/lwesp/lwesp_timeout.c
${PROJ_PATH}/../../../lwesp/src/lwesp/lwesp_unicode.c
${PROJ_PATH}/../../../lwesp/src/lwesp/lwesp_utils.c
${PROJ_PATH}/../../../lwesp/src/lwesp/lwesp_wps.c)
${PROJ_PATH}/../../../lwesp/src/lwesp/lwesp.c
${PROJ_PATH}/../../../lwesp/src/lwesp/lwesp_ap.c
${PROJ_PATH}/../../../lwesp/src/lwesp/lwesp_buff.c
${PROJ_PATH}/../../../lwesp/src/lwesp/lwesp_conn.c
${PROJ_PATH}/../../../lwesp/src/lwesp/lwesp_debug.c
${PROJ_PATH}/../../../lwesp/src/lwesp/lwesp_dns.c
${PROJ_PATH}/../../../lwesp/src/lwesp/lwesp_evt.c
${PROJ_PATH}/../../../lwesp/src/lwesp/lwesp_input.c
${PROJ_PATH}/../../../lwesp/src/lwesp/lwesp_int.c
${PROJ_PATH}/../../../lwesp/src/lwesp/lwesp_mem.c
${PROJ_PATH}/../../../lwesp/src/lwesp/lwesp_parser.c
${PROJ_PATH}/../../../lwesp/src/lwesp/lwesp_pbuf.c
${PROJ_PATH}/../../../lwesp/src/lwesp/lwesp_server.c
${PROJ_PATH}/../../../lwesp/src/lwesp/lwesp_sntp.c
${PROJ_PATH}/../../../lwesp/src/lwesp/lwesp_sta.c
${PROJ_PATH}/../../../lwesp/src/lwesp/lwesp_threads.c
${PROJ_PATH}/../../../lwesp/src/lwesp/lwesp_timeout.c
${PROJ_PATH}/../../../lwesp/src/lwesp/lwesp_unicode.c
${PROJ_PATH}/../../../lwesp/src/lwesp/lwesp_utils.c
${PROJ_PATH}/../../../lwesp/src/lwesp/lwesp_wps.c)

set(src_lwesp_api_SRCS
${PROJ_PATH}/../../../lwesp/src/api/lwesp_netconn.c)
${PROJ_PATH}/../../../lwesp/src/api/lwesp_netconn.c)

set(src_lwesp_apps_SRCS
${PROJ_PATH}/../../../lwesp/src/apps/mqtt/lwesp_mqtt_client.c
${PROJ_PATH}/../../../lwesp/src/apps/mqtt/lwesp_mqtt_client_api.c
${PROJ_PATH}/../../../lwesp/src/apps/mqtt/lwesp_mqtt_client_evt.c)
${PROJ_PATH}/../../../lwesp/src/apps/mqtt/lwesp_mqtt_client.c
${PROJ_PATH}/../../../lwesp/src/apps/mqtt/lwesp_mqtt_client_api.c
${PROJ_PATH}/../../../lwesp/src/apps/mqtt/lwesp_mqtt_client_evt.c)

set(src_lwesp_ll_SRCS
${PROJ_PATH}/../../../lwesp/src/system/lwesp_ll_stm32f429zi_nucleo.c
${PROJ_PATH}/../../../lwesp/src/system/lwesp_sys_cmsis_os.c)
${PROJ_PATH}/../../../lwesp/src/system/lwesp_ll_stm32f429zi_nucleo.c
${PROJ_PATH}/../../../lwesp/src/system/lwesp_sys_cmsis_os.c)

set(src_lwesp_snippets_SRCS
${PROJ_PATH}/../../../snippets/mqtt_client_api_cayenne.c
${PROJ_PATH}/../../../snippets/station_manager.c
${PROJ_PATH}/../../../snippets/utils.c)
${PROJ_PATH}/../../../snippets/mqtt_client_api_cayenne.c
${PROJ_PATH}/../../../snippets/station_manager.c
${PROJ_PATH}/../../../snippets/utils.c)

set(src_startup_SRCS
${PROJ_PATH}/STM32CubeIDE/startup/startup_stm32f429xx.s)
${PROJ_PATH}/STM32CubeIDE/startup/startup_stm32f429xx.s)

#
# Include directories
#
set(include_c_DIRS
${PROJ_PATH}/inc
${PROJ_PATH}/../../../snippets/include
${PROJ_PATH}/../../../lwesp/src/include
${PROJ_PATH}/../../../lwesp/src/include/system/port/cmsis_os
${PROJ_PATH}/../../lib/st/CMSIS/Include
${PROJ_PATH}/../../lib/st/STM32F4xx_HAL_Driver/Inc
${PROJ_PATH}/../../lib/st/CMSIS/Device/ST/STM32F4xx/Include
${PROJ_PATH}/../../lib/FreeRTOS/include
${PROJ_PATH}/../../lib/FreeRTOS/CMSIS_RTOS_V2
${PROJ_PATH}/../../lib/FreeRTOS/portable/GCC/ARM_CM4F
${PROJ_PATH}/../../../snippets/include
${PROJ_PATH}/../../../lwesp/src/include
${PROJ_PATH}/../../../lwesp/src/include/system/port/cmsis_os
${PROJ_PATH}/../../lib/st/CMSIS/Include
${PROJ_PATH}/../../lib/st/STM32F4xx_HAL_Driver/Inc
${PROJ_PATH}/../../lib/st/CMSIS/Device/ST/STM32F4xx/Include
${PROJ_PATH}/../../lib/FreeRTOS/include
${PROJ_PATH}/../../lib/FreeRTOS/CMSIS_RTOS_V2
${PROJ_PATH}/../../lib/FreeRTOS/portable/GCC/ARM_CM4F
)
set(include_cxx_DIRS

Expand All @@ -132,14 +132,14 @@ set(include_asm_DIRS
#
set(symbols_c_SYMB
"__weak=__attribute__((weak))"
"HSE_VALUE=8000000"
"__packed=__attribute__((__packed__))"
"STM32F429xx"
"USE_FULL_LL_DRIVER"
"HSE_VALUE=8000000"
"__packed=__attribute__((__packed__))"
"STM32F429xx"
"USE_FULL_LL_DRIVER"
)
set(symbols_cxx_SYMB
"STM32F10X_MD"
"USE_STDPERIPH_DRIVER"
"USE_STDPERIPH_DRIVER"
)
set(symbols_asm_SYMB

Expand All @@ -158,15 +158,15 @@ link_directories(${EXECUTABLE} ${link_DIRS})
# Executable files
#
add_executable(${EXECUTABLE}
${src_freertos_SRCS}
${src_stm32f4xx_hal_driver_SRCS}
${src_user_SRCS}
${src_lwesp_SRCS}
${src_lwesp_api_SRCS}
${src_lwesp_apps_SRCS}
${src_lwesp_ll_SRCS}
${src_lwesp_snippets_SRCS}
${src_startup_SRCS})
${src_freertos_SRCS}
${src_stm32f4xx_hal_driver_SRCS}
${src_user_SRCS}
${src_lwesp_SRCS}
${src_lwesp_api_SRCS}
${src_lwesp_apps_SRCS}
${src_lwesp_ll_SRCS}
${src_lwesp_snippets_SRCS}
${src_startup_SRCS})

#
# Add linked libraries for linker
Expand Down Expand Up @@ -237,7 +237,7 @@ target_compile_options(${EXECUTABLE} PRIVATE

# Setup linker parameters
target_link_options(${EXECUTABLE} PRIVATE
-T${MCU_LINKER_SCRIPT}${linker_script_SRC}
-T${linker_script_SRC}
${CPU_PARAMETERS}
-Wl,-Map=${CMAKE_PROJECT_NAME}.map
-u _printf_float # STDIO float formatting support (remove if not used)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"version": 4,
"configurations": [
{
/* ms-vscode.cmake-tools plugin shall to be installed, which provides include paths and defines through CMake file */
/* ms-vscode.cmake-tools plugin should be installed; it provides include paths and defines through CMake file */
"name": "STM32",
"includePath": [],
"defines": [],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
"runToMain": true,
"svdFile": "path/to/file.svd", //Path to SVD file to see registers
"v1": false,
"showDevDebugOutput": true,
"showDevDebugOutput": "both",

/* Will get automatically detected if STM32CubeIDE is installed to default directory
or it can be manually provided if necessary.. */
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,49 @@
"cwd": "${workspaceFolder}"
},
"problemMatcher": []
}
},
{
"type": "shell",
"label": "CubeProg: Flash project (SWD)",
"command": "STM32_Programmer_CLI",
"args": [
"--connect",
"port=swd",
"--download", "${command:cmake.launchTargetPath}",
"-hardRst"
],
"options": {
"cwd": "${workspaceFolder}"
},
"problemMatcher": []
},
{
"type": "shell",
"label": "CubeProg: Flash project with defined serial number (SWD) - you must set serial number first",
"command": "STM32_Programmer_CLI",
"args": [
"--connect",
"port=swd",
"sn=<yourserialnumber>",
"--download", "${command:cmake.launchTargetPath}",
"-hardRst"
],
"options": {
"cwd": "${workspaceFolder}"
},
"problemMatcher": []
},
{
"type": "shell",
"label": "CubeProg: List all available communication interfaces",
"command": "STM32_Programmer_CLI",
"args": [
"--list",
],
"options": {
"cwd": "${workspaceFolder}"
},
"problemMatcher": []
},
]
}

0 comments on commit e2cef42

Please sign in to comment.