Hi all,
This is my first post on the PX4 forum - I’ve become a big fan of the PX4 Flight Controller and I am excited to be developing on it!
Background:
The problem I am having currently is adding custom and/or stock NuttX apps to a PX4 configuration. Here is the background on why I am not building the application using the standard method found in the Hello Sky tutorial:
- The application I am developing will also be running on a standalone microcontroller running NuttX (not a px4 platform), I’d like to keep both the PX4 app and standalone NuttX app identical.
- I need to add additional NuttX support (like networking) to PX4 platform that my application is dependent upon
- I’d like to avoid porting my drivers that are already built for NuttX to the PX4 DriverFramework (probably unnecessary extra work).
It’s also worth mentioning that I have a fair amount of experience (I wouldn’t consider myself an expert) working with NuttX in isolation.
Where I am Now:
When modifying a NuttX configuration, it is necessary to modify the .config file (or defconfig in the board configuration) file in order to add applications to the NuttX configuration. The problem that I’ve run up against is that I am unable to modify the NuttX configuration for any nuttx-config (I’ve tried both px4fmu-v2 and crazyflie configs) without the following compiler error:
[ 11%] Building NuttX for crazyflie with nsh
make[4]: warning: jobserver unavailable: using -j1. Add '+' to parent make rule.
make[4]: *** [arch/arm/src/board] Error 1
CMakeFiles/nuttx_export_crazyflie.dir/build.make:60: recipe for target 'crazyflie/NuttX/nuttx/nuttx-export/include/nuttx/config.h' failed
make[3]: *** [crazyflie/NuttX/nuttx/nuttx-export/include/nuttx/config.h] Error 2
CMakeFiles/Makefile2:835: recipe for target 'CMakeFiles/nuttx_export_crazyflie.dir/all' failed
make[2]: *** [CMakeFiles/nuttx_export_crazyflie.dir/all] Error 2
Makefile:160: recipe for target 'all' failed
make[1]: *** [all] Error 2
Makefile:148: recipe for target 'crazyflie_default' failed
make: *** [crazyflie_default] Error 2
The error above was generated by simply adding the example/hello application to the crazyflie configuration (defconfig
) in the Firmware/nuttx-configs/crazyflie/nsh
folder:
CONFIG_EXAMPLES_HELLO=y
CONFIG_EXAMPLES_HELLO_PRIORITY=100
CONFIG_EXAMPLES_HELLO_STACKSIZE=2048
The compiler error has to do with crazyflie/NuttX/nuttx/nuttx-export/
which appears to be removed by `CMakeFiles/nuttx_export_crazyflie.dir/build.make’
Help Needed
- I don’t understand why modifying the NuttX configuration file causes this compiler error. I’d love to better understand how PX4 copies and compiles NuttX
- Any insight on the correct way modify NuttX configuration files and compile for px4fmu targets is greatly appreciated. I’d be willing to author a brief tutorial/best practices for the community on how to modify NuttX if you help me understand the the process.
Thank you,
Tony