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