Merge branch 'JTAG' into IR_HW_PWM
Conflicts: boop/betty.cfg boop/boop_rom.bin
This commit is contained in:
commit
4af6656ba7
5 changed files with 78 additions and 18 deletions
|
@ -25,8 +25,9 @@
|
||||||
#ARMPATH = $(ARMBASE)/bin/
|
#ARMPATH = $(ARMBASE)/bin/
|
||||||
TOOLPREFIX = arm-none-eabi-
|
TOOLPREFIX = arm-none-eabi-
|
||||||
LPCTOOL = lpctool
|
LPCTOOL = lpctool
|
||||||
OPENOCDPATH = F:\Tools\OpenOCD
|
OPENOCDPATH = F:\Tools\OpenOCD_0_10
|
||||||
OPENOCD = $(OPENOCDPATH)\openocd.exe -f betty.cfg -f $(OPENOCDPATH)\interface\uniprog.cfg
|
#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
|
SIZE = $(ARMPATH)$(TOOLPREFIX)size
|
||||||
|
|
||||||
CPUFLAGS = -mcpu=arm7tdmi-s
|
CPUFLAGS = -mcpu=arm7tdmi-s
|
||||||
OPTFLAGS = -Os
|
CFLAGS = -Wall -mthumb-interwork -g3 -c
|
||||||
CFLAGS = -Wall -mthumb-interwork
|
|
||||||
INC = -I. -Iinterrupt -Idisplay -Ikeyboard -Iaudio -Iinfrared -Iserial -Iflash -Icc1100 -Igui -Itimer -Igames -Iadc -Irtc -Itools
|
INC = -I. -Iinterrupt -Idisplay -Ikeyboard -Iaudio -Iinfrared -Iserial -Iflash -Icc1100 -Igui -Itimer -Igames -Iadc -Irtc -Itools
|
||||||
ASFLAGS = -g -I. -mthumb-interwork
|
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
|
LDFLAGS = -mthumb-interwork -nostartfiles -Xlinker -Map -Xlinker boop.map -Tlpc2220_rom.ld
|
||||||
THUMBFLAGS = -mthumb
|
THUMBFLAGS = -mthumb
|
||||||
|
|
||||||
|
@ -55,6 +53,9 @@ COMPILE = $(CC) $(CPUFLAGS) $(CFLAGS) $(INC)
|
||||||
|
|
||||||
ifeq ($(MAKECMDGOALS),debug)
|
ifeq ($(MAKECMDGOALS),debug)
|
||||||
COMPILE += -D DEBUGMODE
|
COMPILE += -D DEBUGMODE
|
||||||
|
OPTFLAGS = -O0
|
||||||
|
else
|
||||||
|
OPTFLAGS = -Os
|
||||||
endif
|
endif
|
||||||
|
|
||||||
ifeq ($(MAKECMDGOALS),release)
|
ifeq ($(MAKECMDGOALS),release)
|
||||||
|
|
|
@ -20,24 +20,31 @@ if { [info exists CPUTAPID ] } {
|
||||||
}
|
}
|
||||||
|
|
||||||
#coonfigure reset options
|
#coonfigure reset options
|
||||||
jtag_nsrst_delay 50
|
adapter_nsrst_delay 1
|
||||||
jtag_ntrst_delay 50
|
jtag_ntrst_delay 1
|
||||||
|
|
||||||
#use combined on interfaces or targets that can't set TRST/SRST separately
|
#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 scan chain
|
||||||
jtag newtap $_CHIPNAME cpu -irlen 4 -ircapture 0x1 -irmask 0xf -expected-id $_CPUTAPID
|
jtag newtap $_CHIPNAME cpu -irlen 4 -ircapture 0x1 -irmask 0xf -expected-id $_CPUTAPID
|
||||||
|
|
||||||
set _TARGETNAME $_CHIPNAME.cpu
|
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
|
# 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 reset-init {betty_init}
|
||||||
|
|
||||||
|
$_TARGETNAME configure -event gdb-attach {
|
||||||
|
halt
|
||||||
|
}
|
||||||
|
$_TARGETNAME configure -event gdb-attach {
|
||||||
|
reset init
|
||||||
|
}
|
||||||
|
|
||||||
arm7_9 dcc_downloads enable
|
arm7_9 dcc_downloads enable
|
||||||
|
|
||||||
$_TARGETNAME configure -work-area-phys 0x40000000 -work-area-size 0x10000 -work-area-backup 0
|
$_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 <name> <driver> <base_addr> <size> <chip_width> <bus_width> <target_number> [<target_name> <banks> <sectors_per_bank> <pages_per_sector> <page_size> <num_nvmbits> <ext_freq_khz>]
|
#flash bank <name> <driver> <base_addr> <size> <chip_width> <bus_width> <target_number> [<target_name> <banks> <sectors_per_bank> <pages_per_sector> <page_size> <num_nvmbits> <ext_freq_khz>]
|
||||||
set _FLASHNAME $_CHIPNAME.flash
|
set _FLASHNAME $_CHIPNAME.flash
|
||||||
flash bank $_FLASHNAME cfi 0x80000000 0x00100000 2 2 $_TARGETNAME
|
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
|
arm7_9 fast_memory_access enable
|
||||||
|
|
||||||
|
@ -60,7 +67,7 @@ proc betty_init { } {
|
||||||
# Activate PLL settings
|
# Activate PLL settings
|
||||||
mww 0xe01fc08c 0xaa
|
mww 0xe01fc08c 0xaa
|
||||||
mww 0xe01fc08c 0x55
|
mww 0xe01fc08c 0x55
|
||||||
sleep 100
|
#sleep 100
|
||||||
|
|
||||||
# Memory Bank Configuration
|
# Memory Bank Configuration
|
||||||
# BCFG0: 16bit, rble, 2wst - 30 mhz : Betty: FLASH 0 @ 0x80000000
|
# BCFG0: 16bit, rble, 2wst - 30 mhz : Betty: FLASH 0 @ 0x80000000
|
||||||
|
@ -69,7 +76,7 @@ proc betty_init { } {
|
||||||
mww 0xffe00008 0x10000420
|
mww 0xffe00008 0x10000420
|
||||||
|
|
||||||
# BCFG1: 8 bit, 3 sram wst, rble, 5 wst 3 idcy : Betty: LCD @ 0x81000000
|
# 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
|
# GPIO Pin COnfiguration for Flash access
|
||||||
# PINSEL0:
|
# PINSEL0:
|
||||||
|
@ -88,14 +95,19 @@ proc betty_init { } {
|
||||||
mww 0xe0028008 0x002018D0
|
mww 0xe0028008 0x002018D0
|
||||||
|
|
||||||
# disable watchdog
|
# disable watchdog
|
||||||
#mww 0xfffffd44 0x00008000
|
mww 0xfffffd44 0x00008000
|
||||||
# enable user reset
|
# enable user reset
|
||||||
#mww 0xfffffd08 0xa5000001
|
mww 0xfffffd08 0xa5000001
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
proc flash_boop {IMAGE} {
|
proc flash_boop {IMAGE} {
|
||||||
reset init
|
reset init
|
||||||
|
|
||||||
|
flash erase_sector 0 0 0
|
||||||
|
flash erase_check 0
|
||||||
flash erase_sector 0 0 last
|
flash erase_sector 0 0 last
|
||||||
|
flash erase_check 0
|
||||||
flash write_bank 0 $IMAGE 0
|
flash write_bank 0 $IMAGE 0
|
||||||
reset run
|
reset run
|
||||||
}
|
}
|
||||||
|
|
47
boop/betty.gdbinit
Normal file
47
boop/betty.gdbinit
Normal file
|
@ -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
|
Binary file not shown.
|
@ -413,7 +413,7 @@ void startRFIRQ(void) {
|
||||||
VICIntEnable = INT_EINT0;
|
VICIntEnable = INT_EINT0;
|
||||||
}
|
}
|
||||||
|
|
||||||
inline void stopRFIRQ(void) {
|
void stopRFIRQ(void) {
|
||||||
VICIntEnClr = INT_EINT0;
|
VICIntEnClr = INT_EINT0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue