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.
 
 
 
 
 
 

90 lines
1.8 KiB

  1. # script for stm8l family
  2. #
  3. # stm8 devices support SWIM transports only.
  4. #
  5. transport select swim
  6. if { [info exists CHIPNAME] } {
  7. set _CHIPNAME $CHIPNAME
  8. } else {
  9. set _CHIPNAME stm8l
  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 FLASHSTART] } {
  19. set _FLASHSTART $FLASHSTART
  20. } else {
  21. set _FLASHSTART 0x8000
  22. }
  23. if { [info exists FLASHEND] } {
  24. set _FLASHEND $FLASHEND
  25. } else {
  26. set _FLASHEND 0xffff
  27. }
  28. if { [info exists EEPROMSTART] } {
  29. set _EEPROMSTART $EEPROMSTART
  30. } else {
  31. set _EEPROMSTART 0x4000
  32. }
  33. if { [info exists EEPROMEND] } {
  34. set _EEPROMEND $EEPROMEND
  35. } else {
  36. set _EEPROMEND 0x43ff
  37. }
  38. if { [info exists OPTIONSTART] } {
  39. set _OPTIONSTART $OPTIONSTART
  40. } else {
  41. set _OPTIONSTART 0x4800
  42. }
  43. if { [info exists OPTIONEND] } {
  44. set _OPTIONEND $OPTIONEND
  45. } else {
  46. set _OPTIONEND 0x487f
  47. }
  48. if { [info exists BLOCKSIZE] } {
  49. set _BLOCKSIZE $BLOCKSIZE
  50. } else {
  51. set _BLOCKSIZE 0x80
  52. }
  53. swim newtap $_CHIPNAME cpu
  54. set _TARGETNAME $_CHIPNAME.cpu
  55. target create $_TARGETNAME stm8 -chain-position $_CHIPNAME.cpu
  56. $_TARGETNAME configure -work-area-phys 0x0 -work-area-size $_WORKAREASIZE -work-area-backup 1
  57. $_TARGETNAME configure -flashstart $_FLASHSTART -flashend $_FLASHEND -eepromstart $_EEPROMSTART -eepromend $_EEPROMEND
  58. $_TARGETNAME configure -optionstart $_OPTIONSTART -optionend $_OPTIONEND -blocksize $_BLOCKSIZE
  59. # Uncomment this line to enable interrupts while instruction step
  60. #$_TARGETNAME configure -enable_step_irq
  61. # Set stm8l type
  62. $_TARGETNAME configure -enable_stm8l
  63. # Set high speed
  64. adapter speed 800
  65. # Set low speed
  66. #adapter speed 363
  67. reset_config srst_only
  68. #uncomment this line to connect under reset
  69. #reset_config srst_nogate connect_assert_srst