diff --git a/boop/Makefile b/boop/Makefile index 8109d9a..8a4eaf4 100644 --- a/boop/Makefile +++ b/boop/Makefile @@ -25,8 +25,9 @@ #ARMPATH = $(ARMBASE)/bin/ TOOLPREFIX = arm-none-eabi- LPCTOOL = lpctool -OPENOCDPATH = F:\Tools\OpenOCD -OPENOCD = $(OPENOCDPATH)\openocd.exe -f betty.cfg -f $(OPENOCDPATH)\interface\uniprog.cfg +OPENOCDPATH = F:\Tools\OpenOCD_0_10 +#OPENOCD = $(OPENOCDPATH)\bin\openocd.exe -f $(OPENOCDPATH)\scripts\interface\jlink.cfg -f betty.cfg +OPENOCD = $(OPENOCDPATH)\bin\openocd.exe -f $(OPENOCDPATH)\scripts\interface\uniprog.cfg -f betty.cfg ############################################################### ##### @@ -42,12 +43,9 @@ OD = $(ARMPATH)$(TOOLPREFIX)objdump SIZE = $(ARMPATH)$(TOOLPREFIX)size CPUFLAGS = -mcpu=arm7tdmi-s -OPTFLAGS = -Os -CFLAGS = -Wall -mthumb-interwork +CFLAGS = -Wall -mthumb-interwork -g3 -c INC = -I. -Iinterrupt -Idisplay -Ikeyboard -Iaudio -Iinfrared -Iserial -Iflash -Icc1100 -Igui -Itimer -Igames -Iadc -Irtc -Itools ASFLAGS = -g -I. -mthumb-interwork -#LDFLAGS = -Tlpc2220_rom.ld -Map boop.map -#LIBS = -lc -lgcc LDFLAGS = -mthumb-interwork -nostartfiles -Xlinker -Map -Xlinker boop.map -Tlpc2220_rom.ld THUMBFLAGS = -mthumb @@ -55,6 +53,9 @@ COMPILE = $(CC) $(CPUFLAGS) $(CFLAGS) $(INC) ifeq ($(MAKECMDGOALS),debug) COMPILE += -D DEBUGMODE + OPTFLAGS = -O0 +else + OPTFLAGS = -Os endif ifeq ($(MAKECMDGOALS),release) diff --git a/boop/betty.cfg b/boop/betty.cfg index 4632c1e..b467c7c 100644 --- a/boop/betty.cfg +++ b/boop/betty.cfg @@ -20,24 +20,31 @@ if { [info exists CPUTAPID ] } { } #coonfigure reset options -jtag_nsrst_delay 50 -jtag_ntrst_delay 50 +adapter_nsrst_delay 1 +jtag_ntrst_delay 1 #use combined on interfaces or targets that can't set TRST/SRST separately -reset_config trst_and_srst srst_pulls_trst trst_push_pull srst_push_pull +reset_config srst_only srst_pulls_trst trst_push_pull srst_push_pull -jtag_khz 1000 +adapter_khz 1000 #jtag scan chain jtag newtap $_CHIPNAME cpu -irlen 4 -ircapture 0x1 -irmask 0xf -expected-id $_CPUTAPID set _TARGETNAME $_CHIPNAME.cpu -target create $_TARGETNAME arm7tdmi -endian $_ENDIAN -chain-position $_TARGETNAME -variant arm7tdmi +target create $_TARGETNAME arm7tdmi -endian $_ENDIAN -chain-position $_TARGETNAME # Event handlers -$_TARGETNAME configure -event reset-start {jtag_khz 1000} +$_TARGETNAME configure -event reset-start {adapter_khz 1000} $_TARGETNAME configure -event reset-init {betty_init} +$_TARGETNAME configure -event gdb-attach { + halt + } + $_TARGETNAME configure -event gdb-attach { + reset init + } + arm7_9 dcc_downloads enable $_TARGETNAME configure -work-area-phys 0x40000000 -work-area-size 0x10000 -work-area-backup 0 @@ -45,7 +52,7 @@ $_TARGETNAME configure -work-area-phys 0x40000000 -work-area-size 0x10000 -work- #flash bank [ ] set _FLASHNAME $_CHIPNAME.flash flash bank $_FLASHNAME cfi 0x80000000 0x00100000 2 2 $_TARGETNAME -flash bank $_FLASHNAME cfi 0x82000000 0x00100000 2 2 $_TARGETNAME +#flash bank $_FLASHNAME cfi 0x82000000 0x00100000 2 2 $_TARGETNAME arm7_9 fast_memory_access enable @@ -60,7 +67,7 @@ proc betty_init { } { # Activate PLL settings mww 0xe01fc08c 0xaa mww 0xe01fc08c 0x55 - sleep 100 + #sleep 100 # Memory Bank Configuration # BCFG0: 16bit, rble, 2wst - 30 mhz : Betty: FLASH 0 @ 0x80000000 @@ -69,7 +76,7 @@ proc betty_init { } { mww 0xffe00008 0x10000420 # BCFG1: 8 bit, 3 sram wst, rble, 5 wst 3 idcy : Betty: LCD @ 0x81000000 - #mww 0xffe00004 0x00000400 + mww 0xffe00004 0x00000400 # GPIO Pin COnfiguration for Flash access # PINSEL0: @@ -88,14 +95,19 @@ proc betty_init { } { mww 0xe0028008 0x002018D0 # disable watchdog - #mww 0xfffffd44 0x00008000 + mww 0xfffffd44 0x00008000 # enable user reset - #mww 0xfffffd08 0xa5000001 + mww 0xfffffd08 0xa5000001 + } proc flash_boop {IMAGE} { reset init + + flash erase_sector 0 0 0 + flash erase_check 0 flash erase_sector 0 0 last + flash erase_check 0 flash write_bank 0 $IMAGE 0 reset run } diff --git a/boop/betty.gdbinit b/boop/betty.gdbinit new file mode 100644 index 0000000..606ca2c --- /dev/null +++ b/boop/betty.gdbinit @@ -0,0 +1,47 @@ +monitor reset 100 +monitor halt +monitor endian little + +# BCFG0: 16bit, rble, 6wst - 60 mhz : Betty: FLASH 0 @ 0x80000000 +monitor memU32 0xFFE00000 = 0x100004A0 + +#BCFG2: 16bit, rble, 6wst - 60 mhz : Betty: FLASH 1 @ 0x82000000 +monitor memU32 0xFFE00008 = 0x100004A0 + +#PINSEL0 +monitor memU32 0xE002C000 = 0x00008005 + +#PINSEL1 +monitor memU32 0xE002C004 = 0x00000000 + +#PINSEL2 +monitor memU32 0xE002C014 = 0x0de049d4 + +#IO2SET +monitor memU32 0xE0028024 = 0x1FC0000 + +#IO2DIR +monitor memU32 0xe0028028 = 0x1FC0000 + +#IO0DIR +monitor memU32 0xE0028008 = 0x002018D0 + +#PLLCON: Enable PLL, connect PLL +monitor memU32 0xe01fc080 = 0xe01fc000 + +# VBPDIV: +monitor memU32 0xe01fc100 = 0x00000000 + +#PLLCFG: +monitor memU32 0xe01fc084 = 0x00000045 + +#Activate PLL settings +monitor memU32 0xe01fc08c = 0xaa +monitor memU32 0xe01fc08c = 0x55 + + +# Enable Flash Breakpoints and Download +monitor WorkRAM = 0x40000000 - 0x2000FBFF +monitor flash CFI = 0x80000000 - 0x800FFFFF +monitor flash breakpoints = 1 +monitor flash download = 1 \ No newline at end of file diff --git a/boop/boop_rom.bin b/boop/boop_rom.bin index e8c33d8..2778e79 100644 Binary files a/boop/boop_rom.bin and b/boop/boop_rom.bin differ diff --git a/boop/cc1100/rf.c b/boop/cc1100/rf.c index 00ea4a1..62ce2e2 100644 --- a/boop/cc1100/rf.c +++ b/boop/cc1100/rf.c @@ -413,7 +413,7 @@ void startRFIRQ(void) { VICIntEnable = INT_EINT0; } -inline void stopRFIRQ(void) { +void stopRFIRQ(void) { VICIntEnClr = INT_EINT0; }