mirror of
https://gitee.com/xiaohuolufeihua/bizhang_-obav.git
synced 2026-05-21 01:12:11 +00:00
create jlink gdb upload script and use in Jenkins Hardware pipeline
This commit is contained in:
@@ -349,27 +349,24 @@ if(black_magic_probe_path)
|
||||
endif()
|
||||
|
||||
add_custom_target(jlink_upload
|
||||
COMMAND ${CMAKE_CURRENT_SOURCE_DIR}/Debug/jlink.sh
|
||||
COMMAND ${GDB} --nx --batch
|
||||
-iex 'set auto-load safe-path ${PX4_BINARY_DIR}'
|
||||
-ex 'target remote localhost:2331'
|
||||
-ex 'monitor reset'
|
||||
-ex 'load'
|
||||
-ex 'kill'
|
||||
$<TARGET_FILE:px4>
|
||||
DEPENDS px4 ${PX4_BINARY_DIR}/.gdbinit
|
||||
COMMAND ${CMAKE_CURRENT_SOURCE_DIR}/Debug/jlink_gdb_start.sh
|
||||
COMMAND ${CMAKE_CURRENT_SOURCE_DIR}/Debug/jlink_gdb_upload.sh $<TARGET_FILE:px4>
|
||||
DEPENDS px4
|
||||
WORKING_DIRECTORY ${PX4_BINARY_DIR}
|
||||
USES_TERMINAL
|
||||
)
|
||||
|
||||
add_custom_target(jlink_debug
|
||||
COMMAND ${CMAKE_CURRENT_SOURCE_DIR}/Debug/jlink.sh
|
||||
COMMAND ${GDB} --nh
|
||||
COMMAND ${CMAKE_CURRENT_SOURCE_DIR}/Debug/jlink_gdb_start.sh
|
||||
COMMAND ${GDB} -nh
|
||||
-iex 'set auto-load safe-path ${PX4_BINARY_DIR}'
|
||||
-ex 'target remote localhost:2331'
|
||||
-ex 'monitor reset'
|
||||
-ex 'monitor reset 0'
|
||||
-ex 'load'
|
||||
-ex 'monitor reset'
|
||||
-ex 'compare-sections'
|
||||
-ex 'monitor reset 0'
|
||||
-ex 'monitor sleep 1000'
|
||||
-ex 'monitor go'
|
||||
-ex 'continue'
|
||||
$<TARGET_FILE:px4>
|
||||
DEPENDS px4 ${PX4_BINARY_DIR}/.gdbinit
|
||||
|
||||
@@ -1,6 +1,11 @@
|
||||
source ${PX4_SOURCE_DIR}/platforms/nuttx/Debug/PX4
|
||||
help px4
|
||||
|
||||
source ${PX4_SOURCE_DIR}/platforms/nuttx/Debug/NuttX
|
||||
help nuttx
|
||||
|
||||
source ${PX4_SOURCE_DIR}/platforms/nuttx/Debug/ARMv7M
|
||||
help armv7m
|
||||
|
||||
set mem inaccessible-by-default off
|
||||
|
||||
|
||||
@@ -1,3 +0,0 @@
|
||||
#! /bin/sh
|
||||
|
||||
JLinkGDBServerCLExe -startserver -USB -device Cortex-M4 -if SWD -speed auto > jlink.log &
|
||||
7
platforms/nuttx/Debug/jlink_gdb_start.sh
Executable file
7
platforms/nuttx/Debug/jlink_gdb_start.sh
Executable file
@@ -0,0 +1,7 @@
|
||||
#! /bin/sh
|
||||
|
||||
killall JLinkGDBServerCLExe
|
||||
|
||||
# TODO: set device from nuttx config
|
||||
# eg CONFIG_ARCH_CHIP_STM32F427V or CONFIG_STM32_STM32F427
|
||||
JLinkGDBServerCLExe -device STM32F427II -select usb -silent -endian little -if SWD -speed auto -ir -LocalhostOnly 1 -strict -vd -singlerun &
|
||||
12
platforms/nuttx/Debug/jlink_gdb_upload.sh
Executable file
12
platforms/nuttx/Debug/jlink_gdb_upload.sh
Executable file
@@ -0,0 +1,12 @@
|
||||
#! /bin/sh
|
||||
|
||||
gdb-multiarch -nx -batch \
|
||||
-ex "target remote localhost:2331" \
|
||||
-ex "monitor reset 0" \
|
||||
-ex "load" \
|
||||
-ex "compare-sections" \
|
||||
-ex "monitor reset 0" \
|
||||
-ex "monitor sleep 1000" \
|
||||
-ex "monitor go" \
|
||||
-ex "kill" \
|
||||
${1}
|
||||
Reference in New Issue
Block a user