This is an old revision of the document!
# Building from source
## Requirements
* Usual compilation toolchain, arm-none-eabi * genromfs * python-empy python-pip * sudo pip install caktin_pkg
If you want to edit a board config, you also need kconfig-frontends (provided by PX4/NuttX, use the setenv tool )
## Build
* `make help`
Useful to know the available targets
* `make BOARDS=yourtarget menuconfig`
Requires kconfig-mconf, but useful to config NuttX
* `make BOARDS=yourtarget archives`
Build the NuttX OS archive for _yourtarget_
* `make BOARDS=yourtarget yourtarget_default`
Build PX4 for _yourtarget_
* `make BOARDS=yourtarget yourtarget_default upload`
Build PX4 and upload using PX4 Bootloader (USB)
### Combo
make BOARDS=yourtarget archives yourtarget_default upload
If you make any change in the NuttX/, you need to delete everything and start over…
rm -R Archives/ Build/ make BOARDS=yourtarget archives yourtarget_default upload
## Flash
### DFU
* https://pixhawk.org/dev/bootloader_update#updating_the_onboard_bootloader
### PX4 Bootloader
* https://pixhawk.org/dev/nuttx/building_and_flashing_console
## Debug
openocd -f interface/stlink-v2.cfg -f target/stm32f4x_stlink.cfg
In GDB:
tar ext :3333 # 'n debug...