goodfet.bsl client for precompiled firmware.
[goodfet] / firmware / Makefile
1
2 #include `uname`.mak
3
4 GOODFET?=/dev/ttyUSB0
5
6
7 #For tos-bsl, use --invert-reset --invert-test
8 BSL=goodfet.bsl -c $(GOODFET) --speed=38400
9
10 #mcu=msp430x2274
11 #mcu=msp430x2618
12 mcu?=msp430x1612
13
14
15 #N.B., gcc WILL NOT BITCH if this file doesn't exist.
16 #GCCINC=-T ldscripts/161x.x
17 GCCINC=-T ldscripts/$(mcu).x
18
19 CCEXTRA?=
20 CC=msp430-gcc -Wall -g -mmcu=$(mcu) -DGCC $(GCCINC) -I include $(CCEXTRA)
21
22 #Define extra modules here.
23 moreapps?=
24
25 apps= $(moreapps) apps/monitor/monitor.o apps/spi/spi.o apps/i2c/i2c.o apps/chipcon/chipcon.o apps/jtag/jtag.o apps/jtag/jtag430.o apps/jtag/jtag430x2.o
26 libs= lib/$(mcu).o lib/command.o apps/jtag/jtag430asm.o
27 app= goodfet
28
29 all: $(app).hex
30
31 goodfet.hex: goodfet
32
33 run:
34         ../client/goodfet.msp430 test
35
36 install: $(app).hex
37         $(BSL) -e
38         ls info.txt && $(BSL) -p info.txt || true  #MSP430F2xx targets only, inelegant.
39         $(BSL) -p $(app).hex 
40 verify:
41         $(BSL) -P $(app).hex -v $(app).hex
42 dumpinfo:
43         $(BSL) --dumpinfo
44 $(app): $(app).c $(libs) $(apps)
45 $(app).hex: $(app)
46         msp430-objcopy goodfet -O ihex goodfet.hex
47 m4s: $(app).hex
48         msp430-objdump -D -m msp430 $(app).hex | m4s init
49 erase:
50         $(BSL) -e 
51 clean:
52         rm -f $(app) $(app).hex $(libs) $(apps)