Jump to content
dimiter

gcc compiler on windows

Recommended Posts

Hi ,

 

I am trying to set up a basic toolchain on Windows , my aim was to generate some bin files that I could flash on the chip .

I downloaded the gcc compiler from https://launchpad.net/gcc-arm-embedded/+download

and the TivaWare package from TI.

Next I created a folder called blinky and copied there the /driverlib and /inc directories. I also created a /src directory for the program.

in the /src directory i copied the blinky file and the startup-gcc.c file along. On the mother directory i have the linker script and the Makefile.

 

When I try to compile however I get the following error:

 

C:\Users\D\ARM-Tiva\blinky3>make
driverlib/adc.c:49:24: fatal error: inc/hw_adc.h: No such file or directory
compilation terminated.
make: *** [driverlib/adc.o] Error 1

 

can somebody let me know as to what I am doing wrong on the Makefile. It seems as though the files on the driverlib directory are not aware of the other directories.

 

Here's the Makefile I am using.

PROJ_NAME = Blinky_TIVA

###################################################
# Set toolchain
TC = arm-none-eabi
RM = rm 

# Set Tools
CC			= $(TC)-gcc
AR			= $(TC)-ar
OBJCOPY		= $(TC)-objcopy
OBJDUMP		= $(TC)-objdump
SIZE		= $(TC)-size

###################################################
# Set Include Paths
INCLUDES 	= -Iinc 
INCLUDES 	= -Idriverlib
			
# Set Sources
LIB_SRCS	= $(wildcard driverlib/*.c)
USER_SRCS	= $(wildcard src/*.c)

# Set Objects
LIB_OBJS	= $(LIB_SRCS:.c=.o)
USER_OBJS	= $(USER_SRCS:.c=.o) startup_gcc.o

			
# Set Libraries
LIBS		= -lm -lc

###################################################
# Set Board
MCU 		= -mthumb -mcpu=cortex-m4
DEFINES 	= -DPART_LM4F120H5QR -DTARGET_IS_BLIZZARD_RA1

# Set Compilation and Linking Flags
CFLAGS 		= $(MCU) $(FPU) $(DEFINES) $(INCLUDES) \
			-g -Wall -std=gnu90 -O0 -ffunction-sections -fdata-sections
ASFLAGS 	= $(MCU) $(FPU) -g -Wa,--warn -x assembler-with-cpp
LDFLAGS 	= $(MCU) $(FPU) -g -gdwarf-2 \
			-Ttivalinker.ld \
			-Xlinker --gc-sections -Wl,-Map=$(PROJ_NAME).map \
			$(LIBS) \
			-o $(PROJ_NAME).elf

###################################################
# Default Target
all: $(PROJ_NAME).bin info

# elf Target
$(PROJ_NAME).elf: $(LIB_OBJS) $(USER_OBJS)
	@$(CC) $(LIB_OBJS) $(USER_OBJS) $(LDFLAGS)
	@echo $@

# bin Target
$(PROJ_NAME).bin: $(PROJ_NAME).elf
	@$(OBJCOPY) -O binary $(PROJ_NAME).elf $(PROJ_NAME).bin
	@echo $@

#$(PROJ_NAME).hex: $(PROJ_NAME).elf
#	@$(OBJCOPY) -O ihex $(PROJ_NAME).elf $(PROJ_NAME).hex
#	@echo $@

#$(PROJ_NAME).lst: $(PROJ_NAME).elf
#	@$(OBJDUMP) -h -S $(PROJ_NAME).elf > $(PROJ_NAME).lst
#	@echo $@

# Display Memory Usage Info
info: $(PROJ_NAME).elf
	@$(SIZE) --format=berkeley $(PROJ_NAME).elf

# Rule for .c files
.c.o:
	@$(CC) $(CFLAGS) -c -o $@ $<
	@echo $@

# Rule for .s files
.s.o:
	@$(CC) $(ASFLAGS) -c -o $@ $<
	@echo $@

# Clean Target
clean:
	$(RM) $(LIB_OBJS)
	$(RM) $(USER_OBJS)
	$(RM) $(PROJ_NAME).elf
	$(RM) $(PROJ_NAME).bin
	$(RM) $(PROJ_NAME).map

Share this post


Link to post
Share on other sites

@@bluehash Hi bluehash. I am running the Makefile from the main Blinky folder. There is only one Makefile in the Blinky directory , which includes the blinky.c tiva linker and startup_gcc.c file plus there are the two folders /driverlib and /inc.  I deleted the original makefile in the /driverlib directory since It did not work.  I am using Energia anyhow but I would prefer to run everything from a self-contained directory. I still do not understand the Makefiles well so I am possibly making some mistake.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×