This shows you the differences between two versions of the page.
Next revision | Previous revision | ||
doc:crazyflie:api:firmware:deck:howto [2015-12-09 15:13] arnaud created |
doc:crazyflie:api:firmware:deck:howto [2020-05-12 14:24] (current) kimberly |
||
---|---|---|---|
Line 1: | Line 1: | ||
+ | <WRAP center round important 60%> | ||
+ | This page has deprecated and moved to the new documentation framework of the main Bitcraze website. Please go to [[https:// | ||
+ | </ | ||
+ | |||
+ | |||
+ | |||
====== Making your first Deck driver ====== | ====== Making your first Deck driver ====== | ||
This howto is going to describe step-by-step how to make and flash your first | This howto is going to describe step-by-step how to make and flash your first | ||
- | Crazyflie 2.0 deck driver. | + | Crazyflie 2.X deck driver. See the deck [[doc: |
===== Development environment ===== | ===== Development environment ===== | ||
You should have the [[https:// | You should have the [[https:// | ||
+ | |||
+ | The Crazyflie firmware should be on Master branch. | ||
For the rest of the howto you will work in the crazyflie-firmware project. | For the rest of the howto you will work in the crazyflie-firmware project. | ||
Line 41: | Line 49: | ||
</ | </ | ||
+ | ===== Adding the driver to the build ===== | ||
+ | |||
+ | Add this to the Makefile, after the line '# Decks': | ||
+ | |||
+ | <code make> | ||
+ | PROJ_OBJ += hello.o | ||
+ | </ | ||
+ | |||
+ | ===== Enabling the driver ===== | ||
+ | |||
+ | Decks can have a memory that contains its name. In our case the hello driver would be initialised only when a deck identified as " | ||
+ | |||
+ | <code make config.mk> | ||
+ | CFLAGS += -DDECK_FORCE=myHello | ||
+ | |||
+ | DEBUG=1 | ||
+ | </ | ||
+ | |||
+ | DEBUG=1 allows to get more information from the Crazyflie console when it starts. Debug should not be enabled if you intend to fly the Crazyflie out of the lab (it disables the watchdog). | ||
+ | |||
+ | <WRAP center round info> | ||
+ | // | ||
+ | </ | ||
+ | |||
+ | |||
+ | ===== Compile, flash and run! ===== | ||
+ | |||
+ | Now the last step is to compile and flash your new firmware. Launch the following commands in a shell: | ||
+ | |||
+ | <code bash> | ||
+ | crazyflie-firmware$ make | ||
+ | crazyflie-firmware$ make cload | ||
+ | </ | ||
+ | |||
+ | The output will be similar to the following: | ||
+ | |||
+ | <code bash> | ||
+ | crazyflie-firmware$ make | ||
+ | (...) | ||
+ | CC hello.o | ||
+ | (...) | ||
+ | Crazyflie 2.0 build! | ||
+ | Build 44: | ||
+ | Version extracted from git | ||
+ | Crazyloader build! | ||
+ | | ||
+ | | ||
+ | rm version.c | ||
+ | crazyflie-firmware$ make cload | ||
+ | ../ | ||
+ | Restart the Crazyflie you want to bootload in the next | ||
+ | 10 seconds ... | ||
+ | done! | ||
+ | Connected to bootloader on Crazyflie 2.0 (version=0x10) | ||
+ | Target info: nrf51 (0xFE) | ||
+ | Flash pages: 232 | Page size: 1024 | Buffer pages: 1 | Start page: 88 | ||
+ | 144 KBytes of flash available for firmware image. | ||
+ | Target info: stm32 (0xFF) | ||
+ | Flash pages: 1024 | Page size: 1024 | Buffer pages: 10 | Start page: 16 | ||
+ | 1008 KBytes of flash available for firmware image. | ||
+ | |||
+ | Flashing 1 of 1 to stm32 (fw): 161867 bytes (159 pages) ..........10..........10..........10..........10..........10..........10..........10..........10..........10..........10..........10..........10..........10..........10..........10.........9 | ||
+ | Reset in firmware mode ... | ||
+ | $ | ||
+ | </ | ||
+ | |||
+ | Now you can connect your Crazyflie with the client and see your driver in the console! | ||
+ | |||
+ | {{ : | ||