at91sam3XXX.cfg 1.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990
  1. # SPDX-License-Identifier: GPL-2.0-or-later
  2. # script for ATMEL sam3, a Cortex-M3 chip
  3. #
  4. # at91sam3u4e
  5. # at91sam3u2e
  6. # at91sam3u1e
  7. # at91sam3u4c
  8. # at91sam3u2c
  9. # at91sam3u1c
  10. #
  11. # at91sam3s4c
  12. # at91sam3s4b
  13. # at91sam3s4a
  14. # at91sam3s2c
  15. # at91sam3s2b
  16. # at91sam3s2a
  17. # at91sam3s1c
  18. # at91sam3s1b
  19. # at91sam3s1a
  20. #
  21. # at91sam3A4C
  22. # at91sam3A8C
  23. # at91sam3X4C
  24. # at91sam3X4E
  25. # at91sam3X8C
  26. # at91sam3X8E
  27. # at91sam3X8H
  28. source [find target/swj-dp.tcl]
  29. if { [info exists CHIPNAME] } {
  30. set _CHIPNAME $CHIPNAME
  31. } else {
  32. set _CHIPNAME sam3
  33. }
  34. if { [info exists ENDIAN] } {
  35. set _ENDIAN $ENDIAN
  36. } else {
  37. set _ENDIAN little
  38. }
  39. # Work-area is a space in RAM used for flash programming
  40. # By default use 64kB
  41. if { [info exists WORKAREASIZE] } {
  42. set _WORKAREASIZE $WORKAREASIZE
  43. } else {
  44. set _WORKAREASIZE 0x4000
  45. }
  46. #jtag scan chain
  47. if { [info exists CPUTAPID] } {
  48. set _CPUTAPID $CPUTAPID
  49. } else {
  50. set _CPUTAPID 0x4ba00477
  51. }
  52. swj_newdap $_CHIPNAME cpu -irlen 4 -ircapture 0x1 -irmask 0xf -expected-id $_CPUTAPID
  53. dap create $_CHIPNAME.dap -chain-position $_CHIPNAME.cpu
  54. set _TARGETNAME $_CHIPNAME.cpu
  55. target create $_TARGETNAME cortex_m -endian $_ENDIAN -dap $_CHIPNAME.dap
  56. # 16K is plenty, the smallest chip has this much
  57. $_TARGETNAME configure -work-area-phys 0x20000000 -work-area-size $_WORKAREASIZE -work-area-backup 0
  58. $_TARGETNAME configure -event gdb-flash-erase-start {
  59. halt
  60. }
  61. # JTAG speed should be <= F_CPU/6. F_CPU after reset is 4 MHz, so use F_JTAG = 0.5MHz
  62. #
  63. # Since we may be running of an RC oscilator, we crank down the speed a
  64. # bit more to be on the safe side. Perhaps superstition, but if are
  65. # running off a crystal, we can run closer to the limit. Note
  66. # that there can be a pretty wide band where things are more or less stable.
  67. adapter speed 500
  68. adapter srst delay 100
  69. if {[using_jtag]} {
  70. jtag_ntrst_delay 100
  71. }
  72. if {![using_hla]} {
  73. # if srst is not fitted use SYSRESETREQ to
  74. # perform a soft reset
  75. cortex_m reset_config sysresetreq
  76. }