5 #For tos-bsl, use --invert-reset --invert-test
6 BSL?=goodfet.bsl --speed=38400
8 #One of these should be defined explicitly.
9 #Default removed because of confusion.
23 #N.B., gcc WILL NOT BITCH if this file doesn't exist.
24 #GCCINC=-T ldscripts/161x.x
25 GCCINC=-T ldscripts/$(mcu).x
28 CC=msp430-gcc -Wall -Os -g -mmcu=$(mcu) -D$(mcu) -D$(platform) -Dplatform=$(platform) -DGCC $(GCCINC) -I include -I platforms $(CCEXTRA)
30 # Available Applications
31 # ======================
32 # Below is a list of available applications and their descriptions.
35 # None have made it to production grade quality
38 # monitor -- Basic monitor
39 # spi -- Turns GF into USB-to-SPI adapter
40 # jtag -- Low level JTAG (needed by all other JTAG code)
41 # sbw -- Makes JTAG Spy-by-wire multiplexable
44 # jtag430 -- 16-bit MSP430 JTAG
45 # jtag430x2 -- 20-bit MSP430 JTAG
49 # i2c -- Turns GF into USB-to-i2c adapter
50 # jtagarm7 -- ARM7TDMI JTAG
52 # jtagxscale -- XScale JTAG
55 # chipcon -- Chipcon radio 8051 debugging
57 # pic -- PIC24H/dsPIC33F debugger
58 # adc -- ADC10 (still specific to x2274, GoodFET32)
61 # nrf -- Nordic RF SPI
62 # ccspi -- Chipcon SPI
65 # glitch -- Glitch research tool
66 # smartcard -- Smartcard IO
72 # This is what you need to customize to specify which apps you want in your
73 # firmware. The "config" variable is just a space-delimited list of apps you
74 # want included. The makefile will take the list of apps and include all of
75 # the proper code needed to build your desired firmware.
81 # config = monitor jtag
84 # config = monitor chipcon ccspi
87 # config = monitor glitch
90 # config = monitor jtagxscale
93 #config = monitor sbw chipcon nrf ccspi spi jtagarm7 jtag430 jtag430x2 avr
96 config = monitor chipcon ccspi nrf spi jtagarm7 jtag430 jtag430x2 avr
99 # Build the needed list of app and lib object files from the config
101 libs= lib/$(mcu).o lib/command.o lib/dco_calib.o lib/apps.o
105 # include monitor app
106 ifeq ($(filter monitor, $(config)), monitor)
107 apps+= apps/monitor/monitor.o
112 ifeq ($(filter spi, $(config)), spi)
113 apps+= apps/spi/spi.o
117 # include base jtag if they specified it explicitly
118 ifeq ($(filter jtag, $(config)), jtag)
119 ifneq ($(filter apps/jtag/jtag.o, $(apps)), apps/jtag/jtag.o)
120 apps+= apps/jtag/jtag.o
125 # include the sbw defs if they specified it
126 ifeq ($(filter sbw, $(config)), sbw)
127 # if they only specify sbw, include jtag
128 ifneq ($(filter apps/jtag/jtag.o, $(apps)), apps/jtag/jtag.o)
129 apps+= apps/jtag/jtag.o
132 apps+= apps/jtag/sbw.o
136 # include jtag430 app
137 ifeq ($(filter jtag430, $(config)), jtag430)
138 # add in base jtag code if not already
139 ifneq ($(filter apps/jtag/jtag.o, $(apps)), apps/jtag/jtag.o)
140 apps+= apps/jtag/jtag.o
143 # add in the jtag430asm code if needed
144 ifneq ($(filter apps/jtag/jtag430asm.o, $(libs)), apps/jtag/jtag430asm.o)
145 apps+= apps/jtag/jtag430asm.o
147 apps+= apps/jtag/jtag430.o
151 # include jtag430x2 app
152 ifeq ($(filter jtag430x2, $(config)), jtag430x2)
153 # add in base jtag code if not already
154 ifneq ($(filter apps/jtag/jtag.o, $(apps)), apps/jtag/jtag.o)
155 apps+= apps/jtag/jtag.o
158 # add in the jtag430asm code if needed
159 ifneq ($(filter jtag430asm.o, $(libs)), jtag430asm.o)
160 libs+= apps/jtag/jtag430asm.o
162 #add in the jtag430 app if not already
163 ifneq ($(filter apps/jtag/jtag430.o, $(apps)), apps/jtag/jtag430.0)
164 apps+= apps/jtag/jtag430.o
167 apps+= apps/jtag/jtag430x2.o
172 ifeq ($(filter i2c, $(config)), i2c)
173 apps+= apps/i2c/i2c.o
177 # include jtagarm7 app
178 ifeq ($(filter jtagarm7, $(config)), jtagarm7)
179 # add in base jtag code if not already
180 ifneq ($(filter apps/jtag/jtag.o, $(apps)), apps/jtag/jtag.o)
181 apps+= apps/jtag/jtag.o
184 apps+= apps/jtag/jtagarm7.o
188 # include jtagarm7tdmi app
189 #ifeq ($(filter jtagarm7tdmi, $(config)), jtagarm7tdmi)
190 # add in base jtag code if not already
191 #ifneq ($(filter apps/jtag/jtag.o, $(apps)), apps/jtag/jtag.o)
192 #apps+= apps/jtag/jtag.o
195 #apps+= apps/jtag/jtagarm7tdmi.o
196 #hdrs+= jtagarm7tdmi.h
200 ifeq ($(filter ejtag, $(config)), ejtag)
201 # add in base jtag code if not already
202 ifneq ($(filter apps/jtag/jtag.o, $(apps)), apps/jtag/jtag.o)
203 apps+= apps/jtag/jtag.o
206 apps+= apps/jtag/ejtag.o
210 # include jtagxscale app
211 ifeq ($(filter jtagxscale, $(config)), jtagxscale)
212 # add in base jtag code if not already
213 ifneq ($(filter apps/jtag/jtag.o, $(apps)), apps/jtag/jtag.o)
214 apps+= apps/jtag/jtag.o
217 apps+= apps/jtag/jtagxscale.o
221 # include chipcon app
222 ifeq ($(filter chipcon, $(config)), chipcon)
223 apps+= apps/chipcon/chipcon.o
228 ifeq ($(filter avr, $(config)), avr)
229 apps+= apps/avr/avr.o
236 ifeq ($(filter pic, $(config)), pic)
237 apps+= apps/pic/pic.o
242 ifeq ($(filter adc, $(config)), adc)
243 ifeq ($(mcu), msp430x2274)
244 apps+= apps/adc/adc.o
247 ERR= $(error The ADC app only works on GoodFET boards with the msp430x2274 processor)
251 # include chipcon radio spi app
252 ifeq ($(filter ccspi, $(config)), ccspi)
253 apps+= apps/radios/ccspi.o
258 ifeq ($(filter nrf, $(config)), nrf)
259 apps+= apps/radios/nrf.o
264 ifeq ($(filter glitch, $(config)), glitch)
265 apps+= apps/glitch/glitch.o
269 # include smartcard app
270 ifeq ($(filter smartcard, $(config)), smartcard)
271 apps+= apps/smartcard/smartcard.o
276 ifeq ($(filter ps2, $(config)), ps2)
277 apps+= apps/plugins/ps2.o
294 cp platforms/$(platform).h include/config.h
303 ../client/goodfet.msp430 test
306 $(BSL) -e -p $(app).hex
308 $(BSL) -P $(app).hex -p info.txt || true #MSP430F2xx targets only, inelegant.
310 $(BSL) -P $(app).hex -v $(app).hex
313 $(app).c: config builddate appsfiles err
314 $(app): $(app).c $(libs) $(apps)
316 msp430-objcopy goodfet -O ihex goodfet.hex
318 msp430-objdump -D -m msp430 $(app).hex | m4s init
322 rm -f $(app) $(app).hex $(libs) $(apps) lib/apps.c include/config.h include/builddate.h include/apps.h
326 rsync --exclude .svn -ave ssh doc/html/* travisutk,goodfet@web.sourceforge.net:htdocs/docs/