mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-10-18 03:43:34 +08:00
Jenkins px4fmu-v2 hardware test
This commit is contained in:
@@ -1,8 +1,6 @@
|
||||
#
|
||||
# Various PX4-specific macros
|
||||
#
|
||||
source platforms/nuttx/Debug/NuttX
|
||||
source platforms/nuttx/Debug/ARMv7M
|
||||
|
||||
echo Loading PX4 GDB macros. Use 'help px4' for more information.\n
|
||||
|
||||
|
||||
@@ -0,0 +1,14 @@
|
||||
source ${PX4_SOURCE_DIR}/platforms/nuttx/Debug/PX4
|
||||
source ${PX4_SOURCE_DIR}/platforms/nuttx/Debug/NuttX
|
||||
source ${PX4_SOURCE_DIR}/platforms/nuttx/Debug/ARMv7M
|
||||
|
||||
set mem inaccessible-by-default off
|
||||
|
||||
set print pretty
|
||||
|
||||
set pagination off
|
||||
|
||||
set history save on
|
||||
set history size unlimited
|
||||
|
||||
set logging on
|
||||
Executable
+3
@@ -0,0 +1,3 @@
|
||||
#! /bin/sh
|
||||
|
||||
JLinkGDBServerCLExe -startserver -USB -device Cortex-M4 -if SWD -speed auto > jlink.log &
|
||||
@@ -1,22 +0,0 @@
|
||||
# program a bootable device load on a mavstation
|
||||
# To run type openocd -f mavprogram.cfg
|
||||
|
||||
source [find interface/olimex-arm-usb-ocd-h.cfg]
|
||||
source [find px4fmu-board.cfg]
|
||||
|
||||
init
|
||||
halt
|
||||
|
||||
# Find the flash inside this CPU
|
||||
flash probe 0
|
||||
|
||||
# erase it (128 pages) then program and exit
|
||||
|
||||
#flash erase_sector 0 0 127
|
||||
# stm32f1x mass_erase 0
|
||||
|
||||
# It seems that Pat's image has a start address offset of 0x1000 but the vectors need to be at zero, so fixbin.sh moves things around
|
||||
#flash write_bank 0 fixed.bin 0
|
||||
#flash write_image firmware.elf
|
||||
#shutdown
|
||||
|
||||
@@ -1,21 +0,0 @@
|
||||
target remote :3333
|
||||
|
||||
# Don't let GDB get confused while stepping
|
||||
define hook-step
|
||||
mon cortex_m maskisr on
|
||||
end
|
||||
define hookpost-step
|
||||
mon cortex_m maskisr off
|
||||
end
|
||||
|
||||
mon init
|
||||
mon stm32_init
|
||||
# mon reset halt
|
||||
mon poll
|
||||
mon cortex_m maskisr auto
|
||||
set mem inaccessible-by-default off
|
||||
set print pretty
|
||||
source platforms/nuttx/Debug/PX4
|
||||
|
||||
echo PX4 resumed, press ctrl-c to interrupt\n
|
||||
continue
|
||||
@@ -18,7 +18,7 @@
|
||||
#
|
||||
|
||||
set -e
|
||||
root=$(dirname $0)/..
|
||||
root=$(dirname $0)
|
||||
|
||||
function die()
|
||||
{
|
||||
@@ -77,7 +77,7 @@ do
|
||||
shift
|
||||
done
|
||||
|
||||
[[ -z "$elf" ]] && die "Please specify the ELF file location, e.g.: build/px4fmu-v4_default/src/firmware/nuttx/firmware_nuttx"
|
||||
[[ -z "$elf" ]] && die "Please specify the ELF file location, e.g.: build/nuttx_px4fmu-v4_default/nuttx_px4fmu-v4_default.elf"
|
||||
|
||||
#
|
||||
# Temporary files
|
||||
@@ -102,7 +102,8 @@ then
|
||||
do
|
||||
if [[ "$taskname" = "" ]]
|
||||
then
|
||||
arm-none-eabi-gdb $elf --batch -ex "set print asm-demangle on" \
|
||||
arm-none-eabi-gdb $elf --nx --quiet --batch \
|
||||
-ex "set print asm-demangle on" \
|
||||
-ex "target extended /dev/ttyACM0" \
|
||||
-ex "monitor swdp_scan" \
|
||||
-ex "attach 1" \
|
||||
@@ -111,11 +112,12 @@ then
|
||||
| sed -n 's/\(#.*\)/\1/p' \
|
||||
>> $stacksfile
|
||||
else
|
||||
arm-none-eabi-gdb $elf --batch -ex "set print asm-demangle on" \
|
||||
arm-none-eabi-gdb $elf --nx --quiet --batch \
|
||||
-ex "set print asm-demangle on" \
|
||||
-ex "target extended /dev/ttyACM0" \
|
||||
-ex "monitor swdp_scan" \
|
||||
-ex "attach 1" \
|
||||
-ex "source $root/platforms/nuttx/Debug/Nuttx.py" \
|
||||
-ex "source $root/Nuttx.py" \
|
||||
-ex "show mybt $taskname" \
|
||||
2> $gdberrfile \
|
||||
| sed -n 's/0\.0:\(#.*\)/\1/p' \
|
||||
|
||||
@@ -1,37 +0,0 @@
|
||||
# The latest defaults in OpenOCD 0.7.0 are actually prettymuch correct for the px4fmu
|
||||
|
||||
# increase working area to 32KB for faster flash programming
|
||||
set WORKAREASIZE 0x8000
|
||||
|
||||
source [find target/stm32f4x.cfg]
|
||||
|
||||
# needed for px4
|
||||
reset_config trst_only
|
||||
|
||||
proc stm32_reset {} {
|
||||
reset halt
|
||||
# FIXME - needed to init periphs on reset
|
||||
# 0x40023800 RCC base
|
||||
# 0x24 RCC_APB2 0x75933
|
||||
# RCC_APB2 0
|
||||
}
|
||||
|
||||
# perform init that is required on each connection to the target
|
||||
proc stm32_init {} {
|
||||
|
||||
# force jtag to not shutdown during sleep
|
||||
#uint32_t cr = getreg32(STM32_DBGMCU_CR);
|
||||
#cr |= DBGMCU_CR_STANDBY | DBGMCU_CR_STOP | DBGMCU_CR_SLEEP;
|
||||
#putreg32(cr, STM32_DBGMCU_CR);
|
||||
mww 0xe0042004 00000007
|
||||
}
|
||||
|
||||
# if srst is not fitted use SYSRESETREQ to
|
||||
# perform a soft reset
|
||||
cortex_m reset_config sysresetreq
|
||||
|
||||
# Let GDB directly program elf binaries
|
||||
gdb_memory_map enable
|
||||
|
||||
# doesn't work yet
|
||||
gdb_flash_program disable
|
||||
@@ -1,5 +0,0 @@
|
||||
#!/bin/bash
|
||||
|
||||
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
|
||||
|
||||
openocd -f interface/olimex-arm-usb-ocd-h.cfg -f $DIR/px4fmu-board.cfg
|
||||
Reference in New Issue
Block a user