This shows you the differences between two versions of the page.
Next revision | Previous revision Last revision Both sides next revision | ||
projects:crazyflie2:development:openocd_gdb_debugging [2019-06-26 15:33] kimberly created |
projects:crazyflie2:development:openocd_gdb_debugging [2019-09-05 15:21] kimberly |
||
---|---|---|---|
Line 1: | Line 1: | ||
+ | <WRAP center round important 60%> | ||
+ | This page is deprecated and is moved to the main Bitcraze website. Please go to: | ||
+ | |||
+ | [[ | ||
+ | https:// | ||
+ | ]] | ||
+ | |||
+ | </ | ||
+ | |||
+ | |||
+ | |||
====== On-chip debugging ====== | ====== On-chip debugging ====== | ||
- | One of the key components of getting really serious about developing on the crazyflie, is time to dive into the C-based firmware. If you really want to do some major changes to the intrinsic of the code, it is essential to have proper tools to be able to debug the code (place breakpoints, | + | One of the key components of getting really serious about developing on the crazyflie, is to dive into the C-based firmware. If you really want to do some major changes to the intrinsic of the code, it is essential to have proper tools to be able to debug the code (place breakpoints, |
<WRAP center round info 60%> | <WRAP center round info 60%> | ||
Line 14: | Line 25: | ||
* Ubuntu 18.04.2 LTS (64 bit) | * Ubuntu 18.04.2 LTS (64 bit) | ||
* Eclipse 2019-03 (Eclipse IDE for C/C++ Developers) | * Eclipse 2019-03 (Eclipse IDE for C/C++ Developers) | ||
+ | * Debug Adapter | ||
+ | * ST Link V2 Debugger | ||
</ | </ | ||
Line 35: | Line 47: | ||
Then install eclipse itself: | Then install eclipse itself: | ||
- | Go to their download page: [[https:// | + | Go to their download page: [[https:// |
- | + | ||
- | and then go into you download folder | + | |
< | < | ||
- | tar -zxvf eclipse-cpp-2019-03-R-linux-gtk-x86_64.tar.gz | + | tar -zxvf "your-downloaded-file".tar.gz |
</ | </ | ||
and start up eclipse: | and start up eclipse: | ||
< | < | ||
- | cd EXTRACT FOLDER/ | + | "YOUR-UNZIPPED-FOLDER" |
- | ./eclipse | + | |
</ | </ | ||
+ | === Installing required Eclipse Plugins === | ||
+ | |||
+ | Install the C++ development tools and GNU MCU plugin by following the instructions [[https:// | ||
+ | * C++ Development - Follow the instructions under the header ' | ||
+ | * GNU MCU plugin | ||
+ | |||
+ | |||
+ | === Import Crazyflie Firmware === | ||
+ | |||
+ | |||
+ | First import the [[https:// | ||
+ | |||
+ | *File > import... | ||
+ | *C/C++ > Existing Code as Makefile Project -> Next | ||
+ | *Give it a name | ||
+ | *Existing Code Location > Browse... > //Look for the firmware folder// | ||
+ | *// | ||
+ | *Finish | ||
+ | |||
+ | |||
+ | === Setting up Eclipse Debugging environment === | ||
+ | |||
+ | * Go to: Run > Debug Configurations... | ||
+ | * Double click 'GDB OpenOCD Debugging' | ||
+ | |||
+ | Now input the following settings in the debug configurations: | ||
+ | |||
+ | == Main == | ||
+ | |||
+ | |||
+ | {{: | ||
+ | |||
+ | Insert the filepath to the cf2.elf file to //C/C++ Application// | ||
+ | |||
+ | |||
+ | |||
+ | == Debugger == | ||
+ | |||
+ | {{: | ||
+ | |||
+ | check the following settings: | ||
+ | OpenOCD setup -> Config options: < | ||
+ | GDB Client Setup: | ||
+ | * Executable name: Filepath to gdb toolchain | ||
+ | * Commands: < | ||
+ | |||
+ | == Startup == | ||
+ | |||
+ | {{: | ||
+ | |||
+ | == Hit Debug! == | ||
+ | |||
+ | If you don't see any errors, eclipse should go to an dedicated debugging environment automatically and it automatically halts the crazyflie' | ||
+ | |||
+ | |||
+ | <WRAP center round important 60%> | ||
+ | Make sure that your cf2.elf is the same as the one you uploaded to the crazyflie. | ||
+ | </ | ||
+ | |||
+ | ==== Mac OS ==== | ||
+ | |||
+ | Install gdb and openocd | ||
+ | |||
+ | < | ||
+ | brew install gdb | ||
+ | brew install open-ocd | ||
+ | </ | ||
+ | |||
+ | Install java JDK [[https:// | ||
+ | |||
+ | Download eclipse [[https:// | ||
+ | |||
+ | Choose destination folders - Install | ||
+ | |||
+ | Run eclipse and choose work folder | ||
+ | == Installing required eclipse Plugins == | ||
+ | The rest is the same as for Linux. | ||
+ | Make sure that the arm-none-eabi-gcc is properly installed and its path is configured in the //debug configurations// |