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.
 
 
 
 
 
 

71 lines
1.8 KiB

  1. # script for str9
  2. if { [info exists CHIPNAME] } {
  3. set _CHIPNAME $CHIPNAME
  4. } else {
  5. set _CHIPNAME str912
  6. }
  7. if { [info exists ENDIAN] } {
  8. set _ENDIAN $ENDIAN
  9. } else {
  10. set _ENDIAN little
  11. }
  12. # jtag speed. We need to stick to 16kHz until we've finished reset.
  13. jtag_rclk 16
  14. jtag_nsrst_delay 100
  15. jtag_ntrst_delay 100
  16. #use combined on interfaces or targets that can't set TRST/SRST separately
  17. reset_config trst_and_srst
  18. if { [info exists FLASHTAPID ] } {
  19. set _FLASHTAPID $FLASHTAPID
  20. } else {
  21. set _FLASHTAPID 0x04570041
  22. }
  23. jtag newtap $_CHIPNAME flash -irlen 8 -ircapture 0x1 -irmask 0x1 -expected-id $_FLASHTAPID
  24. if { [info exists CPUTAPID ] } {
  25. set _CPUTAPID $CPUTAPID
  26. } else {
  27. set _CPUTAPID 0x25966041
  28. }
  29. jtag newtap $_CHIPNAME cpu -irlen 4 -ircapture 0x1 -irmask 0xf -expected-id $_CPUTAPID
  30. if { [info exists BSTAPID ] } {
  31. set _BSTAPID $BSTAPID
  32. } else {
  33. set _BSTAPID 0x1457f041
  34. }
  35. jtag newtap $_CHIPNAME bs -irlen 5 -ircapture 0x1 -irmask 0x1 -expected-id $_BSTAPID
  36. set _TARGETNAME $_CHIPNAME.cpu
  37. target create $_TARGETNAME arm966e -endian $_ENDIAN -chain-position $_TARGETNAME -variant arm966e
  38. $_TARGETNAME configure -event reset-start { jtag_rclk 16 }
  39. $_TARGETNAME configure -event reset-init {
  40. # We can increase speed now that we know the target is halted.
  41. #jtag_rclk 3000
  42. # -- Enable 96K RAM
  43. # PFQBC enabled / DTCM & AHB wait-states disabled
  44. mww 0x5C002034 0x0191
  45. str9x flash_config 0 4 2 0 0x80000
  46. flash protect 0 0 7 off
  47. }
  48. $_TARGETNAME configure -work-area-virt 0 -work-area-phys 0x50000000 -work-area-size 16384 -work-area-backup 0
  49. #flash bank str9x <base> <size> 0 0 <target#> <variant>
  50. flash bank str9x 0x00000000 0x00080000 0 0 0
  51. flash bank str9x 0x00080000 0x00008000 0 0 0
  52. # For more information about the configuration files, take a look at:
  53. # openocd.texi