Skip to content
Permalink
Browse files

Revise project structure

Makefile based build for FPGA configurations, firmware, SuperCIC,
release packaging. Probably needs more polishing.
  • Loading branch information...
mrehkopf committed May 19, 2019
1 parent 93d23cc commit a01fb3d6a1175b38fd077efcfac36d716d6807f0
Showing with 25,396 additions and 7,023 deletions.
  1. +52 −0 Makefile
  2. +15 −0 cic/supercic/Makefile
  3. +7 −4 snes/Makefile
  4. +26 −24 src/Makefile
  5. +0 −3,629 src/cfgware.h
  6. +3 −3 src/conf2h.awk
  7. +0 −3 src/config
  8. +190 −0 src/config-mk2
  9. +188 −0 src/config-mk3
  10. +12 −192 src/config.h
  11. +1 −8 src/flash.script
  12. +132 −0 src/lpc1756.ld
  13. +11 −7 src/{lpc1754.cfg → lpc175x.cfg}
  14. +0 −1 src/main.c
  15. +39 −0 utils/Makefile
  16. +31 −0 utils/bin2c.c
  17. +32 −0 utils/genbsxpage.c
  18. +130 −0 utils/genbsxpage.h
  19. +14 −0 utils/mem2lorom.c
  20. +121 −0 verilog/sd2snes_base/Makefile
  21. 0 verilog/{sd2snes → sd2snes_base}/address.v
  22. 0 verilog/{sd2snes → sd2snes_base}/bsx.v
  23. 0 verilog/{sd2snes → sd2snes_base}/cheat.v
  24. 0 verilog/{sd2snes → sd2snes_base}/clk_test.v
  25. 0 verilog/{sd2snes → sd2snes_base}/config.vh
  26. +12 −1 verilog/{sd2snes → sd2snes_base}/dac.v
  27. +6 −0 verilog/sd2snes_base/dac_buf.qip
  28. +213 −0 verilog/sd2snes_base/dac_buf.v
  29. 0 verilog/{sd2snes → sd2snes_base}/dcm.v
  30. 0 verilog/{sd2snes → sd2snes_base}/ipcore_dir/chipscope_icon.ucf
  31. 0 verilog/{sd2snes → sd2snes_base}/ipcore_dir/chipscope_icon.v
  32. 0 verilog/{sd2snes → sd2snes_base}/ipcore_dir/chipscope_icon.xco
  33. 0 verilog/{sd2snes → sd2snes_base}/ipcore_dir/chipscope_icon.xdc
  34. 0 verilog/{sd2snes → sd2snes_base}/ipcore_dir/chipscope_icon.xise
  35. 0 verilog/{sd2snes → sd2snes_base}/ipcore_dir/chipscope_ila.cdc
  36. 0 verilog/{sd2snes → sd2snes_base}/ipcore_dir/chipscope_ila.ucf
  37. 0 verilog/{sd2snes → sd2snes_base}/ipcore_dir/chipscope_ila.v
  38. 0 verilog/{sd2snes → sd2snes_base}/ipcore_dir/chipscope_ila.xco
  39. 0 verilog/{sd2snes → sd2snes_base}/ipcore_dir/chipscope_ila.xdc
  40. 0 verilog/{sd2snes → sd2snes_base}/ipcore_dir/chipscope_ila.xise
  41. +184 −184 verilog/{sd2snes → sd2snes_base}/ipcore_dir/dac_buf.v
  42. +108 −108 verilog/{sd2snes → sd2snes_base}/ipcore_dir/dac_buf.xco
  43. 0 verilog/{sd2snes → sd2snes_base}/ipcore_dir/dac_buf.xise
  44. +184 −184 verilog/{sd2snes → sd2snes_base}/ipcore_dir/msu_databuf.v
  45. +108 −108 verilog/{sd2snes → sd2snes_base}/ipcore_dir/msu_databuf.xco
  46. 0 verilog/{sd2snes → sd2snes_base}/ipcore_dir/msu_databuf.xise
  47. +190 −190 verilog/{sd2snes → sd2snes_base}/ipcore_dir/snescmd_buf.v
  48. +108 −108 verilog/{sd2snes → sd2snes_base}/ipcore_dir/snescmd_buf.xco
  49. 0 verilog/{sd2snes → sd2snes_base}/ipcore_dir/snescmd_buf.xise
  50. +190 −190 verilog/{sd2snes → sd2snes_base}/ipcore_dir/upd77c25_datram.v
  51. +108 −108 verilog/{sd2snes → sd2snes_base}/ipcore_dir/upd77c25_datram.xco
  52. 0 verilog/{sd2snes → sd2snes_base}/ipcore_dir/upd77c25_datram.xise
  53. +184 −184 verilog/{sd2snes → sd2snes_base}/ipcore_dir/upd77c25_datrom.v
  54. +108 −108 verilog/{sd2snes → sd2snes_base}/ipcore_dir/upd77c25_datrom.xco
  55. 0 verilog/{sd2snes → sd2snes_base}/ipcore_dir/upd77c25_datrom.xise
  56. +184 −184 verilog/{sd2snes → sd2snes_base}/ipcore_dir/upd77c25_pgmrom.v
  57. +108 −108 verilog/{sd2snes → sd2snes_base}/ipcore_dir/upd77c25_pgmrom.xco
  58. 0 verilog/{sd2snes → sd2snes_base}/ipcore_dir/upd77c25_pgmrom.xise
  59. +533 −0 verilog/sd2snes_base/main.qsf
  60. +145 −0 verilog/sd2snes_base/main.sdc
  61. 0 verilog/{sd2snes → sd2snes_base}/main.ucf
  62. +69 −5 verilog/{sd2snes → sd2snes_base}/main.v
  63. +807 −0 verilog/sd2snes_base/main_assignment_defaults.qdf
  64. 0 verilog/{sd2snes → sd2snes_base}/main_tf.v
  65. 0 verilog/{sd2snes → sd2snes_base}/mcu_cmd.v
  66. +12 −1 verilog/{sd2snes → sd2snes_base}/msu.v
  67. +6 −0 verilog/sd2snes_base/msu_databuf.qip
  68. +213 −0 verilog/sd2snes_base/msu_databuf.v
  69. +11 −0 verilog/sd2snes_base/pll.ppf
  70. +6 −0 verilog/sd2snes_base/pll.qip
  71. +320 −0 verilog/sd2snes_base/pll.v
  72. 0 verilog/{sd2snes → sd2snes_base}/rtc.v
  73. +30 −0 verilog/sd2snes_base/sd2snes_base.qpf
  74. +12 −12 verilog/{sd2snes/sd2snes.xise → sd2snes_base/sd2snes_base.xise}
  75. 0 verilog/{sd2snes → sd2snes_base}/sd_dma.v
  76. +6 −0 verilog/sd2snes_base/snescmd_buf.qip
  77. +242 −0 verilog/sd2snes_base/snescmd_buf.v
  78. 0 verilog/{sd2snes → sd2snes_base}/spi.v
  79. 0 verilog/{sd2snes → sd2snes_base}/srtc.v
  80. +39 −1 verilog/{sd2snes → sd2snes_base}/upd77c25.v
  81. +6 −0 verilog/sd2snes_base/upd77c25_datram.qip
  82. +242 −0 verilog/sd2snes_base/upd77c25_datram.v
  83. +6 −0 verilog/sd2snes_base/upd77c25_datrom.qip
  84. +213 −0 verilog/sd2snes_base/upd77c25_datrom.v
  85. +6 −0 verilog/sd2snes_base/upd77c25_pgmrom.qip
  86. +213 −0 verilog/sd2snes_base/upd77c25_pgmrom.v
  87. 0 verilog/{sd2snes → sd2snes_base}/updtest_tf.v
  88. +121 −0 verilog/sd2snes_cx4/Makefile
  89. +33 −0 verilog/sd2snes_cx4/config.vh
  90. +37 −0 verilog/sd2snes_cx4/cx4.v
  91. +6 −0 verilog/sd2snes_cx4/cx4_datram.qip
  92. +242 −0 verilog/sd2snes_cx4/cx4_datram.v
  93. +1,034 −0 verilog/sd2snes_cx4/cx4_datrom.mif
  94. +6 −0 verilog/sd2snes_cx4/cx4_datrom.qip
  95. +159 −0 verilog/sd2snes_cx4/cx4_datrom.v
  96. +6 −0 verilog/sd2snes_cx4/cx4_mul.qip
  97. +116 −0 verilog/sd2snes_cx4/cx4_mul.v
  98. +6 −0 verilog/sd2snes_cx4/cx4_pgmrom.qip
  99. +213 −0 verilog/sd2snes_cx4/cx4_pgmrom.v
  100. +12 −0 verilog/sd2snes_cx4/dac.v
  101. +6 −0 verilog/sd2snes_cx4/dac_buf.qip
  102. +213 −0 verilog/sd2snes_cx4/dac_buf.v
  103. +534 −0 verilog/sd2snes_cx4/main.qsf
  104. +126 −0 verilog/sd2snes_cx4/main.sdc
  105. +67 −5 verilog/sd2snes_cx4/main.v
  106. +807 −0 verilog/sd2snes_cx4/main_assignment_defaults.qdf
  107. +12 −1 verilog/sd2snes_cx4/msu.v
  108. +6 −0 verilog/sd2snes_cx4/msu_databuf.qip
  109. +213 −0 verilog/sd2snes_cx4/msu_databuf.v
  110. +11 −0 verilog/sd2snes_cx4/pll.ppf
  111. +6 −0 verilog/sd2snes_cx4/pll.qip
  112. +320 −0 verilog/sd2snes_cx4/pll.v
  113. +31 −0 verilog/sd2snes_cx4/sd2snes_cx4.qpf
  114. +3 −3 verilog/sd2snes_cx4/sd2snes_cx4.xise
  115. +6 −0 verilog/sd2snes_cx4/snescmd_buf.qip
  116. +242 −0 verilog/sd2snes_cx4/snescmd_buf.v
  117. +121 −0 verilog/sd2snes_gsu/Makefile
  118. +33 −0 verilog/sd2snes_gsu/config.vh
  119. +11 −2 verilog/sd2snes_gsu/dac.v
  120. +6 −0 verilog/sd2snes_gsu/dac_buf.qip
  121. +213 −0 verilog/sd2snes_gsu/dac_buf.v
  122. +266 −214 verilog/sd2snes_gsu/gsu.v
  123. +6 −0 verilog/sd2snes_gsu/gsu_cache.qip
  124. +172 −0 verilog/sd2snes_gsu/gsu_cache.v
  125. +6 −0 verilog/sd2snes_gsu/gsu_fmult.qip
  126. +116 −0 verilog/sd2snes_gsu/gsu_fmult.v
  127. +6 −0 verilog/sd2snes_gsu/gsu_mult.qip
  128. +110 −0 verilog/sd2snes_gsu/gsu_mult.v
  129. +6 −0 verilog/sd2snes_gsu/gsu_umult.qip
  130. +110 −0 verilog/sd2snes_gsu/gsu_umult.v
  131. +527 −0 verilog/sd2snes_gsu/main.qsf
  132. +146 −0 verilog/sd2snes_gsu/main.sdc
  133. +72 −6 verilog/sd2snes_gsu/main.v
  134. +807 −0 verilog/sd2snes_gsu/main_assignment_defaults.qdf
  135. +12 −1 verilog/sd2snes_gsu/msu.v
  136. +6 −0 verilog/sd2snes_gsu/msu_databuf.qip
  137. +213 −0 verilog/sd2snes_gsu/msu_databuf.v
  138. +7 −0 verilog/sd2snes_gsu/pll.qip
  139. +319 −0 verilog/sd2snes_gsu/pll.v
  140. +30 −0 verilog/sd2snes_gsu/sd2snes_gsu.qpf
  141. +4 −4 verilog/sd2snes_gsu/{sd2snes.xise → sd2snes_gsu.xise}
  142. +6 −0 verilog/sd2snes_gsu/snescmd_buf.qip
  143. +242 −0 verilog/sd2snes_gsu/snescmd_buf.v
  144. +121 −0 verilog/sd2snes_mini/Makefile
  145. 0 verilog/{sd2sneslite → sd2snes_mini}/address.v
  146. 0 verilog/{sd2sneslite → sd2snes_mini}/dcm.v
  147. +552 −0 verilog/sd2snes_mini/main.qsf
  148. +145 −0 verilog/sd2snes_mini/main.sdc
  149. +16 −16 verilog/{sd2sneslite → sd2snes_mini}/main.ucf
  150. +53 −8 verilog/{sd2sneslite → sd2snes_mini}/main.v
  151. +807 −0 verilog/sd2snes_mini/main_assignment_defaults.qdf
  152. 0 verilog/{sd2sneslite → sd2snes_mini}/mcu_cmd.v
  153. +11 −0 verilog/sd2snes_mini/pll.ppf
  154. +7 −0 verilog/sd2snes_mini/pll.qip
  155. +319 −0 verilog/sd2snes_mini/pll.v
  156. +30 −0 verilog/sd2snes_mini/sd2snes_mini.qpf
  157. +12 −11 verilog/{sd2sneslite/sd2sneslite.xise → sd2snes_mini/sd2snes_mini.xise}
  158. 0 verilog/{sd2sneslite → sd2snes_mini}/spi.v
  159. +121 −0 verilog/sd2snes_obc1/Makefile
  160. +11 −0 verilog/sd2snes_obc1/dac.v
  161. +6 −0 verilog/sd2snes_obc1/dac_buf.qip
  162. +213 −0 verilog/sd2snes_obc1/dac_buf.v
  163. +520 −0 verilog/sd2snes_obc1/main.qsf
  164. +145 −0 verilog/sd2snes_obc1/main.sdc
  165. +67 −3 verilog/sd2snes_obc1/main.v
  166. +807 −0 verilog/sd2snes_obc1/main_assignment_defaults.qdf
  167. +12 −0 verilog/sd2snes_obc1/msu.v
  168. +6 −0 verilog/sd2snes_obc1/msu_databuf.qip
  169. +213 −0 verilog/sd2snes_obc1/msu_databuf.v
  170. +22 −0 verilog/sd2snes_obc1/obc1.v
  171. +6 −0 verilog/sd2snes_obc1/obc_lower.qip
  172. +172 −0 verilog/sd2snes_obc1/obc_lower.v
  173. +6 −0 verilog/sd2snes_obc1/obc_upper.qip
  174. +242 −0 verilog/sd2snes_obc1/obc_upper.v
  175. +11 −0 verilog/sd2snes_obc1/pll.ppf
  176. +7 −0 verilog/sd2snes_obc1/pll.qip
  177. +320 −0 verilog/sd2snes_obc1/pll.v
  178. +30 −0 verilog/sd2snes_obc1/sd2snes_obc1.qpf
  179. +1 −1 verilog/sd2snes_obc1/sd2snes_obc1.xise
  180. +6 −0 verilog/sd2snes_obc1/snescmd_buf.qip
  181. +242 −0 verilog/sd2snes_obc1/snescmd_buf.v
  182. +121 −0 verilog/sd2snes_sa1/Makefile
  183. +14 −1 verilog/sd2snes_sa1/dac.v
  184. +6 −0 verilog/sd2snes_sa1/dac_buf.qip
  185. +213 −0 verilog/sd2snes_sa1/dac_buf.v
  186. +264 −0 verilog/sd2snes_sa1/dec_table.mif
  187. +6 −0 verilog/sd2snes_sa1/dec_table.qip
  188. +159 −0 verilog/sd2snes_sa1/dec_table.v
  189. +527 −0 verilog/sd2snes_sa1/main.qsf
  190. +125 −0 verilog/sd2snes_sa1/main.sdc
  191. +73 −5 verilog/sd2snes_sa1/main.v
  192. +807 −0 verilog/sd2snes_sa1/main_assignment_defaults.qdf
  193. +15 −2 verilog/sd2snes_sa1/msu.v
  194. +6 −0 verilog/sd2snes_sa1/msu_databuf.qip
  195. +213 −0 verilog/sd2snes_sa1/msu_databuf.v
  196. +11 −0 verilog/sd2snes_sa1/pll.ppf
  197. +7 −0 verilog/sd2snes_sa1/pll.qip
  198. +319 −0 verilog/sd2snes_sa1/pll.v
  199. +43 −0 verilog/sd2snes_sa1/sa1.v
  200. +6 −0 verilog/sd2snes_sa1/sa1_div.qip
  201. +111 −0 verilog/sd2snes_sa1/sa1_div.v
  202. +6 −0 verilog/sd2snes_sa1/sa1_iram.qip
  203. +242 −0 verilog/sd2snes_sa1/sa1_iram.v
  204. +6 −0 verilog/sd2snes_sa1/sa1_mult.qip
  205. +116 −0 verilog/sd2snes_sa1/sa1_mult.v
  206. +30 −0 verilog/sd2snes_sa1/sd2snes_sa1.qpf
  207. +3 −3 verilog/sd2snes_sa1/{sd2snes.xise → sd2snes_sa1.xise}
  208. +6 −0 verilog/sd2snes_sa1/snescmd_buf.qip
  209. +242 −0 verilog/sd2snes_sa1/snescmd_buf.v
  210. +0 −185 verilog/sd2snes_sa1/srtc.v
  211. +0 −638 verilog/sd2snes_sa1/upd77c25.v
  212. +0 −150 verilog/sd2snes_sa1/updtest_tf.v
  213. +72 −0 verilog/sd2snes_sdd1/DCM.v
  214. +118 −2 verilog/sd2snes_sdd1/Makefile
  215. +0 −26 verilog/sd2snes_sdd1/address.v
  216. +11 −0 verilog/sd2snes_sdd1/dac.v
  217. +6 −0 verilog/sd2snes_sdd1/dac_buf.qip
  218. +213 −0 verilog/sd2snes_sdd1/dac_buf.v
  219. +529 −0 verilog/sd2snes_sdd1/main.qsf
  220. +145 −0 verilog/sd2snes_sdd1/main.sdc
  221. +74 −3 verilog/sd2snes_sdd1/main.v
  222. +12 −0 verilog/sd2snes_sdd1/msu.v
  223. +6 −0 verilog/sd2snes_sdd1/msu_databuf.qip
  224. +213 −0 verilog/sd2snes_sdd1/msu_databuf.v
  225. +11 −0 verilog/sd2snes_sdd1/pll.ppf
  226. +7 −0 verilog/sd2snes_sdd1/pll.qip
  227. +320 −0 verilog/sd2snes_sdd1/pll.v
  228. +30 −0 verilog/sd2snes_sdd1/sd2snes_sdd1.qpf
  229. +1 −1 verilog/sd2snes_sdd1/{sd2snes.xise → sd2snes_sdd1.xise}
  230. +6 −0 verilog/sd2snes_sdd1/snescmd_buf.qip
  231. +242 −0 verilog/sd2snes_sdd1/snescmd_buf.v
  232. +121 −0 verilog/sd2snes_test/Makefile
  233. +0 −77 verilog/sd2sneslite/data.v
@@ -0,0 +1,52 @@

MCUSRC := src

MK2MCUPATH := $(MCUSRC)/obj-mk2
MK3MCUPATH := $(MCUSRC)/obj-mk3
MK2MCU := firmware.img
MK3MCU := firmware.im3

MENUPATH := snes
MK2MENU := menu.bin
MK3MENU := m3nu.bin

FPGAPATH := verilog
MK2EXT := bit
MK3EXT := bi3
MK2CORES := base cx4 gsu obc1 sdd1 sa1
MK3CORES := base cx4 gsu obc1 sdd1 sa1

MK2FPGA := $(foreach C,$(MK2CORES),$(FPGAPATH)/sd2snes_$C/fpga_$C.$(MK2EXT))
MK3FPGA := $(foreach C,$(MK3CORES),$(FPGAPATH)/sd2snes_$C/fpga_$C.$(MK3EXT))

UTILS := utils

VERSION ?= SNAPSHOT

TARGETPARENT := release/v$(VERSION)
TARGET := $(TARGETPARENT)/sd2snes

all: version release

release: version bsxpage
rm -rf $(TARGETPARENT)
mkdir -p $(TARGET)
cp bsxpage.bin $(TARGET)
cp $(MK2FPGA) $(TARGET)
cp $(MK3FPGA) $(TARGET)
cp $(MK2MCUPATH)/$(MK2MCU) $(TARGET)
cp $(MK3MCUPATH)/$(MK3MCU) $(TARGET)
cp $(MENUPATH)/$(MK2MENU) $(TARGET)
cp $(MENUPATH)/$(MK3MENU) $(TARGET)
cd $(TARGETPARENT) && zip -r sd2snes_firmware_v$(VERSION).zip sd2snes

bsxpage:
$(UTILS)/genbsxpage

version:
@echo Version: $(VERSION)
ifeq ($(VERSION),SNAPSHOT)
$(warning For release packaging please specify VERSION (e.g. 1.2.3))
endif

.PHONY: version release bsxpage
@@ -0,0 +1,15 @@
KEY_ARCH = p12f629
LOCK_ARCH = p16f630

all: supercic-key.hex supercic-lock.hex

supercic-key.hex: supercic-key.asm
gpasm -p $(KEY_ARCH) $^

supercic-lock.hex: supercic-lock.asm
gpasm -p $(LOCK_ARCH) $^

clean:
rm supercic-key.hex supercic-lock.hex

.PHONY: all clean
@@ -1,14 +1,17 @@
OBJS = header.ips reset.o65 main.o65 font.o65 palette.o65 data.o65 const.o65 logo.o65 logospr.o65 dma.o65 filesel.o65 pad.o65 time.o65 sysinfo.o65 spc700.o65 spcplay.o65 menu.o65 menudata.o65 ui.o65 nmihook.o65 common.o65 # gfx.o65 # vars.o65
OBJS = header.ips reset.o65 main.o65 font.o65 palette.o65 data.o65 const.o65 logo.o65 logospr.o65 dma.o65 filesel.o65 pad.o65 time.o65 sysinfo.o65 spc700.o65 spcplay.o65 menu.o65 menudata.o65 ui.o65 nmihook.o65 common.o65 cheat.o65 # gfx.o65 # vars.o65

all: clean menu.bin map
# stopgap measure to create both files as long as they are identical...
OUT = menu.bin m3nu.bin

all: clean $(OUT) map

smc: menu.bin
cat menu.bin sd2snes.rom > menu.smc

map: menu.bin
utils/mkmap.sh $(OBJS)

menu.bin: $(OBJS)
$(OUT): $(OBJS)
sneslink -fsmc -o $@ $^ 2>&1 | tee link.log

# Generic rule to create .o65 out from .a65
@@ -20,4 +23,4 @@ menu.bin: $(OBJS)
snescom -I -J -Wall -o $@ $< 2>&1 | tee $@.log

clean:
rm -f *.ips *.o65 *~ menu.bin
rm -f *.ips *.o65 *~ $(OUT)
@@ -22,11 +22,13 @@
#----------------------------------------------------------------------------

# Read configuration file
ifdef CONFIG
CONFIGSUFFIX = $(CONFIG:config%=%)
ifndef CONFIG
$(info ERROR: Please use $(MAKE) CONFIG=... to specify at least one config file.)
$(info Available configs:)
$(info $(wildcard config-*))
$(error missing CONFIG parameter)
else
CONFIG = config
CONFIGSUFFIX =
CONFIGSUFFIX = $(CONFIG:config%=%)
endif

# Enable verbose compilation with "make V=1"
@@ -48,11 +50,15 @@ OBJDIR := obj$(CONFIGSUFFIX)
FORMAT = binary

# Linker script
LINKERSCRIPT = lpc1754.ld
LINKERSCRIPT = $(CONFIG_LD_SCRIPT)

# Target file name (without extension).
TARGET = $(OBJDIR)/sd2snes

# Environment variables for openocd reuse
export FW_START=$(CONFIG_FW_START)
export FW_FILE=$(OBJDIR)/$(CONFIG_FW_FILE)
export FLASH_SIZE=$(CONFIG_FLASH_SIZE)

# List C source files here. (C dependencies are automatically generated.)
SRC = main.c ff.c ccsbcs.c clock.c uart.c power.c led.c timer.c
@@ -130,7 +136,7 @@ NM = $(ARCH)-nm
REMOVE = rm -f
COPY = cp
AWK = awk

BIN2C = ../utils/bin2c

#---------------- Compiler Options ----------------
# -g*: generate debugging information
@@ -197,17 +203,14 @@ ALL_CFLAGS = -I. $(CFLAGS) $(GENDEPFLAGS)
ALL_ASFLAGS = -I. -x assembler-with-cpp $(ASFLAGS) $(CDEFS)





# Default target.
all: build

build: elf bin hex
$(E) " SIZE $(TARGET).elf"
$(Q)$(ELFSIZE)|grep -v debug
cp $(TARGET).bin $(OBJDIR)/firmware.img
utils/genhdr $(OBJDIR)/firmware.img SNSD $(CONFIG_FWVER)
cp $(TARGET).bin $(OBJDIR)/$(CONFIG_FW_FILE)
utils/genhdr $(OBJDIR)/$(CONFIG_FW_FILE) $(CONFIG_FW_MAGIC) $(CONFIG_FWVER)

elf: $(TARGET).elf
bin: $(TARGET).bin
@@ -216,33 +219,32 @@ eep: $(TARGET).eep
lss: $(TARGET).lss
sym: $(TARGET).sym

# # A little helper target for the maintainer =)
# copy2card:
# cp $(TARGET).bin /mbed/hw_LPC1768.bin


program: build
utils/lpcchksum $(TARGET).bin
openocd -f openocd-usb.cfg -f lpc1754.cfg -f flash.cfg
openocd -f openocd-usb.cfg -f lpc175x.cfg -f flash.cfg

debug: build
openocd -f openocd-usb.cfg -f lpc1754.cfg
openocd -f openocd-usb.cfg -f lpc175x.cfg

reset:
openocd -f openocd-usb.cfg -f lpc1754.cfg -f reset.cfg
openocd -f openocd-usb.cfg -f lpc175x.cfg -f reset.cfg

# Display size of file.
HEXSIZE = $(SIZE) --target=$(FORMAT) $(TARGET).hex
ELFSIZE = $(SIZE) -A $(TARGET).elf



# Generate autoconf.h from config
.PRECIOUS : $(OBJDIR)/autoconf.h
$(OBJDIR)/autoconf.h: $(CONFIG) | $(OBJDIR)
$(E) " CONF2H $(CONFIG)"
$(Q)$(AWK) -f conf2h.awk $(CONFIG) > $(OBJDIR)/autoconf.h

# Generate embedded FPGA config from finished bitfile
.PRECIOUS : $(OBJDIR)/cfgware.h
$(OBJDIR)/cfgware.h: $(CONFIG_CFGWARE) | $(OBJDIR) $(OBJDIR)/autoconf.h
$(E) " BIN2C $(CONFIG_CFGWARE)"
$(Q)$(BIN2C) "$(CONFIG_CFGWARE)" cfgware > $(OBJDIR)/cfgware.h

# Create final output files from ELF output file.
$(OBJDIR)/%.bin: $(OBJDIR)/%.elf
$(E) " BIN $@"
@@ -272,13 +274,13 @@ $(TARGET).elf : $(OBJ)


# Compile: create object files from C source files.
$(OBJDIR)/%.o : %.c | $(OBJDIR) $(OBJDIR)/autoconf.h
$(OBJDIR)/%.o : %.c | $(OBJDIR) $(OBJDIR)/autoconf.h $(OBJDIR)/cfgware.h
$(E) " CC $<"
$(Q)$(CC) -c $(ALL_CFLAGS) $< -o $@


# Compile: create assembler files from C source files.
$(OBJDIR)/%.s : %.c | $(OBJDIR) $(OBJDIR)/autoconf.h
$(OBJDIR)/%.s : %.c | $(OBJDIR) $(OBJDIR)/autoconf.h $(OBJDIR)/cfgware.h
$(CC) -S $(ALL_CFLAGS) $< -o $@


@@ -288,7 +290,7 @@ $(OBJDIR)/%.o : %.S | $(OBJDIR) $(OBJDIR)/autoconf.h
$(Q)$(CC) -c $(ALL_ASFLAGS) $< -o $@

# Create preprocessed source for use in sending a bug report.
$(OBJDIR)/%.i : %.c | $(OBJDIR) $(OBJDIR)/autoconf.h
$(OBJDIR)/%.i : %.c | $(OBJDIR) $(OBJDIR)/autoconf.h $(OBJDIR)/cfgware.h
$(CC) -E -mmcu=$(MCU) -I. $(CFLAGS) $< -o $@

# Create the output directory

0 comments on commit a01fb3d

Please sign in to comment.
You can’t perform that action at this time.