Compilation troubles

Moderator: adafruit

Please be positive and constructive with your questions and comments.
Locked
Dan_K
 
Posts: 12
Joined: Thu Dec 25, 2008 6:44 pm

Compilation troubles

Post by Dan_K »

Hi! First off, let me say thanks a lot for putting in the effort into creating and maintaining this project, it's been a lot of fun for me so far. However, I've run into a problem with compiling the Fuzebox's "Hello World" program, which I think is probably due to a misconfiguration on my part. I can get avrdude to talk to the Fuzebox perfectly fine, and I have been able to upload the sprites demo with no problems. Here's the output I get from the command prompt:

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
As you can see it communicates with the Fuzebox, but I'm getting problems trying to compile the example. Do you have any suggestions I can try? I'm running on Vista x64 if that helps.

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/*)

Dan_K
 
Posts: 12
Joined: Thu Dec 25, 2008 6:44 pm

Re: Compilation troubles

Post by Dan_K »

Aha! After much more digging around I've found the source of the problem. I'll paste my solution here for any other users experiencing the same problem:

It's a bug that appears in WinAVR on Vista x64, which causes the sync_with_child error that I was experiencing above. In order to solve it, you need to download a replacement msys-1.0.dll which goes in utils/bin/ on the WinAVR installation. The replacement dll file can be found here, which can be retrieved from this page.

adafruit
 
Posts: 12151
Joined: Thu Apr 06, 2006 4:21 pm

Re: Compilation troubles

Post by adafruit »

yay vista!

Dan_K
 
Posts: 12
Joined: Thu Dec 25, 2008 6:44 pm

Re: Compilation troubles

Post by Dan_K »

Hey, someone's got to be the guinea pig :P

I'm well on my way to making a Pong clone to get to grips with the kernel now. This is fun!

EDIT: Do you have an IRC channel by any chance?

BrianC
 
Posts: 1
Joined: Sun Dec 28, 2008 10:27 pm

Re: Compilation troubles

Post by BrianC »

ladyada wrote:yay vista!
Why do you assume it is Vista's fault, rather than the person that wrote the Cygwin DLL?

-Brian

adafruit
 
Posts: 12151
Joined: Thu Apr 06, 2006 4:21 pm

Re: Compilation troubles

Post by adafruit »

i didn't say it was vistas fault...this is a common occurrence when new OS's come out with non-backward-compatible apis. but he got it working which is good!

Locked
Please be positive and constructive with your questions and comments.

Return to “Fuzebox (discontinued)”