Moving/renaming code #289
-
Hello. I got the "Hello World" example to work. Next, because I want the Bitcraze tutorials to remain untouched, I copied "Hello World" to a new folder, and renamed it. More specifically, on the Desktop I created a new folder "Personal_Projects" and I copied all of the files from "..Crazyflie-firmware/examples/app_hello_world" to it, and then I renamed the "app_hello_world" folder to "Measure_Voltage". But now when I try to run the Measure_Voltage project (which is just Hello World), it doesn't work. I know this because I changed the "Hello World" string slightly, but the Console is still showing the original "Hello World". When I make the Measure_Voltage project, I don't see any obvious errors. But perhaps I'm not looking closely enough. Is there something about moving a project that breaks it? Please advise. Thanks! |
Beta Was this translation helpful? Give feedback.
Replies: 3 comments 4 replies
-
Hi! There is nothing special with moving a project and it should be fine to move it outside the Crazyflie firmware file tree. I did a test locally and this is what I did:
You might want to be careful with paths that contains spaces. It can probably be handled but I find that it is easier to avoid. I think your problems will be solved by step 2. It seems as |
Beta Was this translation helpful? Give feedback.
-
Yes, CRAZYFLIE_BASE should point at the directory with the Crazyflie-firmware source code. When you build an app you actually build the full firmware + your app code, and the resulting binary is what you flash to the Crazyflie. This is why we need a link to the full firmware source code. Unfortunately your make output file seems to be empty. There is also some documentation for out of tree builds that might give some insights? |
Beta Was this translation helpful? Give feedback.
-
Success! Yes, I realized there are two Kbuild files. I had changed both to contain Measure_Voltage.o, but one of them needs to retain src/. |
Beta Was this translation helpful? Give feedback.
Hi!
There is nothing special with moving a project and it should be fine to move it outside the Crazyflie firmware file tree.
I did a test locally and this is what I did:
examples/app_hello_world
to/home/kristoffer/code/temp/Measure_Voltage
2.1 Remove the
build
directory2.2 Remove all
.o
and.o.cmd
files3.1
src/hello_world.c
==>src/measure_voltage.c
3.2 Updated the
DEBUG_PRINT()
to print something else than "hello world"4.1 Update
src/Kbuild
toobj-y += measure_voltage.o
4.2 Update
CRAZYFLIE_BASE
inMakefile
to point at your crazyflie firmware repo (CRAZYFLIE_BASE := /home/kristoffer/code/bitcraze/crazyflie-firmware
in…