aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--boards/base/RaspberryPi/FreeRTOS/bcm2835_intc.h (renamed from boards/base/RaspberryPi/example-FreeRTOS/Drivers/bcm2835_intc.h)0
-rw-r--r--boards/base/RaspberryPi/FreeRTOS/freertos_main.c (renamed from boards/base/RaspberryPi/example-FreeRTOS/main.c)34
-rw-r--r--boards/base/RaspberryPi/FreeRTOS/gpio.c (renamed from boards/base/RaspberryPi/example-FreeRTOS/Drivers/gpio.c)0
-rw-r--r--boards/base/RaspberryPi/FreeRTOS/gpio.h (renamed from boards/base/RaspberryPi/example-FreeRTOS/Drivers/gpio.h)0
-rw-r--r--boards/base/RaspberryPi/FreeRTOS/interrupts.c (renamed from boards/base/RaspberryPi/example-FreeRTOS/Drivers/interrupts.c)0
-rw-r--r--boards/base/RaspberryPi/FreeRTOS/interrupts.h (renamed from boards/base/RaspberryPi/example-FreeRTOS/Drivers/interrupts.h)0
-rw-r--r--boards/base/RaspberryPi/FreeRTOS/mmio.h (renamed from boards/base/RaspberryPi/example-FreeRTOS/Drivers/mmio.h)0
-rw-r--r--boards/base/RaspberryPi/FreeRTOS/raspberrypi.ld (renamed from boards/base/RaspberryPi/example-FreeRTOS/raspberrypi.ld)0
-rw-r--r--boards/base/RaspberryPi/FreeRTOS/startup.s (renamed from boards/base/RaspberryPi/example-FreeRTOS/startup.s)4
-rw-r--r--boards/base/RaspberryPi/FreeRTOS/uart.c (renamed from boards/base/RaspberryPi/example-FreeRTOS/Drivers/uart.c)0
-rw-r--r--boards/base/RaspberryPi/FreeRTOS/uart.h (renamed from boards/base/RaspberryPi/example-FreeRTOS/Drivers/uart.h)0
-rw-r--r--boards/base/RaspberryPi/example-FreeRTOS/Makefile128
-rw-r--r--tools/gmake_scripts/cpu_armv6.mk18
-rw-r--r--tools/gmake_scripts/cpu_raspberrypi.mk18
-rw-r--r--tools/gmake_scripts/os_freertos.mk36
-rw-r--r--tools/gmake_scripts/readme.txt2
16 files changed, 137 insertions, 103 deletions
diff --git a/boards/base/RaspberryPi/example-FreeRTOS/Drivers/bcm2835_intc.h b/boards/base/RaspberryPi/FreeRTOS/bcm2835_intc.h
index 9f87b88e..9f87b88e 100644
--- a/boards/base/RaspberryPi/example-FreeRTOS/Drivers/bcm2835_intc.h
+++ b/boards/base/RaspberryPi/FreeRTOS/bcm2835_intc.h
diff --git a/boards/base/RaspberryPi/example-FreeRTOS/main.c b/boards/base/RaspberryPi/FreeRTOS/freertos_main.c
index 3a64a7bb..821a679b 100644
--- a/boards/base/RaspberryPi/example-FreeRTOS/main.c
+++ b/boards/base/RaspberryPi/FreeRTOS/freertos_main.c
@@ -3,43 +3,23 @@
#include "Drivers/interrupts.h"
-#include "gfx.h"
+extern int main(void);
-static void displayTask(void *pvParameters) {
- coord_t width, height;
- // Get the screen size
- width = gdispGetWidth();
- height = gdispGetHeight();
-
- // Code Here
- gdispDrawBox(10, 10, width/2, height/2, Yellow);
- gdispFillArea(width/2, height/2, width/2-10, height/2-10, Blue);
- gdispDrawLine(5, 30, width-50, height-40, Red);
-
- while(1)
- {
- vTaskDelay(1000);
- }
-
- return;
+static void mainTask(void *pvParameters) {
+ (void) pvParameters;
+ main();
}
/**
* This is the systems main entry, some call it a boot thread.
- *
- * -- Absolutely nothing wrong with this being called main(), just it doesn't have
- * -- the same prototype as you'd see in a linux program.
**/
-int main(void) {
+int FreeRTOS_Main(void) {
DisableInterrupts();
InitInterruptController();
- // Initialize and clear the display
- gfxInit();
-
- xTaskCreate(displayTask,
- (portCHAR *)"Display Task",
+ xTaskCreate(mainTask,
+ (portCHAR *)"Main Task",
128,
NULL,
0,
diff --git a/boards/base/RaspberryPi/example-FreeRTOS/Drivers/gpio.c b/boards/base/RaspberryPi/FreeRTOS/gpio.c
index 485de897..485de897 100644
--- a/boards/base/RaspberryPi/example-FreeRTOS/Drivers/gpio.c
+++ b/boards/base/RaspberryPi/FreeRTOS/gpio.c
diff --git a/boards/base/RaspberryPi/example-FreeRTOS/Drivers/gpio.h b/boards/base/RaspberryPi/FreeRTOS/gpio.h
index fa459707..fa459707 100644
--- a/boards/base/RaspberryPi/example-FreeRTOS/Drivers/gpio.h
+++ b/boards/base/RaspberryPi/FreeRTOS/gpio.h
diff --git a/boards/base/RaspberryPi/example-FreeRTOS/Drivers/interrupts.c b/boards/base/RaspberryPi/FreeRTOS/interrupts.c
index 9908b7c4..9908b7c4 100644
--- a/boards/base/RaspberryPi/example-FreeRTOS/Drivers/interrupts.c
+++ b/boards/base/RaspberryPi/FreeRTOS/interrupts.c
diff --git a/boards/base/RaspberryPi/example-FreeRTOS/Drivers/interrupts.h b/boards/base/RaspberryPi/FreeRTOS/interrupts.h
index d09353a4..d09353a4 100644
--- a/boards/base/RaspberryPi/example-FreeRTOS/Drivers/interrupts.h
+++ b/boards/base/RaspberryPi/FreeRTOS/interrupts.h
diff --git a/boards/base/RaspberryPi/example-FreeRTOS/Drivers/mmio.h b/boards/base/RaspberryPi/FreeRTOS/mmio.h
index 89bea700..89bea700 100644
--- a/boards/base/RaspberryPi/example-FreeRTOS/Drivers/mmio.h
+++ b/boards/base/RaspberryPi/FreeRTOS/mmio.h
diff --git a/boards/base/RaspberryPi/example-FreeRTOS/raspberrypi.ld b/boards/base/RaspberryPi/FreeRTOS/raspberrypi.ld
index ece588b5..ece588b5 100644
--- a/boards/base/RaspberryPi/example-FreeRTOS/raspberrypi.ld
+++ b/boards/base/RaspberryPi/FreeRTOS/raspberrypi.ld
diff --git a/boards/base/RaspberryPi/example-FreeRTOS/startup.s b/boards/base/RaspberryPi/FreeRTOS/startup.s
index 286f396c..d865439f 100644
--- a/boards/base/RaspberryPi/example-FreeRTOS/startup.s
+++ b/boards/base/RaspberryPi/FreeRTOS/startup.s
@@ -4,7 +4,7 @@
.extern vFreeRTOS_ISR
.extern vPortYieldProcessor
.extern DisableInterrupts
-.extern main
+.extern FreeRTOS_Main
.section .init
.globl _start
;;
@@ -79,7 +79,7 @@ zero_loop:
;@ mov sp,#0x1000000
- b main ;@ We're ready?? Lets start main execution!
+ b FreeRTOS_Main ;@ We're ready?? Lets start main execution!
.section .text
undefined_instruction:
diff --git a/boards/base/RaspberryPi/example-FreeRTOS/Drivers/uart.c b/boards/base/RaspberryPi/FreeRTOS/uart.c
index 92f837e7..92f837e7 100644
--- a/boards/base/RaspberryPi/example-FreeRTOS/Drivers/uart.c
+++ b/boards/base/RaspberryPi/FreeRTOS/uart.c
diff --git a/boards/base/RaspberryPi/example-FreeRTOS/Drivers/uart.h b/boards/base/RaspberryPi/FreeRTOS/uart.h
index fe7f64aa..fe7f64aa 100644
--- a/boards/base/RaspberryPi/example-FreeRTOS/Drivers/uart.h
+++ b/boards/base/RaspberryPi/FreeRTOS/uart.h
diff --git a/boards/base/RaspberryPi/example-FreeRTOS/Makefile b/boards/base/RaspberryPi/example-FreeRTOS/Makefile
index c1751204..a8d64ad0 100644
--- a/boards/base/RaspberryPi/example-FreeRTOS/Makefile
+++ b/boards/base/RaspberryPi/example-FreeRTOS/Makefile
@@ -1,73 +1,55 @@
-# build environment
-PREFIX ?= /your compiler path/gcc-arm-none-eabi-4_8-2014q1
-ARCH ?= $(PREFIX)/bin/arm-none-eabi
-
-CC = ${ARCH}-gcc
-CPP = ${ARCH}-g++
-AS = ${ARCH}-as
-LD = ${ARCH}-ld
-AR = ${ARCH}-ar
-OBJCOPY = ${ARCH}-objcopy
-
-PLATFORM = raspi
-LINKER_SCRIPT = raspberrypi.ld
-
-CFLAGS = -march=armv6z -g -Wall -Wextra
-ASFLAGS = -g
-
-CFLAGS_FOR_TARGET = #-mcpu=arm1176jzf-s
-ASFLAGS_FOR_TARGET = #-mcpu=arm1176jzf-s
-LDFLAGS = #--error-unresolved-symbols
-
-GFXLIB := ../uGFX
-include $(GFXLIB)/gfx.mk
-include $(GFXLIB)/drivers/gdisp/framebuffer/driver.mk
-
-OSLIB := ../FreeRTOS
-MODULES := $(OSLIB)/Source/portable/GCC/RaspberryPi
-MODULES += $(OSLIB)/Source/portable/MemMang
-MODULES += $(OSLIB)/Source
-MODULES += Drivers
-
-SRC_DIR := $(MODULES)
-INC_DIR := $(addsuffix /include,$(SRC_DIR))
-BUILD_DIR := $(addsuffix /build,$(SRC_DIR))
-
-INCLUDEDIRS := $(OSLIB)/Source/portable/GCC/RaspberryPi
-INCLUDEDIRS += $(OSLIB)/Source/include
-INCLUDEDIRS += Drivers
-INCLUDEDIRS += $(GFXINC)
-
-INCLUDES := $(addprefix -I,$(INCLUDEDIRS))
-
-ASRC := $(foreach sdir,$(SRC_DIR),$(wildcard $(sdir)/*.s))
-AOBJ := $(ASRC:.s=.o)
-CSRC := $(foreach sdir,$(SRC_DIR),$(wildcard $(sdir)/*.c))
-CSRC += $(GFXSRC)
-COBJ := $(CSRC:.c=.o)
-
-vpath %.c $(SRC_DIR)
-vpath %.cpp $(SRC_DIR)
-vpath %.s $(SRC_DIR)
-
-%.o: %.c
- $(CC) $(CFLAGS_FOR_TARGET) $(INCLUDES) $(CFLAGS) -c -o $*.o $<
-
-%.o: %.s
- $(AS) $(ASFLAGS_FOR_TARGET) $(INCLUDES) $(ASFLAGS) -o $*.o $<
-
-OBJ = $(AOBJ) $(COBJ)
-
-bin/kernel.img: bin/kernel.elf
- ${OBJCOPY} -O binary $< $@
-
-bin/kernel.elf: LDFLAGS += -L "$(PREFIX)/lib/gcc/arm-none-eabi/4.8.3" -lgcc
-bin/kernel.elf: LDFLAGS += -L "$(PREFIX)/arm-none-eabi/lib" -lc
-bin/kernel.elf: $(OBJ)
- ${LD} $(OBJ) -Map bin/kernel.map -o $@ -T $(LINKER_SCRIPT) ${LDFLAGS}
-
-clean:
- rm -f bin/*.elf bin/*.img bin/*.map $(OBJ)
-
-
-
+# Possible Targets: all clean Debug cleanDebug Release cleanRelease
+
+##############################################################################################
+# Settings
+#
+
+# General settings
+ # See $(GFXLIB)/tools/gmake_scripts/readme.txt for the list of variables
+ OPT_OS = freertos
+ OPT_THUMB = yes
+ OPT_LINK_OPTIMIZE = yes
+ # For the raspberry pi we can either use the generic armv6 cpu or the highly optimized raspberrypi settings
+ OPT_CPU = raspberrypi
+
+# uGFX settings
+ # See $(GFXLIB)/tools/gmake_scripts/library_ugfx.mk for the list of variables
+ GFXLIB = ../uGFX
+ GFXBOARD = RaspberryPi
+ GFXDEMO = modules/gdisp/basics
+
+# FreeRTOS settings
+ifeq ($(OPT_OS),freertos)
+ # See $(GFXLIB)/tools/gmake_scripts/os_freertos.mk for the list of variables
+ FREERTOS = ../FreeRTOS
+ FREERTOS_BOARD = RaspberryPi
+ FREERTOS_MODULES = $(GFXLIB)/boards/base/RaspberryPi/FreeRTOS
+ FREERTOS_LDSCRIPT = $(GFXLIB)/boards/base/RaspberryPi/FreeRTOS/raspberrypi.ld
+endif
+
+##############################################################################################
+# Set these for your project
+#
+
+ARCH = arm-none-eabi-
+SRCFLAGS = -ggdb -O0
+CFLAGS =
+CXXFLAGS = -fno-rtti
+ASFLAGS =
+LDFLAGS =
+
+SRC =
+OBJS =
+DEFS =
+LIBS =
+INCPATH =
+LIBPATH =
+
+##############################################################################################
+# These should be at the end
+#
+
+include $(GFXLIB)/tools/gmake_scripts/library_ugfx.mk
+include $(GFXLIB)/tools/gmake_scripts/os_$(OPT_OS).mk
+include $(GFXLIB)/tools/gmake_scripts/compiler_gcc.mk
+# *** EOF ***
diff --git a/tools/gmake_scripts/cpu_armv6.mk b/tools/gmake_scripts/cpu_armv6.mk
new file mode 100644
index 00000000..0fa5867e
--- /dev/null
+++ b/tools/gmake_scripts/cpu_armv6.mk
@@ -0,0 +1,18 @@
+#
+# This file is subject to the terms of the GFX License. If a copy of
+# the license was not distributed with this file, you can obtain one at:
+#
+# http://ugfx.org/license.html
+#
+
+#
+# See readme.txt for the make API
+#
+
+# Requirements:
+#
+# NONE
+#
+
+SRCFLAGS += -march=armv6 -mfpu=vfp -mfloat-abi=hard
+LDFLAGS += -march=armv6 -mfpu=vfp -mfloat-abi=hard
diff --git a/tools/gmake_scripts/cpu_raspberrypi.mk b/tools/gmake_scripts/cpu_raspberrypi.mk
new file mode 100644
index 00000000..b31c35e9
--- /dev/null
+++ b/tools/gmake_scripts/cpu_raspberrypi.mk
@@ -0,0 +1,18 @@
+#
+# This file is subject to the terms of the GFX License. If a copy of
+# the license was not distributed with this file, you can obtain one at:
+#
+# http://ugfx.org/license.html
+#
+
+#
+# See readme.txt for the make API
+#
+
+# Requirements:
+#
+# NONE
+#
+
+SRCFLAGS += -march=armv6zk -mcpu=arm1176jzf-s -mtune=arm1176jzf-s -mfpu=vfp -mfloat-abi=hard
+LDFLAGS += -march=armv6zk -mcpu=arm1176jzf-s -mtune=arm1176jzf-s -mfpu=vfp -mfloat-abi=hard
diff --git a/tools/gmake_scripts/os_freertos.mk b/tools/gmake_scripts/os_freertos.mk
new file mode 100644
index 00000000..5cbd5be0
--- /dev/null
+++ b/tools/gmake_scripts/os_freertos.mk
@@ -0,0 +1,36 @@
+#
+# This file is subject to the terms of the GFX License. If a copy of
+# the license was not distributed with this file, you can obtain one at:
+#
+# http://ugfx.org/license.html
+#
+
+# See readme.txt for the make API
+
+# Requirements:
+#
+# FREERTOS: The location of the FreeRTOS code eg FREERTOS=../FreeRTOS
+# FREERTOS_BOARD The board name eg FREERTOS_BOARD=RaspberryPi
+#
+
+# Optional:
+#
+# FREERTOS_MODULES A list of directories containing FreeRTOS source (eg drivers, startup etc) - default is ""
+# FREERTOS_LDSCRIPT The loader script - default is ""
+#
+
+PATHLIST += FREERTOS
+
+FREERTOS_MODULES += $(FREERTOS)/Source/portable/GCC/$(FREERTOS_BOARD)
+FREERTOS_MODULES += $(FREERTOS)/Source/portable/MemMang
+FREERTOS_MODULES += $(FREERTOS)/Source
+
+INCPATH += $(FREERTOS)/Source/portable/GCC/$(FREERTOS_BOARD) \
+ $(FREERTOS)/Source/include
+
+SRC += $(foreach sdir,$(FREERTOS_MODULES),$(wildcard $(sdir)/*.s))
+SRC += $(foreach sdir,$(FREERTOS_MODULES),$(wildcard $(sdir)/*.c))
+
+ifeq ($(LDSCRIPT),)
+ LDSCRIPT= $(FREERTOS_LDSCRIPT)
+endif
diff --git a/tools/gmake_scripts/readme.txt b/tools/gmake_scripts/readme.txt
index eec7dd95..67206ed9 100644
--- a/tools/gmake_scripts/readme.txt
+++ b/tools/gmake_scripts/readme.txt
@@ -16,7 +16,7 @@ OPT_COPY_EXE=no|yes - Copy the final program to the local project directory -
OPT_NONSTANDARD_FLAGS=no - Turn off adding the standard compiler language flags - default no
OPT_LINK_OPTIMIZE=no - Remove unused code/data during link - default no
OPT_OS=win32|win32.chibios|linux|osx|chibios|freertos|ecos|raw32|rawrtos - Mandatory: The operating system
-OPT_CPU=x86|x64|stm32m4|at91sam7 - Add some cpu dependant flags
+OPT_CPU=x86|x64|stm32m4|at91sam7|armv6|raspberrypi - Add some cpu dependant flags
BUILDDIR - Build Directory - default is ".build" or "bin/Debug" or "bin/Release" depending on the target
PROJECT - Project Name - default is the name of the project directory