Skip to content

Instantly share code, notes, and snippets.

@DatanoiseTV
Created November 5, 2014 23:31
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save DatanoiseTV/04c5a6e12f82c483c290 to your computer and use it in GitHub Desktop.
Save DatanoiseTV/04c5a6e12f82c483c290 to your computer and use it in GitHub Desktop.
K20-Config.cfg
if { [info exists CHIPNAME] } {
set _CHIPNAME $CHIPNAME
} else {
set _CHIPNAME k20
}
# Work-area is a space in RAM used for flash programming
if { [info exists WORKAREASIZE] } {
set _WORKAREASIZE $WORKAREASIZE
} else {
set _WORKAREASIZE 0x1000
}
if { [info exists CPUTAPID] } {
set _CPUTAPID $CPUTAPID
} else {
# this is the SW-DP tap id not the jtag tap id
set _CPUTAPID 0x2ba01477
}
if { [info exists TRANSPORT] } {
set _TRANSPORT $TRANSPORT
} else {
set _TRANSPORT hla_swd
}
if { [info exists ENDIAN] } {
set _ENDIAN $ENDIAN
} else {
set _ENDIAN little
}
#
# possibles value are hla_swd or hla_jtag
#
transport select $_TRANSPORT
hla newtap $_CHIPNAME cpu -expected-id $_CPUTAPID
set _TARGETNAME $_CHIPNAME.cpu
target create $_TARGETNAME hla_target -chain-position $_CHIPNAME.cpu
$_TARGETNAME configure -work-area-phys 0x20000000 -work-area-size $_WORKAREASIZE -work-area-backup 0
# Flash Settings
flash bank $_CHIPNAME.pflash kinetis 0x00000000 0x40000 0 4 $_TARGETNAME
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment