grummlatsf wrote on Monday, November 23, 2009:
I am trying for weeks now to build a environment for FreeRTOS with STR750 uC for a GCC crosscompiler.
As this is my first experience with creating makefiles, I did not get it to work by now.
Has anyone a makefile lying around for me or could give me a hint whats wrong with mine?!
Thank you!
<pre><code>
SOURCE_DIR=./source/
LIB_SOURCE_DIR=./STLibrary/src/
CC = arm-none-eabi-gcc
OBJCOPY=arm-none-eabi-objcopy
LDSCRIPT=systemfiles/STR75xFx0_FLASH_FreeRTOS.ld
#LINKER_FLAGS=-mthumb -nostartfiles -Xlinker -oRTOSDemo.elf -gc-section -Xlinker -M -Xlinker -Map=rtosdemo.map
LINKER_FLAGS=-nostartfiles -Xlinker -oRTOSDemo.elf -gc-section -Xlinker -M -Xlinker -Map=rtosdemo.map
DEBUG=-g
OPTIM=-O0
CFLAGS= $(DEBUG) \
$(OPTIM) \
-T$(LDSCRIPT) \
-I . \
-I ./include \
-I ./STLibrary/inc \
-mcpu=arm7tdmi-s \
-D PACK_STRUCT_END=__attribute\(\(packed\)\) \
-D ALIGN_STRUCT_END=__attribute\(\(aligned\(4\)\)\) \
-fomit-frame-pointer \
-ffunction-sections
THUMB_SOURCE= \
source/main.c
ARM_SOURCE= \
$(SOURCE_DIR)main.c \
$(SOURCE_DIR)ParTest.c \
$(SOURCE_DIR)serial.c \
$(SOURCE_DIR)serialISR.c \
$(SOURCE_DIR)croutine.c \
$(SOURCE_DIR)list.c \
$(SOURCE_DIR)port.c \
$(SOURCE_DIR)portISR.c \
$(SOURCE_DIR)queue.c \
$(SOURCE_DIR)tasks.c \
$(SOURCE_DIR)portISR.c \
$(SOURCE_DIR)integer.c \
$(SOURCE_DIR)blocktim.c \
$(SOURCE_DIR)BlockQ.c \
$(SOURCE_DIR)comtest.c \
$(SOURCE_DIR)dynamic.c \
$(SOURCE_DIR)flash.c \
$(SOURCE_DIR)heap_2.c \
$(LIB_SOURCE_DIR)75x_adc.c \
$(LIB_SOURCE_DIR)75x_can.c \
$(LIB_SOURCE_DIR)75x_cfg.c \
$(LIB_SOURCE_DIR)75x_dma.c \
$(LIB_SOURCE_DIR)75x_eic.c \
$(LIB_SOURCE_DIR)75x_extit.c \
$(LIB_SOURCE_DIR)75x_gpio.c \
$(LIB_SOURCE_DIR)75x_i2c.c \
$(LIB_SOURCE_DIR)75x_it.c \
$(LIB_SOURCE_DIR)75x_lib.c \
$(LIB_SOURCE_DIR)75x_mrcc.c \
$(LIB_SOURCE_DIR)75x_pwm.c \
$(LIB_SOURCE_DIR)75x_rtc.c \
$(LIB_SOURCE_DIR)75x_smi.c \
$(LIB_SOURCE_DIR)75x_ssp.c \
$(LIB_SOURCE_DIR)75x_tb.c \
$(LIB_SOURCE_DIR)75x_tim.c \
$(LIB_SOURCE_DIR)75x_uart.c \
$(LIB_SOURCE_DIR)75x_wdg.c \
$(LIB_SOURCE_DIR)lcd.c
THUMB_OBJS = $(THUMB_SOURCE:.c=.o)
ARM_OBJS = $(ARM_SOURCE:.c=.o)
all: RTOSDemo.bin
RTOSDemo.bin : RTOSDemo.elf
$(OBJCOPY) RTOSDemo.elf -O binary RTOSDemo.bin
RTOSDemo.elf : $(THUMB_OBJS) $(ARM_OBJS) Makefile
$(CC) $(CFLAGS) $(ARM_OBJS) $(THUMB_OBJS) $(LIBS) systemfiles/crt0_STR75x_FreeRTOS.s $(LINKER_FLAGS)
$(THUMB_OBJS) : %.o : %.c Makefile FreeRTOSConfig.h
$(CC) -c $(CFLAGS) $< -o $@
$(ARM_OBJS) : %.o : %.c Makefile FreeRTOSConfig.h
$(CC) -c $(CFLAGS) $< -o $@
clean :
rm $(THUMB_OBJS)
rm $(ARM_OBJS)
touch Makefile
rm RTOSDemo.elf
</code></pre>