mirror of
https://github.com/iNavFlight/inav.git
synced 2025-07-17 13:25:27 +03:00
[BUILD] Add support for openocd helpers with cmake
- Add openocd_<target>: runs openocd for the target - Add openocd_flash_<target>: flashes the target using openocd. It works with both an already running openocd instance as well as launching its own one. Uses a helper tool that requires python. - Add openocd_cfg_<target>: generates openocd config for target. Used for generating an openocd config automatically when launching a debug session from an IDE.
This commit is contained in:
parent
fb9f61a583
commit
d6177e6933
10 changed files with 211 additions and 11 deletions
|
@ -157,11 +157,12 @@ function(target_stm32 name startup ldscript)
|
|||
# Parse keyword arguments
|
||||
cmake_parse_arguments(
|
||||
PARSED_ARGS
|
||||
"DISABLE_MSC" # Boolean arguments
|
||||
"HSE_MHZ" # Single value arguments
|
||||
"DEFINITIONS" # Multi-value arguments
|
||||
${ARGN} # Start parsing after the known arguments
|
||||
"DISABLE_MSC" # Boolean arguments
|
||||
"HSE_MHZ;OPENOCD_TARGET" # Single value arguments
|
||||
"DEFINITIONS" # Multi-value arguments
|
||||
${ARGN} # Start parsing after the known arguments
|
||||
)
|
||||
|
||||
if (PARSED_ARGS_HSE_MHZ)
|
||||
set(hse_mhz ${PARSED_ARGS_HSE_MHZ})
|
||||
else()
|
||||
|
@ -210,6 +211,8 @@ function(target_stm32 name startup ldscript)
|
|||
endif()
|
||||
endif()
|
||||
endif()
|
||||
set_property(TARGET ${name} PROPERTY OPENOCD_TARGET ${PARSED_ARGS_OPENOCD_TARGET})
|
||||
set_property(TARGET ${name} PROPERTY OPENOCD_DEFAULT_INTERFACE stlink)
|
||||
# Generate .hex
|
||||
# XXX: Generator expressions are not supported for add_custom_command()
|
||||
# OUTPUT nor BYPRODUCTS, so we can't rely of them. Instead, build the filename
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue