It is possible to have an out-of-tree build of parts of the crazyflie firmware. This enables developers to work on elements without worrying about merging it with the full code base.
General out-of-tree build process
In a separate folder create a Makefile which contain the following content:
CRAZYFLIE_BASE := [LOCATION OF THE CRAZYFLIE FIRMWARE] # # We override the default OOT_CONFIG here, we could also name our config # to oot-config and that would be the default. # OOT_CONFIG := $(PWD)/config include $(CRAZYFLIE_BASE)/tools/make/oot.mk
This will make the crazyflie-firmware build system look for a
Kbuild file in your folder.
The following variables are understood by
||Specify where your code (
||Location of your OOT specific
||Extra CFLAGS needed by your app||Empty.|
oot.mk also expects
$(CRAZYFLIE_BASE) to be set to the path to the
Kbuild file in the
$(OOT) folder should point out your source files:
obj-y += your_estimator_out_of_tree.o
It can also point out another folder where the code resides:
obj-y += src/
If you have header files in another folder, use
EXTRA_CFLAGS in the Makefile to let the compiler know where to find them:
EXTRA_CFLAGS += -I$(PWD)/src/inc
And since you are providing a config file by way of
$(OOT_CONFIG) you do not need to run any make command to create a config like
make menuconfig or
make defconfig. Just a simple
make will suffice.
config file needs to enable ESTIMATOR_OOT, and can also set other config options:
in [your_estimator_out_of_tree].c in the src folder you will just need to make sure that the following functions are filled:
init = estimatorOutOfTreeInit
test = estimatorOutOfTreeTest
update = estimatorOutOfTree
name = "OOT
Not yet implemented. Please request this feature in the crazyflie-firmware issue list
Technically the app layer is an example of an out of tree build. Follow the app layer instructions for this.