diff --git a/Makefile b/Makefile index be76152..32eb514 100644 --- a/Makefile +++ b/Makefile @@ -16,7 +16,7 @@ GEX_PLAT=F072_DISCOVERY ###################################### # target ###################################### -TARGET = gex-f072 +TARGET = firmware ###################################### @@ -139,7 +139,8 @@ AS_DEFS = # C defines C_DEFS = \ -DUSE_HAL_DRIVER \ --DSTM32F072xB +-DSTM32F072xB \ +-DARM_MATH_CM0PLUS C_DEFS += -DGEX_PLAT_$(GEX_PLAT) $(GEX_CDEFS) diff --git a/User b/User index ce80895..6f749f0 160000 --- a/User +++ b/User @@ -1 +1 @@ -Subproject commit ce80895b25b5b85cbedc7ca3bb200b2d31812563 +Subproject commit 6f749f0198656a76526bc28206e62fd07454f917 diff --git a/attach.gdb b/attach.gdb new file mode 100644 index 0000000..7cbc7db --- /dev/null +++ b/attach.gdb @@ -0,0 +1,4 @@ +target remote | openocd -f openocd.cfg -f gdb-pipe.cfg +monitor halt +monitor gdb_sync +stepi diff --git a/dbg-client.sh b/dbg-client.sh new file mode 100755 index 0000000..ab1d9bc --- /dev/null +++ b/dbg-client.sh @@ -0,0 +1,3 @@ +#!/bin/bash + +xterm -e "telnet localhost 4444" & diff --git a/dbg-server.sh b/dbg-server.sh new file mode 100755 index 0000000..e824795 --- /dev/null +++ b/dbg-server.sh @@ -0,0 +1,3 @@ +#!/bin/bash + +xterm -e "openocd -f openocd_f072.cfg" & diff --git a/gdb-pipe.cfg b/gdb-pipe.cfg new file mode 100644 index 0000000..c601f25 --- /dev/null +++ b/gdb-pipe.cfg @@ -0,0 +1,7 @@ +gdb_port pipe +log_output openocd.log + +$_TARGETNAME configure -event gdb-detach { + echo "Debugger detaching: resuming execution." + resume +} diff --git a/openocd.cfg b/openocd.cfg new file mode 100644 index 0000000..3735268 --- /dev/null +++ b/openocd.cfg @@ -0,0 +1,10 @@ +# This is an ST NUCLEO F103RB board with a single STM32F103RBT6 chip. +# http://www.st.com/web/catalog/tools/FM116/SC959/SS1532/LN1847/PF259875 + +source [find interface/stlink-v2.cfg] + +#transport select hla_swd + +source [find target/stm32f0x.cfg] + +#reset_config srst_only diff --git a/openocd.log b/openocd.log new file mode 100644 index 0000000..455bcce --- /dev/null +++ b/openocd.log @@ -0,0 +1,25 @@ +Info : Unable to match requested speed 1000 kHz, using 950 kHz +Info : Unable to match requested speed 1000 kHz, using 950 kHz +Info : clock speed 950 kHz +Info : STLINK v2 JTAG v29 API v2 SWIM v0 VID 0x0483 PID 0x3748 +Info : using stlink api v2 +Info : Target voltage: 2.913574 +Info : stm32f0x.cpu: hardware has 4 breakpoints, 2 watchpoints +Info : accepting 'gdb' connection from pipe +Info : device id = 0x20016448 +Info : flash size = 128kbytes +undefined debug reason 7 - target needs reset +target halted due to debug-request, current mode: Handler HardFault +xPSR: 0x41000003 pc: 0xfffffffe msp: 0x20004fe0 +Warn : stepi ignored. GDB will now fetch the register state from the target. +Info : Unable to match requested speed 1000 kHz, using 950 kHz +Info : Unable to match requested speed 1000 kHz, using 950 kHz +adapter speed: 950 kHz +target halted due to debug-request, current mode: Thread +xPSR: 0xc1000000 pc: 0x08009658 msp: 0x20005000 +Debugger detaching: resuming execution. +Debugger detaching: resuming execution. +Warn : target not halted + + +Info : dropped 'gdb' connection diff --git a/run.gdb b/run.gdb new file mode 100644 index 0000000..4de1ec0 --- /dev/null +++ b/run.gdb @@ -0,0 +1,4 @@ +source attach.gdb +monitor reset halt +tbreak main +continue