Code: Select all
C:\Users\Dan>avrdude -p m644 -c stk500v1 -P COM6
avrdude: AVR device initialized and ready to accept instructions
Reading | ################################################## | 100% 0.05s
avrdude: Device signature = 0x1e9609
avrdude: safemode: Fuses OK
avrdude done. Thank you.
C:\fuzefirmware-v2b2\hello>make
0 [main] sh 4416 sync_with_child: child 4928(0x108) died before initializa
tion with status code 0x0
708 [main] sh 4416 sync_with_child: *** child state waiting for longjmp
/usr/bin/sh: fork: Resource temporarily unavailable
avr-gcc.exe -I.. -mmcu=atmega644 -Wall -gdwarf-2 -std=gnu99 -DF_CPU=28636360UL -
Os -DVIDEO_MODE=1 -fsigned-char -MD -MP -MT hello.o -MF dep/hello.o.d -c hello
.c
hello.c:19: fatal error: opening dependency file dep/hello.o.d: No such file or
directory
compilation terminated.
make: *** [hello.o] Error 1
Dan
EDIT: I guess attaching my Makefile will probably help too! The Device Manager lists the device as "USB Serial Port (COM6)", so using that information I've set the AVRDUDE_PORT variable to com6. I'm using the FTDI cable so AVRDUDE_PROGRAMMER is stk500v1. These are the only two variables I have changed.
Code: Select all
###############################################################################
# Makefile for the project Hello
###############################################################################
## General Flags
PROJECT = hello
VIDEOMODE = 1
# Change if your programmer is different
AVRDUDE_PROGRAMMER = stk500v1
AVRDUDE_PORT = com6 # programmer connected to serial device
# Don't change unless you really know whats going on
MCU = atmega644
TARGET = $(PROJECT).elf
CC = avr-gcc.exe
## Options common to compile, link and assembly rules
COMMON = -mmcu=$(MCU)
## Compile options common for all C compilation units.
CFLAGS = $(COMMON)
CFLAGS += -Wall -gdwarf-2 -std=gnu99 -DF_CPU=28636360UL -Os -DVIDEO_MODE=$(VIDEOMODE) -fsigned-char
CFLAGS += -MD -MP -MT $(*F).o -MF dep/$(@F).d
## Assembly specific flags
ASMFLAGS = $(COMMON)
ASMFLAGS += $(CFLAGS)
ASMFLAGS += -x assembler-with-cpp -Wa,-gdwarf2
## Linker flags
LDFLAGS = $(COMMON)
LDFLAGS += -Wl,-Map=$(PROJECT).map
INCLUDES = -I..
## Intel Hex file production flags
HEX_FLASH_FLAGS = -R .eeprom
HEX_EEPROM_FLAGS = -j .eeprom
HEX_EEPROM_FLAGS += --set-section-flags=.eeprom="alloc,load"
HEX_EEPROM_FLAGS += --change-section-lma .eeprom=0 --no-change-warnings
## Objects that must be built in order to link
OBJECTS = $(PROJECT).o uzeboxCore.o uzeboxSoundEngine.o uzeboxSoundEngineCore.o BANNED.o BANNED.o
## Objects explicitly added by the user
LINKONLYOBJECTS =
AVRDUDE = avrdude
AVRDUDE_FLAGS = -p $(MCU) -P $(AVRDUDE_PORT) -c $(AVRDUDE_PROGRAMMER)
## Build
all: $(TARGET) $(PROJECT).hex $(PROJECT).eep $(PROJECT).lss size
# Program the device.
program: $(PROJECT).hex $(PROJECT).eep
$(AVRDUDE) $(AVRDUDE_FLAGS) -B 1 -U flash:w:$<
## Compile
uzeboxSoundEngineCore.o: ../kernel/uzeboxSoundEngineCore.s
$(CC) $(INCLUDES) $(ASMFLAGS) -c $<
BANNED.o: ../kernel/BANNED.s
$(CC) $(INCLUDES) $(ASMFLAGS) -c $<
$(PROJECT).o: $(PROJECT).c
$(CC) $(INCLUDES) $(CFLAGS) -c $<
uzeboxCore.o: ../kernel/uzeboxCore.c
$(CC) $(INCLUDES) $(CFLAGS) -c $<
uzeboxSoundEngine.o: ../kernel/uzeboxSoundEngine.c
$(CC) $(INCLUDES) $(CFLAGS) -c $<
BANNED.o: ../kernel/BANNED.c
$(CC) $(INCLUDES) $(CFLAGS) -c $<
##Link
$(TARGET): $(OBJECTS)
$(CC) $(LDFLAGS) $(INCFLAGS) $(OBJECTS) $(LINKONLYOBJECTS) $(LIBDIRS) $(LIBS) -o $(TARGET)
%.hex: $(TARGET)
avr-objcopy -O ihex $(HEX_FLASH_FLAGS) $< $@
%.eep: $(TARGET)
-avr-objcopy $(HEX_EEPROM_FLAGS) -O ihex $< $@ || exit 0
%.lss: $(TARGET)
avr-objdump -h -S $< > $@
size: ${TARGET}
@echo
@avr-size -C --mcu=${MCU} ${TARGET}
## Clean target
.PHONY: clean
clean:
-rm -rf $(OBJECTS) $(PROJECT).elf dep/* $(PROJECT).hex $(PROJECT).eep $(PROJECT).lss $(PROJECT).map
## Other dependencies
-include $(shell mkdir dep 2>/dev/null) $(wildcard dep/*)