Freedom Studio Demo Add Files?

(Brandon Butler) #1

I am attempting to create a RV64 port of FreeRTOS. I have created a new project in Freedom Studio using the Freedom E SDk Wizard. I chose qemu-sifive-u54 as my target.

I can see that there is a src folder with a make file. My question is how can I add subdirectories with more .h/.c files and have the build system pick them up?

For example, FreeRTOS has an include folder with all of its headers. How can I properly add that to the project?

(David Connelly) #2

You should be able to modify the Makefile in the /src directory to add paths, which uses the wildcard option to pick up files.

(Brandon Butler) #3

I’ve tried that. If I do that, it complains that it can’t find the FreeRTOS.h file.

Here’s my make file in the src directory.

# Copyright 2019 SiFive, Inc #
# SPDX-License-Identifier: Apache-2.0 #

PROGRAM ?= main
SRC_DIR = $(abspath .)

$(SRC_DIR)/freertos_source $(SRC_DIR)/freertos_source/include \
$(SRC_DIR) \
$(SRC_DIR)/freertos_source/portable/GCC/RISC-V \
$(SRC_DIR)/freertos_source/portable/GCC/RISC-V/chip_specific_extensions/RV32I_CLINT_no_extensions \
$(SRC_DIR)/freertos_source/portable/MemMang \


PROGRAM_SRCS = $(foreach dir, $(PROGRAM_SRC_DIRS), $(wildcard $(dir)/*.c)) $(foreach dir, $(PROGRAM_SRC_DIRS), $(wildcard $(dir)/*.h)) $(foreach dir, $(PROGRAM_SRC_DIRS), $(wildcard $(dir)/*.S))



	rm -f $(PROGRAM) $(PROGRAM).hex

I seem to get errors indicating it can’t find the header files.

/Users/brandonbutler/Code/wsFreedomStudio/qemu-sifive-u54-hello/src/freertos_source/portable/GCC/RISC-V/portASM.S:70:10: fatal error: freertos_risc_v_chip_specific_extensions.h: No such file or directory
 #include "freertos_risc_v_chip_specific_extensions.h"

(Brandon Butler) #4

I’m at a loss here. How can I include the header files in the src/makefile?


Hi, I have create a tutorial video HiFive1 Rev B01 Import FreeRTOS demo into Freedom Studio
Maybe it is useful