Skip to content
Snippets Groups Projects
Commit 8a365179 authored by px4dev's avatar px4dev
Browse files

Fresh import of the PX4 firmware sources.

parents
No related branches found
No related tags found
No related merge requests found
Showing
with 333 additions and 0 deletions
#
# Generic GDB macros for working with NuttX
#
echo Loading NuttX GDB macros. Use 'help nuttx' for more information.\n
define nuttx
echo Use 'help nuttx' for more information.\n
end
document nuttx
. Various macros for working with NuttX.
.
. showheap
. Prints the contents of the malloc heap(s).
. showtasks
. Prints a list of all tasks.
. showtask <address>
. Prints information about the task at <address>
.
. Use 'help <macro>' for more specific help.
end
################################################################################
# Heap display
################################################################################
define _showheap
set $index = $arg0
if (sizeof(struct mm_allocnode_s) == 4)
set $MM_ALLOC_BIT = 0x8000
else
set $MM_ALLOC_BIT = 0x80000000
end
printf "HEAP %d %p - %p\n", $index, g_heapstart[$index], g_heapend[$index]
printf "ptr size\n"
set $node = (char *)g_heapstart[$index] + sizeof(struct mm_allocnode_s)
while $node < g_heapend[$index]
printf " %p", $node
set $nodestruct = (struct mm_allocnode_s *)$node
printf " %u", $nodestruct->size
if !($nodestruct->preceding & $MM_ALLOC_BIT)
printf " FREE"
end
if ($nodestruct->size > g_heapsize) || (($node + $nodestruct->size) > g_heapend[$index])
printf " (BAD SIZE)"
end
printf "\n"
set $node = $node + $nodestruct->size
end
end
define showheap
set $nheaps = sizeof(g_heapstart) / sizeof(g_heapstart[0])
printf "Printing %d heaps\n", $nheaps
set $heapindex = (int)0
while $heapindex < $nheaps
showheap $heapindex
set $heapindex = $heapindex + 1
end
end
document showheap
. showheap
. Prints the contents of the malloc heap(s).
end
################################################################################
# Task display
################################################################################
define _showtask_oneline
set $task = (struct _TCB *)$arg0
printf " %p %.2d %.3d %s\n", $task, $task->pid, $task->sched_priority, $task->name
end
define _showtasklist
set $queue = (dq_queue_t *)$arg0
set $cursor = (dq_entry_t *)$queue->head
if $cursor != 0
printf " TCB PID PRI\n"
else
printf " <none>\n"
end
while $cursor != 0
_showtask_oneline $cursor
if $cursor == $queue->tail
set $cursor = 0
else
set $next = $cursor->flink
if $next->blink != $cursor
printf "task linkage corrupt\n"
set $cursor = 0
else
set $cursor = $next
end
end
end
end
#
# Print task registers for a NuttX v7em target with FPU enabled.
#
define _showtaskregs_v7em
set $task = (struct _TCB *)$arg0
set $regs = (uint32_t *)&($task->xcp.regs[0])
printf " r0: 0x%08x 0x%08x 0x%08x 0x%08x 0x%08x 0x%08x 0x%08x 0x%08x\n", $regs[27], $regs[28], $regs[29], $regs[30], $regs[2], $regs[3], $regs[4], $regs[5]
printf " r8: 0x%08x 0x%08x 0x%08x 0x%08x 0x%08x 0x%08x 0x%08x 0x%08x\n", $regs[6], $regs[7], $regs[8], $regs[9], $regs[31], $regs[0], $regs[32], $regs[33]
printf " XPSR 0x%08x EXC_RETURN 0x%08x PRIMASK 0x%08x\n", $regs[34], $regs[10], $regs[1]
end
#
# Print current registers for a NuttX v7em target with FPU enabled.
#
define _showcurrentregs_v7em
printf " r0: 0x%08x 0x%08x 0x%08x 0x%08x 0x%08x 0x%08x 0x%08x 0x%08x\n", $r0, $r1, $r2, $r3, $r4, $r5, $r6, $r7
printf " r8: 0x%08x 0x%08x 0x%08x 0x%08x 0x%08x 0x%08x 0x%08x 0x%08x\n", $r8, $r9, $r10, $r11, $r12, $r13, $r14, $r15
printf " XPSR 0x%08x\n", $xpsr
end
#
# Print details of a semaphore
#
define _showsemaphore
printf "count %d ", $arg0->semcount
if $arg0->hlist.holder != 0
set $_task = (struct _TCB *)$arg0->hlist.holder
printf "held by %s", $_task->name
end
printf "\n"
end
define showtask
set $task = (struct _TCB *)$arg0
printf "%p %.2d ", $task, $task->pid
_showtaskstate $task
printf " %s\n", $task->name
set $stack_free = 0
while ($stack_free < $task->adj_stack_size) && *(uint8_t *)($task->stack_alloc_ptr + $stack_free)
set $stack_free = $stack_free + 1
end
printf" stack 0x%08x-0x%08x (%d) %d free\n", $task->stack_alloc_ptr, $task->adj_stack_ptr, $task->adj_stack_size, $stack_free
if $task->task_state == TSTATE_WAIT_SEM
printf " waiting on %p ", $task->waitsem
_showsemaphore $task->waitsem
end
if $task->task_state != TSTATE_TASK_RUNNING
_showtaskregs_v7em $task
else
_showcurrentregs_v7em
end
# XXX print registers here
end
document showtask
. showtask <TCB pointer>
. Print details of a task.
end
define _showtaskstate
if $arg0->task_state == TSTATE_TASK_INVALID
printf "INVALID"
end
if $arg0->task_state == TSTATE_TASK_PENDING
printf "PENDING"
end
if $arg0->task_state == TSTATE_TASK_READYTORUN
printf "READYTORUN"
end
if $arg0->task_state == TSTATE_TASK_RUNNING
printf "RUNNING"
end
if $arg0->task_state == TSTATE_TASK_INACTIVE
printf "INACTIVE"
end
if $arg0->task_state == TSTATE_WAIT_SEM
printf "WAIT_SEM"
end
if $arg0->task_state == TSTATE_WAIT_SIG
printf "WAIT_SIG"
end
if $arg0->task_state > TSTATE_WAIT_SIG
printf "%d", $arg0->task_state
end
end
define showtasks
printf "PENDING\n"
_showtasklist &g_pendingtasks
printf "RUNNABLE\n"
_showtasklist &g_readytorun
printf "WAITING\n"
_showtasklist &g_waitingforsemaphore
printf "INACTIVE\n"
_showtasklist &g_inactivetasks
end
document showtasks
. showtasks
. Print a list of all tasks in the system, separated into their respective queues.
end
#
# Setup macros for the BlackMagic debug probe and NuttX.
#
mon swdp_scan
attach 1
define f4_memdump
shell mkdir -p /tmp/dump
printf "Dumping CCSRAM to /tmp/dump/ccsram\n"
dump memory /tmp/dump/ccsram 0x10000000 0x10010000
printf "Dumping SRAM to /tmp/dump/sram\n"
dump memory /tmp/dump/sram 0x20000000 0x20020000
end
document f4_memdump
Dumps the STM32F4 memory to files in /tmp/dump.
end
# script for stm32f2xxx
if { [info exists CHIPNAME] } {
set _CHIPNAME $CHIPNAME
} else {
set _CHIPNAME stm32f4xxx
}
if { [info exists ENDIAN] } {
set _ENDIAN $ENDIAN
} else {
set _ENDIAN little
}
# Work-area is a space in RAM used for flash programming
# By default use 64kB
if { [info exists WORKAREASIZE] } {
set _WORKAREASIZE $WORKAREASIZE
} else {
set _WORKAREASIZE 0x10000
}
# JTAG speed should be <= F_CPU/6. F_CPU after reset is 8MHz, so use F_JTAG = 1MHz
#
# Since we may be running of an RC oscilator, we crank down the speed a
# bit more to be on the safe side. Perhaps superstition, but if are
# running off a crystal, we can run closer to the limit. Note
# that there can be a pretty wide band where things are more or less stable.
jtag_khz 1000
jtag_nsrst_delay 100
jtag_ntrst_delay 100
#jtag scan chain
if { [info exists CPUTAPID ] } {
set _CPUTAPID $CPUTAPID
} else {
# See STM Document RM0033
# Section 32.6.3 - corresponds to Cortex-M3 r2p0
set _CPUTAPID 0x4ba00477
}
jtag newtap $_CHIPNAME cpu -irlen 4 -ircapture 0x1 -irmask 0xf -expected-id $_CPUTAPID
if { [info exists BSTAPID ] } {
set _BSTAPID $BSTAPID
} else {
# See STM Document RM0033
# Section 32.6.2
#
set _BSTAPID 0x06413041
}
jtag newtap $_CHIPNAME bs -irlen 5 -expected-id $_BSTAPID
set _TARGETNAME $_CHIPNAME.cpu
target create $_TARGETNAME cortex_m3 -endian $_ENDIAN -chain-position $_TARGETNAME -rtos auto
$_TARGETNAME configure -work-area-phys 0x20000000 -work-area-size $_WORKAREASIZE -work-area-backup 0
set _FLASHNAME $_CHIPNAME.flash
flash bank $_FLASHNAME stm32f2x 0 0 0 0 $_TARGETNAME
# if srst is not fitted use SYSRESETREQ to
# perform a soft reset
cortex_m3 reset_config sysresetreq
This diff is collapsed.
Linux/Mac OS X
==============
To install doxygen:
$sudo apt-get install doxygen
If the above does not work go to:
http://www.stack.nl/~dimitri/doxygen/download.html for the correct download.
Then go to the following website for inforamtion on the install:
http://www.stack.nl/~dimitri/doxygen/install.html
Then to generate the html, run the following code while you are in the qgroundcontrol/doc directory:
$doxygen Doxyfile
The html file index.html should be in doc/html unless you changed the output directory.
The other option for generating the documentation is to use the wizard:
$doxywizard &
doxywizard information:
http://www.stack.nl/~dimitri/doxygen/doxywizard_usage.html
Or go to the Doxygen Manual for information at the website noted below.
Windows
=======
Go to the following website for the correct download and follow the wizard to install:
http://www.stack.nl/~dimitri/doxygen/download.html
Run the wizard to generate the documentation.
Go to the website below or the Doxygen Manual for information on running doxywizard.
http://www.stack.nl/~dimitri/doxygen/doxywizard_usage.html
Doxygen Manual
==============
http://www.stack.nl/~dimitri/doxygen/
File added
File added
File added
File added
Documentation/commander_app.png

56.5 KiB

#!/bin/sh
rm -rf html
doxygen
\ No newline at end of file
File added
File added
Documentation/inter_app_communication.png

20 KiB

File added
File added
Documentation/position_estimator_app.png

28.9 KiB

Documentation/px4_general_structure.png

91.8 KiB

Documentation/state_machine.png

206 KiB

0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment