projects
/
lra-as-sensor
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
makefile: added gdb
[lra-as-sensor]
/
Makefile
diff --git
a/Makefile
b/Makefile
index
f8cbf9e
..
8b4955b
100644
(file)
--- a/
Makefile
+++ b/
Makefile
@@
-1,16
+1,19
@@
# attiny25 makefile
MCU = attiny25
# attiny25 makefile
MCU = attiny25
+DEVICE = t25
F_CPU = 8000000UL
BAUD = 57600
PROGRAMMER_TYPE = usbasp
CC = avr-gcc
F_CPU = 8000000UL
BAUD = 57600
PROGRAMMER_TYPE = usbasp
CC = avr-gcc
+GDB = avr-gdb
OBJCOPY = avr-objcopy
OBJDUMP = avr-objdump
AVRSIZE = avr-size
AVRDUDE = avrdude
OBJCOPY = avr-objcopy
OBJDUMP = avr-objdump
AVRSIZE = avr-size
AVRDUDE = avrdude
+SIMAVR = simavr
CPPFLAGS = -DF_CPU=$(F_CPU) -DBAUD=$(BAUD) -I.
CFLAGS = -Os -g -Wall
CPPFLAGS = -DF_CPU=$(F_CPU) -DBAUD=$(BAUD) -I.
CFLAGS = -Os -g -Wall
@@
-32,6
+35,7
@@
$(ODIR)/%.o: %.c $(DEPS)
%.elf: $(OBJ)
$(CC) $(CFLAGS) $(LDFLAGS) $(TARGET_ARCH) $^ -o $@
%.elf: $(OBJ)
$(CC) $(CFLAGS) $(LDFLAGS) $(TARGET_ARCH) $^ -o $@
+# TODO: add fuse section with .j .fuse
%.hex: %.elf
$(OBJCOPY) -j .text -j .data -O ihex $< $@
%.hex: %.elf
$(OBJCOPY) -j .text -j .data -O ihex $< $@
@@
-49,17
+53,19
@@
clean:
rm -rf $(ODIR)/*.o *.hex *.elf *.map
check-dev:
rm -rf $(ODIR)/*.o *.hex *.elf *.map
check-dev:
- $(AVRDUDE) -p
t25
-c $(PROGRAMMER_TYPE) -b $(BAUD)
+ $(AVRDUDE) -p
$(DEVICE)
-c $(PROGRAMMER_TYPE) -b $(BAUD)
flash:
flash:
- $(AVRDUDE) -p
t25
-c $(PROGRAMMER_TYPE) -b $(BAUD) -U flash:w:hbc.hex:i
+ $(AVRDUDE) -p
$(DEVICE)
-c $(PROGRAMMER_TYPE) -b $(BAUD) -U flash:w:hbc.hex:i
read-flash-bin:
read-flash-bin:
- $(AVRDUDE) -p
t25
-c $(PROGRAMMER_TYPE) -b $(BAUD) -P /dev/ttyUSB0 -U flash:r:flash.bin:r
+ $(AVRDUDE) -p
$(DEVICE)
-c $(PROGRAMMER_TYPE) -b $(BAUD) -P /dev/ttyUSB0 -U flash:r:flash.bin:r
# simulator runs on localhost:1234
# load .elf file with avr-sim hex.elf
# and start debugging
sim:
# simulator runs on localhost:1234
# load .elf file with avr-sim hex.elf
# and start debugging
sim:
-
simavr
-f $(F_CPU) -m $(MCU) -g -t hbc.hex
+
$(SIMAVR)
-f $(F_CPU) -m $(MCU) -g -t hbc.hex
+gdb:
+ $(GDB) -x gdb-commands.txt hbc.elf