ke0x.cfg 1.5 KB

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