Freedom Studio Demo Add Files?

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?

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

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 .)

PROGRAM_SRC_DIRS = \
$(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 \
$(SRC_DIR)/blinky_demo

#$(error PROGRAM_SRC_DIRS is $(PROGRAM_SRC_DIRS))


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))

#$(error PROGRAM_SRCS is $(PROGRAM_SRCS))

$(PROGRAM): $(PROGRAM_SRCS)

clean:
	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"

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

To add paths within a Freedom Studio project try this in src/Makefile:

PROGRAM ?= hello
$(PROGRAM): $(shell find . -name "*.c") $(shell find . -name "*.h") $(shell find . -name "*.S")
clean:
rm -f $(PROGRAM) $(PROGRAM).hex

Hi, I also encountered the same problem, I don’t know how to add a multi-directory folder in Freedom E SDK and include the .c .h files in Freedom E SDK. Has your issue been resolved?