This commit is contained in:
sdes1
2025-10-20 17:39:01 +02:00
parent 0424d69bcd
commit 1353e12dd7
4 changed files with 50 additions and 35 deletions

View File

@@ -25,11 +25,12 @@ OUT_DIR = ./out
TARGET := $(APP)_$(ARCH)_core$(CORE)
TARGET_DIR := $(SRC_DIR)/APP/$(APP)/$(ARCH)/core$(CORE)/
$(info TARGET_DIR : ${TARGET_DIR})
OBJ_DIR = ./$(OUT_DIR)/$(TARGET)
# Load specific config for compiler, linker, ...
-include $(TARGET_DIR)/build/config.mk
include $(TARGET_DIR)/build/config.mk
#Output files: elf, map and list-file
EXECUTABLE=$(OBJ_DIR)/../$(TARGET).elf
@@ -42,16 +43,18 @@ LDSCRIPT = -T$(TARGET_DIR)/linker/lscript.ld
endif
#Include source-files:
SRC =
-include $(TARGET_DIR)/build/Sources.mk
$(info TARGET_DIR : ${TARGET_DIR})
INC = -I.
include $(TARGET_DIR)/build/includes.mk
SRC =
include $(TARGET_DIR)/build/sources.mk
INC = -I./
-include $(TARGET_DIR)/build/includes.mk
# C source files
CFILES = $(filter %.c, $(SRC))
# Assembly source files
ASMFILES = $(filter %.s, $(SRC))
ASMFILES = $(filter %.S, $(SRC))
# Object files
COBJ = $(CFILES:$(SRC_DIR)/%.c=$(OBJ_DIR)/%.o)
SOBJ = $(ASMFILES:$(SRC_DIR)/%.S=$(OBJ_DIR)/%.o)

View File

@@ -27,6 +27,8 @@ INC += -I"$(SRC_DIR)/ucos_v1_42/ucos/components/ucos_standalone/src/common"
INC += -I"$(SRC_DIR)/Xilinx/libsrc/ipipsu_v2_3/src/"
INC += -I"$(SRC_DIR)/Modules/MMU"
INC += -I"$(SRC_DIR)/Xilinx/include/"
INC += -I"$(SRC_DIR)/Xilinx/libsrc/ipipsu_v2_3/src/"

View File

@@ -5,7 +5,7 @@ SRC += $(SRC_DIR)/ucos_v1_42/ucos/bsp/src/$(ARCH)/asm_vectors.S
-include $(SRC_DIR)/ucos_v1_42/micrium_source/uC-LIB/subdir.mk
SRC += $(SRC_DIR)/ucos_v1_42/ucos/components/ucos_osii/bsp/$(ARCH)/ucos_osii_bsp.c
SRC += $(SRC_DIR)/ucos_v1_42/ucos/components/ucos_osii/src/bsp/$(ARCH)/ucos_osii_bsp.c
SRC += $(SRC_DIR)/ucos_v1_42/ucos/components/ucos_common/src/$(ARCH)/cpu_bsp.c
SRC += $(SRC_DIR)/Modules/MMU/mmu.c

View File

@@ -16,68 +16,78 @@
#include "xil_testmem.h"
#include "xil_printf.h"
#define HELLO_WORLD_TASK_PRIO 64
#define CALC_TASK_PRIO 64
#define HELLO_WORLD_TASK_PRIO 30
#define CALC_TASK_PRIO 31
#define HELLO_WORLD_TASK_STK_SIZE 16
#define CALC_TASK_STK_SIZE 32
#define HELLO_WORLD_TASK_STK_SIZE 16000
#define CALC_TASK_STK_SIZE 32000
static OS_STK HelloWorldTaskStk[HELLO_WORLD_TASK_STK_SIZE];
static OS_STK CalcTaskStk[HELLO_WORLD_TASK_STK_SIZE];
int f(int n)
int f(uint8_t n)
{
if (n == 1)
if (n <= 1)
return n;
else
return (f(n-1) + f(n-3));
return (f(n-1) + f(n-2));
}
void HelloWorldTask (void *pdata)
{
while(1){
UCOS_Printf("Hello World!");
UCOS_Printf("Hello World!\n");
OSTimeDly(OS_TICKS_PER_SEC*50);
}
}
void CalcTask (void *pdata)
{
uint8_t n=50;
for (uint8_t i = 1; i <= n; i)
{
UCOS_Printf("%u", f(i));
}
while(1){
uint8_t n=50;
for (uint8_t i = 1; i <= n; i++)
{
UCOS_Printf("%d", f(i));
OSTimeDly(OS_TICKS_PER_SEC*1);
}
}
}
void InitDoneCallback(void * p_arg){
(void) p_arg;
UCOS_Print("OS started!\r\n");
OSTaskCreateExt(HelloWorldTask,
0,
&HelloWorldTaskStk[0],
HELLO_WORLD_TASK_PRIO,
&HelloWorldTaskStk[0],
0,
0);
0,
&HelloWorldTaskStk[HELLO_WORLD_TASK_STK_SIZE-1],
HELLO_WORLD_TASK_PRIO,
HELLO_WORLD_TASK_PRIO,
&HelloWorldTaskStk[0],
HELLO_WORLD_TASK_STK_SIZE,
0,
0);
OSTaskCreateExt(CalcTask,
0,
CALC_TASK_PRIO,
CALC_TASK_PRIO,
&CalcTaskStk[0],
CALC_TASK_STK_SIZE,
0
);
0,
&CalcTaskStk[CALC_TASK_STK_SIZE-1],
CALC_TASK_PRIO,
CALC_TASK_PRIO,
&CalcTaskStk[0],
CALC_TASK_STK_SIZE,
0,
0
);
while(1){
OSTimeDly();
OSTimeDly(1);
}
}
int main(void) {
MMUInit();
UCOSStartup(InitDoneCallback);
while (1);;
}