stm8l.cfg 1.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091
  1. # SPDX-License-Identifier: GPL-2.0-or-later
  2. # script for stm8l family
  3. #
  4. # stm8 devices support SWIM transports only.
  5. #
  6. transport select swim
  7. if { [info exists CHIPNAME] } {
  8. set _CHIPNAME $CHIPNAME
  9. } else {
  10. set _CHIPNAME stm8l
  11. }
  12. # Work-area is a space in RAM used for flash programming
  13. # By default use 1kB
  14. if { [info exists WORKAREASIZE] } {
  15. set _WORKAREASIZE $WORKAREASIZE
  16. } else {
  17. set _WORKAREASIZE 0x400
  18. }
  19. if { [info exists FLASHSTART] } {
  20. set _FLASHSTART $FLASHSTART
  21. } else {
  22. set _FLASHSTART 0x8000
  23. }
  24. if { [info exists FLASHEND] } {
  25. set _FLASHEND $FLASHEND
  26. } else {
  27. set _FLASHEND 0xffff
  28. }
  29. if { [info exists EEPROMSTART] } {
  30. set _EEPROMSTART $EEPROMSTART
  31. } else {
  32. set _EEPROMSTART 0x4000
  33. }
  34. if { [info exists EEPROMEND] } {
  35. set _EEPROMEND $EEPROMEND
  36. } else {
  37. set _EEPROMEND 0x43ff
  38. }
  39. if { [info exists OPTIONSTART] } {
  40. set _OPTIONSTART $OPTIONSTART
  41. } else {
  42. set _OPTIONSTART 0x4800
  43. }
  44. if { [info exists OPTIONEND] } {
  45. set _OPTIONEND $OPTIONEND
  46. } else {
  47. set _OPTIONEND 0x487f
  48. }
  49. if { [info exists BLOCKSIZE] } {
  50. set _BLOCKSIZE $BLOCKSIZE
  51. } else {
  52. set _BLOCKSIZE 0x80
  53. }
  54. swim newtap $_CHIPNAME cpu
  55. set _TARGETNAME $_CHIPNAME.cpu
  56. target create $_TARGETNAME stm8 -chain-position $_CHIPNAME.cpu
  57. $_TARGETNAME configure -work-area-phys 0x0 -work-area-size $_WORKAREASIZE -work-area-backup 1
  58. $_TARGETNAME configure -flashstart $_FLASHSTART -flashend $_FLASHEND -eepromstart $_EEPROMSTART -eepromend $_EEPROMEND
  59. $_TARGETNAME configure -optionstart $_OPTIONSTART -optionend $_OPTIONEND -blocksize $_BLOCKSIZE
  60. # Uncomment this line to enable interrupts while instruction step
  61. #$_TARGETNAME configure -enable_step_irq
  62. # Set stm8l type
  63. $_TARGETNAME configure -enable_stm8l
  64. # Set high speed
  65. adapter speed 800
  66. # Set low speed
  67. #adapter speed 363
  68. reset_config srst_only
  69. #uncomment this line to connect under reset
  70. #reset_config srst_nogate connect_assert_srst