Makeburn.arm-oocd 5.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209
  1. ## Upload Configuration for OpenOCD
  2. ## ================================
  3. ## When properly configured, you can conveniently use
  4. ## make clean all burn
  5. ## to build, upload and run the binary.
  6. ##
  7. ## If your target hardware is supported, you only need
  8. ## to specify the programming adapter. Everything else
  9. ## will be automatically set near the end of this file.
  10. ## Choose the programming adapter
  11. ## ------------------------------
  12. ## A file with this name and extension .cfg must exist in
  13. ## the OpenOCD interface directory.
  14. ## Use this with Turtelizer 2
  15. # BURNDONGLE = turtelizer2
  16. ## Hubert Hoegl's original USB to JTAG
  17. # BURNDONGLE = openocd-usb
  18. ## Choose the executable
  19. ## ---------------------
  20. ## Your OpenOCD executable may have a different name.
  21. BURN=openocd
  22. ## Directory containing OpenOCD configuration files.
  23. BURNCONFDIR=$(top_srcdir)/tools/turtelizer2
  24. ## Choose the target board
  25. ## -----------------------
  26. ## A file with this name and extension .cfg must exist in
  27. ## the OpenOCD board directory.
  28. # BURNBOARD = myboard
  29. ## Choose the target CPU
  30. ## ---------------------
  31. ## Typically this is specified in the board configuration.
  32. # BURNTARGET = sam7x256
  33. ## Choose the command sequence
  34. ## ---------------------------
  35. ##
  36. ## Terminates configuration stage. Use with all targets.
  37. BURNCMDS = -c init
  38. ## Example for an explicit command sequence.
  39. # BURNCMDS=-c init -c "reset init" -c "load_image $IMGFILE 0" -c "verify_image $IMGFILE 0" -c "resume 0" -c shutdown
  40. ## Example for command line chaining.
  41. # BURNCMDS += -f $(top_srcdir)/tools/flash/flash.script
  42. # BURNCMDS += -c "reset init"
  43. # BURNCMDS += -c "halt"
  44. # BURNCMDS += -c "arm7_9 dcc_downloads enable"
  45. # BURNCMDS += -c "flash write_image erase $(ITARG) 0x00100000 bin"
  46. # BURNCMDS += -c "reset run"
  47. # BURNCMDS += -f $(top_srcdir)/tools/flash/flash-exit.script
  48. ## Try to determine everything automatically
  49. ## -----------------------------------------
  50. ##
  51. ifeq ($(PLATFORM), AT91SAM7X_EK)
  52. BURNBOARD = at91sam7x-ek
  53. BURNCMDS += -c "reset halt"
  54. BURNCMDS += -c "flash write_image erase $(ITARG) 0x100000 bin"
  55. # BURNCMDS += -c "verify_image $(ITARG) 0x100000 bin"
  56. BURNCMDS += -c "at91sam7 gpnvm 2 set"
  57. BURNCMDS += -c "reset"
  58. endif
  59. ifeq ($(PLATFORM), AT91SAM9260_EK)
  60. BURNBOARD = atmel_at91sam9260-ek
  61. BURNCMDS += -c "reset init"
  62. BURNCMDS += -c "load_image $(ITARG) 0x20000000"
  63. BURNCMDS += -c "verify_image $(ITARG) 0x20000000"
  64. BURNCMDS += -c "resume 0x20000000"
  65. endif
  66. ifeq ($(PLATFORM), ELEKTOR_IR1)
  67. BURNBOARD = eir
  68. # Initialize clocks and SDRAM.
  69. BURNCMDS += -c "reset init"
  70. ifeq ($(LDNAME), at91sam7se512_xram)
  71. # Load image into external SDRAM.
  72. BURNCMDS += -c "load_image $(ITARG) 0x20000000"
  73. # Verify image in external SDRAM.
  74. BURNCMDS += -c "verify_image $(ITARG) 0x20000000"
  75. # Start image in external SDRAM.
  76. BURNCMDS += -c "resume 0x20000000"
  77. endif
  78. ifeq ($(LDNAME), at91sam7se512_rom)
  79. BURNCMDS += -c "flash write_image erase $(ITARG) 0x100000 bin"
  80. BURNCMDS += -c "verify_image $(ITARG) 0x100000 bin"
  81. BURNCMDS += -c "at91sam7 gpnvm 2 set"
  82. BURNCMDS += -c "reset run"
  83. endif
  84. endif
  85. ifeq ($(PLATFORM), ETHERNUT3)
  86. BURNBOARD = ethernut3
  87. # Enable chip selects and remap memory.
  88. BURNCMDS += -c "reset init"
  89. ifeq ($(LDNAME), at91x40_rom)
  90. # Write to external NOR flash.
  91. BURNCMDS += -c "flash write_image erase $(ITARG) 0x10000000 bin"
  92. BURNCMDS += -c "verify_image $(ITARG) 0x10000000 bin"
  93. BURNCMDS += -c "reset run"
  94. else
  95. # Write to internal SRAM.
  96. BURNCMDS += -c "arm core_state arm"
  97. BURNCMDS += -c "load_image $(ITARG) 0"
  98. BURNCMDS += -c "verify_image $(ITARG) 0"
  99. BURNCMDS += -c "resume 0"
  100. endif
  101. endif
  102. ifeq ($(PLATFORM), ETHERNUT5)
  103. BURNBOARD = ethernut5
  104. # Initialize clocks and SDRAM.
  105. BURNCMDS += -c "reset init"
  106. ifeq ($(LDNAME), at91sam9xe512_ram)
  107. # Load image into external SDRAM.
  108. BURNCMDS += -c "load_image $(ITARG) 0x20000000"
  109. BURNCMDS += -c "verify_image $(ITARG) 0x20000000"
  110. BURNCMDS += -c "resume 0x20000000"
  111. endif
  112. # Programming AT91SAM9XE internal flash is not supported by OpenOCD.
  113. ifeq ($(LDNAME), at91sam9xe512_iram)
  114. # Load image into internal SRAM.
  115. BURNCMDS += -c "mww 0xFFFFEF00 0x00000003"
  116. BURNCMDS += -c "load_image $(ITARG) 0x00000000"
  117. BURNCMDS += -c "verify_image $(ITARG) 0x00000000"
  118. BURNCMDS += -c "resume 0x00000000"
  119. endif
  120. endif
  121. ifeq ($(PLATFORM), AT91SAM9G45_EK)
  122. BURNBOARD = at91sam9g45-ek
  123. BURNCMDS += -c "reset init"
  124. # Load image into external SDRAM.
  125. BURNCMDS += -c "load_image $(ITARG) 0x00300000"
  126. BURNCMDS += -c "verify_image $(ITARG) 0x00300000"
  127. BURNCMDS += -c "resume 0x00300000"
  128. endif
  129. ifeq ($(PLATFORM), AT91SAM9M10_EK)
  130. BURNBOARD = at91sam9m10-ek
  131. BURNCMDS += -c "reset init"
  132. # Load image into external SDRAM.
  133. BURNCMDS += -c "load_image $(ITARG) 0x20000000"
  134. BURNCMDS += -c "verify_image $(ITARG) 0x20000000"
  135. BURNCMDS += -c "resume 0x20000000"
  136. endif
  137. ifeq ($(PLATFORM), FLECX1)
  138. BURNBOARD = flecx
  139. # It is not fully clear how to program the LPC1768 flash.
  140. # The following sequence was found by trial and error.
  141. BURNCMDS += -c "reset init"
  142. BURNCMDS += -c halt
  143. BURNCMDS += -c wait_halt
  144. BURNCMDS += -c "flash write_image erase $(ITARG) 0 bin"
  145. # BURNCMDS += -c "verify_image $(ITARG) 0 bin"
  146. BURNCMDS += -c halt
  147. BURNCMDS += -c wait_halt
  148. BURNCMDS += -c "reset run"
  149. endif
  150. ifeq ($(PLATFORM), SAM7ETH)
  151. BURNBOARD = sam7eth
  152. BURNCMDS += -c "reset halt"
  153. BURNCMDS += -c "flash write_image erase $(ITARG) 0x100000 bin"
  154. BURNCMDS += -c reset
  155. endif
  156. ## Terminate OpenOCD. Use with all targets.
  157. BURNCMDS += -c shutdown
  158. # No change required
  159. # ------------------
  160. # Anything below this line will typically work out of the box.
  161. #
  162. ifndef BURNDONGLE
  163. # Force the user to specify a valid dongle.
  164. BURN =
  165. BURNFLAGS = @echo Cannot burn, please edit nut/app/Makeburn.arm-ocd
  166. else
  167. BURNCONFIG += -c "source [find interface/$(BURNDONGLE).cfg]"
  168. endif
  169. ifneq ($(BURNBOARD),)
  170. BURNCONFIG += -c "source [find board/$(BURNBOARD).cfg]"
  171. endif
  172. ifneq ($(BURNTARGET),)
  173. BURNCONFIG += -c "source [find target/$(BURNTARGET).cfg]"
  174. endif
  175. ifndef BURNFLAGS
  176. BURNFLAGS = -s $(BURNCONFDIR) $(BURNCONFIG) $(BURNCMDS)
  177. endif