mirror of
https://github.com/PX4/PX4-Autopilot.git
synced 2026-06-01 02:55:07 +08:00
add bootloader flash helper target (jlink_flash_bootloader)
This commit is contained in:
committed by
Lorenz Meier
parent
8816601efb
commit
f725813128
@@ -0,0 +1,9 @@
|
|||||||
|
Device @DEBUG_DEVICE@
|
||||||
|
eoe 1
|
||||||
|
si SWD
|
||||||
|
speed auto
|
||||||
|
r
|
||||||
|
h
|
||||||
|
loadbin @BOARD_BL_FIRMWARE_BIN@,0x08000000
|
||||||
|
go
|
||||||
|
qc
|
||||||
@@ -81,3 +81,26 @@ if(Ozone_PATH)
|
|||||||
USES_TERMINAL
|
USES_TERMINAL
|
||||||
)
|
)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
|
if(bootloader_bin OR (EXISTS "${PX4_BOARD_DIR}/bootloader/${PX4_BOARD_VENDOR}_${PX4_BOARD_MODEL}_bootloader.bin"))
|
||||||
|
# jlink_flash_bootloader
|
||||||
|
find_program(JLinkExe_PATH JLinkExe)
|
||||||
|
if(JLinkExe_PATH)
|
||||||
|
|
||||||
|
if(bootloader_bin)
|
||||||
|
set(BOARD_BL_FIRMWARE_BIN ${bootloader_bin})
|
||||||
|
else()
|
||||||
|
set(BOARD_BL_FIRMWARE_BIN ${PX4_BOARD_DIR}/bootloader/${PX4_BOARD_VENDOR}_${PX4_BOARD_MODEL}_bootloader.bin)
|
||||||
|
endif()
|
||||||
|
|
||||||
|
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/Debug/flash_bootloader.jlink.in ${PX4_BINARY_DIR}/flash_bootloader.jlink @ONLY)
|
||||||
|
add_custom_target(jlink_flash_bootloader
|
||||||
|
COMMAND ${JLinkExe_PATH} -CommandFile ${PX4_BINARY_DIR}/flash_bootloader.jlink
|
||||||
|
DEPENDS
|
||||||
|
px4
|
||||||
|
${CMAKE_CURRENT_SOURCE_DIR}/Debug/flash_bootloader.jlink.in
|
||||||
|
WORKING_DIRECTORY ${PX4_BINARY_DIR}
|
||||||
|
USES_TERMINAL
|
||||||
|
)
|
||||||
|
endif()
|
||||||
|
endif()
|
||||||
|
|||||||
Reference in New Issue
Block a user