#
# GDB init file for LPC2xxx family
#

set complaints 1
set output-radix 16
set input-radix 16

# GDB must be set to big endian mode first if needed.
#set endian little

# add str9lib src to gdb search path
#dir /cygdrive/c/progra~1/anglia/idealist/examples/stm32/libstr32x/src
#dir C:/Progra~1/Anglia/IDEaliST/examples/stm32/libstm32x/src

# change gdb prompt
set prompt (arm-gdb)

# You will need to change this to reflect the address of your jtag interface.
#target remote localhost:2000

# The libremote daemon must be set to big endian before the
# executable is loaded.
#monitor endian little

# Increase the packet size to improve download speed.
# to view current setting use:
# show remote memory-write-packet-size

set remote memory-write-packet-size 1024
#set remote memory-write-packet-size fixed

set remote memory-read-packet-size 1024
#set remote memory-read-packet-size fixed
set remote hardware-watchpoint-limit 6
set remote hardware-breakpoint-limit 6

# Load the program executable (ram only)
#load

# Set a breakpoint at main().
#b main

# Run to the breakpoint.
#c

#
# GDB command helpers
#

#
# reset and map 0 to internal ram
#

#define ramreset
#reset
#set *(int*)0xE000ED08 = 0x40000000
#echo Internal RAM set to address 0x0.
#end

#
# reset and map 0 to flash
#

define flashreset
reset
thb main
echo Internal Flash set to address 0x0.
end

#
# reset target
#

define reset
monitor reset
end

#document ramreset
#ramreset
#Causes a target reset, remaps Internal RAM to address 0x0.
#end

document flashreset
flashreset
Causes a target reset, remaps Internal Flash to address 0x0.
A temporary breakpoint is set at start of function main
end

document reset
reset
Causes a target reset.
end
