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.
 
 
 
 
 
 

49 lines
1.1 KiB

  1. #
  2. # stm32 stlink pseudo target
  3. #
  4. if { [info exists CHIPNAME] } {
  5. set _CHIPNAME $CHIPNAME
  6. } else {
  7. set _CHIPNAME stm32f1x
  8. }
  9. # Work-area is a space in RAM used for flash programming
  10. # By default use 16kB
  11. if { [info exists WORKAREASIZE] } {
  12. set _WORKAREASIZE $WORKAREASIZE
  13. } else {
  14. set _WORKAREASIZE 0x4000
  15. }
  16. if { [info exists CPUTAPID] } {
  17. set _CPUTAPID $CPUTAPID
  18. } else {
  19. # this is the SW-DP tap id not the jtag tap id
  20. set _CPUTAPID 0x1ba01477
  21. }
  22. if { [info exists TRANSPORT] } {
  23. set _TRANSPORT $TRANSPORT
  24. if { $TRANSPORT == "stlink_jtag" } {
  25. if { [info exists CPUTAPID] == 0 } {
  26. # jtag requires us to use the jtag tap id
  27. set _CPUTAPID 0x3ba00477
  28. }
  29. }
  30. } else {
  31. set _TRANSPORT stlink_swd
  32. }
  33. #
  34. # possibles value are stlink_swd or stlink_jtag
  35. #
  36. transport select $_TRANSPORT
  37. stlink newtap $_CHIPNAME cpu -expected-id $_CPUTAPID
  38. set _TARGETNAME $_CHIPNAME.cpu
  39. target create $_TARGETNAME stm32_stlink -chain-position $_TARGETNAME
  40. $_TARGETNAME configure -work-area-phys 0x20000000 -work-area-size $_WORKAREASIZE -work-area-backup 0