You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

59 lines
1.4 KiB

  1. #
  2. # Freescale Kinetis KE series devices
  3. #
  4. source [find target/swj-dp.tcl]
  5. if { [info exists CHIPNAME] } {
  6. set _CHIPNAME $CHIPNAME
  7. } else {
  8. set _CHIPNAME ke
  9. }
  10. # Work-area is a space in RAM used for flash programming
  11. # By default use 1kB
  12. if { [info exists WORKAREASIZE] } {
  13. set _WORKAREASIZE $WORKAREASIZE
  14. } else {
  15. set _WORKAREASIZE 0x400
  16. }
  17. if { [info exists CPUTAPID] } {
  18. set _CPUTAPID $CPUTAPID
  19. } else {
  20. if { [using_jtag] } {
  21. set _CPUTAPID 0x4ba00477
  22. } {
  23. set _CPUTAPID 0x2ba01477
  24. }
  25. }
  26. swj_newdap $_CHIPNAME cpu -irlen 4 -ircapture 0x1 -irmask 0xf -expected-id $_CPUTAPID
  27. set _TARGETNAME $_CHIPNAME.cpu
  28. target create $_TARGETNAME cortex_m -chain-position $_CHIPNAME.cpu
  29. $_TARGETNAME configure -work-area-phys 0x20000000 -work-area-size $_WORKAREASIZE -work-area-backup 0
  30. set _FLASHNAME $_CHIPNAME.flash
  31. flash bank $_FLASHNAME kinetis_ke 0 0 0 0 $_TARGETNAME
  32. adapter_khz 1000
  33. reset_config srst_nogate
  34. if {![using_hla]} {
  35. # It is important that "kinetis_ke mdm check_security" is called for
  36. # 'examine-end' event and not 'eximine-start'. Calling it in 'examine-start'
  37. # causes "kinetis_ke mdm check_security" to fail the first time openocd
  38. # calls it when it tries to connect after the CPU has been power-cycled.
  39. $_CHIPNAME.cpu configure -event examine-end {
  40. kinetis_ke mdm check_security
  41. }
  42. # if srst is not fitted use SYSRESETREQ to
  43. # perform a soft reset
  44. cortex_m reset_config sysresetreq
  45. }