#################### daemon config ####################
telnet_port 4444
gdb_port 3333
tcl_port 6666
#################### interface config ####################
interface ft2232
ft2232_layout "flyswatter"
ft2232_device_desc "Flyswatter A"
ft2232_vid_pid 0x0403 0x6010
##################### JTAG config #####################
adapter_nsrst_assert_width 20
jtag_ntrst_assert_width
adapter_khz 500
reset_config trst_and_srst trst_open_drain srst_open_drain
jtag newtap lpc4300_m4 cpu -irlen 4 -ircapture 0x1 -irmask 0xf -expected-id 0x4ba00477
jtag newtap lpc4300_m0 cpu -irlen 4 -ircapture 0x1 -irmask 0xf -expected-id 0x0ba01477
set _TARGETNAME lpc4300.m4
target create $_TARGETNAME cortex_m3 -chain-position lpc4300_m4.cpu
#cortex_m3 reset_config sysresetreq
# work area is 16k on AHB0
$_TARGETNAME configure -work-area-phys 0x10000000 -work-area-size 0x8000 -work-area-backup 0
$_TARGETNAME configure -event gdb-attach {
echo "--- gdb-attach, hello gdb ---"
soft_reset_halt
}
$_TARGETNAME configure -event gdb-detach {
echo "--- gdb-detach, shutting down ---"
shutdown
}
set _FLASHNAME $_TARGETNAME.flash
set _SPIFINAME $_TARGETNAME.spifi
#debug_level 3
flash bank $_FLASHNAME lpc2000 0x1A000000 0x80000 0 0 $_TARGETNAME lpc4300 96000 calc_checksum
flash bank $_SPIFINAME lpcspifi 0x14000000 0 0 0 $_TARGETNAME
init
halt
#display VTOR
mdw 0xE000ED08
#M4 Mem map - shadow pointer that shows up at address 0
mdw 0x40043100
flash write_image erase YOURFILEHERE.hex 0 ihex
#flash write_image erase YOURSPIFIFILEHERE.hex 0 ihex
soft_reset_halt
# set M4MEMMAP to the base of flash bank A
mww 0x40043100 0x1A000000
mdw 0x40043100
# set VTOR to 0 (which will map to flash)
mww 0xE000ED08 0x00000000
mdw 0xE000ED08
echo "\n---- ready for GDB connection ----\n"
|