X-Git-Url: https://review.openocd.org/gitweb?p=openocd.git;a=blobdiff_plain;f=tcl%2Ftarget%2Flpc2294.cfg;h=83d595deb57f8bb87e85a681e86781720a47740a;hp=6f3417171f77abe354fddabfa45be8b88bc7f884;hb=2231da8ec4e7d7ae9b652f3dd1a7104f5a110f3f;hpb=ba951aede3aa98591087428955dad51279e6a5ea diff --git a/tcl/target/lpc2294.cfg b/tcl/target/lpc2294.cfg index 6f3417171f..83d595deb5 100644 --- a/tcl/target/lpc2294.cfg +++ b/tcl/target/lpc2294.cfg @@ -1,30 +1,23 @@ -if { [info exists CHIPNAME] } { - set _CHIPNAME $CHIPNAME -} else { - set _CHIPNAME lpc2294 -} - -if { [info exists CPUTAPID ] } { - set _CPUTAPID $CPUTAPID -} else { - # force an error till we get a good number - set _CPUTAPID 0xffffffff -} +# NXP LPC2294 ARM7TDMI-S with 256kB flash and 16kB SRAM, clocked with 12MHz crystal -adapter_nsrst_delay 200 -jtag_ntrst_delay 200 +source [find target/lpc2xxx.cfg] -#use combined on interfaces or targets that can't set TRST/SRST separately -reset_config trst_and_srst srst_pulls_trst +# parameters: +# - core_freq_khz - frequency of core in kHz during flashing, usually equal to connected crystal or internal oscillator, e.g. 12000 +# - adapter_freq_khz - frequency of debug adapter in kHz, should be 8x slower than core_freq_khz, e.g. 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 -chain-position $_TARGETNAME -$_TARGETNAME configure -work-area-phys 0x40000000 -work-area-size 0x4000 -work-area-backup 0 +proc setup_lpc2294 {core_freq_khz adapter_freq_khz} { + # 256kB flash and 16kB SRAM + # setup_lpc2xxx + + # !! TAPID unknown !! + setup_lpc2xxx lpc2294 0xffffffff 0x40000 lpc2000_v1 0x4000 $core_freq_khz $adapter_freq_khz +} -#flash configuration -# flash bank lpc2000 0 0 [calc checksum] -set _FLASHNAME $_CHIPNAME.flash -flash bank $_FLASHNAME lpc2000 0x0 0x40000 0 0 $_TARGETNAME lpc2000_v1 14765 calc_checksum +proc init_targets {} { + # default to core clocked with 12MHz crystal + echo "Warning - assuming default core clock 12MHz! Flashing may fail if actual core clock is different." + + # setup_lpc2294 + setup_lpc2294 12000 1500 +}