Libraries, utilities, bootloaders...
by treflip » Sun Jul 27, 2014 3:34 pm
Yeah jonne, if you don't mind what did you do to make the boot loader compile? I had gotten it pretty close but was getting an error about finding a file... The last I remember compiling it? Thanks!
Also, Albertinjo - That works awesome! Putting a 100uf cap between the lcd and gnd completely removes the flicker in my screen. Thanks!
-
treflip
-
- Posts: 83
- Joined: Fri May 30, 2014 4:50 pm
- Location: Florida
by jonnection » Mon Jul 28, 2014 9:55 pm
treflip wrote:Yeah jonne, if you don't mind what did you do to make the boot loader compile? I had gotten it pretty close but was getting an error about finding a file... The last I remember compiling it? Thanks! !
I compiled it in linux. Here's my makefile. I can't help more until you tell the error you're getting.
- Code: Select all
# location of the arduino install folder
# ARDUINO_DIR = C:/arduino-1.0.5
ARDUINO_DIR = /home/jonne/Downloads/arduino-1.0.5/
# name of this project (used for the output files)
TARGET = gamebuino_boot
# target folder location
OUTPUT_DIR = obj
# compiler flags for c files
CFLAGS = -c -g -Os -Wall -fno-inline-small-functions -fno-split-wide-types -mshort-calls -mmcu=atmega328p -DF_CPU=16000000L '-DLED_START_FLASHES=3' '-DBAUD_RATE=115200' \
'-DMMC_CS=PORTB2' '-DMMC_PORT=PORTB' '-DMMC_DDR=DDRB'
# '-DMMC_CS=PORTD4' '-DMMC_PORT=PORTD' '-DMMC_DDR=DDRD'
# linker flags
LINK_FLAGS = -g -Wall -Os -fno-inline-small-functions -fno-split-wide-types -mshort-calls -mmcu=atmega328p -Wl,--relax -Wl,--gc-sections -nostartfiles -nostdlib \
-Wl,--section-start=.text=0x7800 \
-Wl,--section-start=.jumps=0x7ffa \
-Wl,--section-start=.version=0x7ffe \
-Wl,--undefined=optiboot_version \
-Wl,--undefined=_jumptable
# location of various tools
BIN = $(ARDUINO_DIR)/hardware/tools/avr/bin
VAR_DIR = $(ARDUINO_DIR)/hardware/arduino/variants/standard
#GCC = $(BIN)/avr-gcc
#COPY = $(BIN)/avr-objcopy
#DUMP = $(BIN)/avr-objdump
GCC = avr-gcc
COPY = avr-objcopy
DUMP = avr-objdump
# set up all the include folders
INCLUDES = -I$(VAR_DIR) \
$(foreach inc,., -I$(inc)/)
# create a list of all the obj files to create for the project folders
PROJECT_OBJS = $(foreach folder, ., $(addprefix $(OUTPUT_DIR)/$(folder)/, $(addsuffix .o, $(notdir $(wildcard $(folder)/*.cpp) $(wildcard $(folder)/*.c)))))
# create a list of dependency files (one for each project obj file)
DEPENDENCIES = $(PROJECT_OBJS:.o=.d)
# main build target
.PHONY: all
all: $(OUTPUT_DIR)/$(TARGET).hex $(OUTPUT_DIR)/$(TARGET).lst
@echo Finished building $<
@echo
# rule to build the hex file
$(OUTPUT_DIR)/$(TARGET).hex: $(OUTPUT_DIR)/$(TARGET).elf
@mkdir -p $(dir $@)
@echo "Copying $@"
@$(COPY) -j .text -j .jumps -j .version --set-section-flags .version=alloc,load -O ihex $< $@
#.version=alloc,load
# rule to build the elf file
$(OUTPUT_DIR)/$(TARGET).elf: $(PROJECT_OBJS)
@echo "Linking $@"
@$(GCC) $(LINK_FLAGS) -o $(OUTPUT_DIR)/$(TARGET).elf $(PROJECT_OBJS)
# rule to build the lst file
$(OUTPUT_DIR)/$(TARGET).lst: $(OUTPUT_DIR)/$(TARGET).elf
@echo "Dumping $@"
@$(DUMP) -h -S $< > $@
#include the dependencies, if they exist
-include $(DEPENDENCIES)
# rule to build the project .c files
$(OUTPUT_DIR)/%.c.o: %.c
@mkdir -p $(dir $@)
@echo "Compiling $<"
$(GCC) $(CFLAGS) -I$(VAR_DIR) $(INCLUDES) -MMD $< -o $@
clean:
@echo Cleaning...
@-rm -f $(OUTPUT_DIR)/$(TARGET).eep
@-rm -f $(OUTPUT_DIR)/$(TARGET).hex
@-rm -f $(OUTPUT_DIR)/$(TARGET).elf
@-rm -f $(PROJECT_OBJS) $(DEPENDENCIES)
rebuild: clean all
-
jonnection
-
- Posts: 317
- Joined: Sun May 04, 2014 8:21 pm
-
by treflip » Tue Jul 29, 2014 3:41 am
Hey Jonne,
I compared makefiles and the only difference beside our home arduino directories (Program Files (x86)/Arduino) was this:
- Code: Select all
#GCC = $(BIN)/avr-gcc
#COPY = $(BIN)/avr-objcopy
#DUMP = $(BIN)/avr-objdump
GCC = avr-gcc
COPY = avr-objcopy
DUMP = avr-objdump
but that was pretty irrelevant, as I obtain this error whether I input the 3 lines of code or not...
- Code: Select all
makefile:51 *** missing separator. Stop.
the line 51 contains: .PHONY: all
not sure what separator it's looking for... :{
Thanks!
-
treflip
-
- Posts: 83
- Joined: Fri May 30, 2014 4:50 pm
- Location: Florida
Return to Software Development
Who is online
Users browsing this forum: No registered users and 120 guests