User Tools

Site Tools


projects:crazyflie2:development:openocd_gdb_debugging

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
projects:crazyflie2:development:openocd_gdb_debugging [2019-06-26 16:20]
kimberly
projects:crazyflie2:development:openocd_gdb_debugging [2020-05-12 14:26] (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://www.bitcraze.io/documentation/system/]]
 +</WRAP>
 +
 +
 +
 ====== 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, read real-time values ect...). On this page, we will put a few examples how to do this with IDE's and different environments.+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, read real-time values ect...). On this page, we will put a few examples how to do this with IDE's and different environments.
  
 <WRAP center round info 60%> <WRAP center round info 60%>
Line 36: Line 42:
  
 Then install eclipse itself: Then install eclipse itself:
-Go to their download page: [[https://www.eclipse.org/downloads/download.php?file=/technology/epp/downloads/release/2019-03/R/eclipse-cpp-2019-03-R-linux-gtk-x86_64.tar.gz|eclipse 20]] +Go to their download page: [[https://www.eclipse.org/downloads/download.php?file=/technology/epp/downloads/release/2019-03/R/eclipse-cpp-2019-03-R-linux-gtk-x86_64.tar.gz|eclipse 20]] and then go into you download folder and unzip the file.
- +
-and then go into you download folder in the terminal en type+
 <code> <code>
-tar -zxvf eclipse-cpp-2019-03-R-linux-gtk-x86_64.tar.gz+tar -zxvf "your-downloaded-file".tar.gz
 </code> </code>
 and start up eclipse: and start up eclipse:
 <code> <code>
-cd EXTRACT FOLDER/eclipse/cpp-2019-03/eclipse/ +"YOUR-UNZIPPED-FOLDER"/.eclipse
-./eclipse+
 </code> </code>
  
 === Installing required Eclipse Plugins === === Installing required Eclipse Plugins ===
  
-Install the c++ development tools and GNU MCU plugin by following the instructions on this [[https://gnu-mcu-eclipse.github.io/plugins/install/|website]]. We used the following instructions to set it up ourselves: +Install the C++ development tools and GNU MCU plugin by following the instructions [[https://gnu-mcu-eclipse.github.io/plugins/install/|here]]. 
-  * C++ development tools: Go to header 'CDT' +  * C++ Development - Follow the instructions under the header 'CDT'. 
-  * GNU MCU plugin: Go to header 'Plug-ins install/update' and 'The Eclipse Marketplace way'+  * GNU MCU plugin  - Follow the instructions under the header 'Plug-ins install/update -> The Eclipse Marketplace way' 
  
 === Import Crazyflie Firmware === === Import Crazyflie Firmware ===
Line 59: Line 63:
 First import the [[https://github.com/bitcraze/crazyflie-firmware|crazyflie-firmware]] into eclipse: First import the [[https://github.com/bitcraze/crazyflie-firmware|crazyflie-firmware]] into eclipse:
  
-  *File>import... +  *File > import... 
-  *C/C++ > Existing Code as Makefile Project+  *C/C++ > Existing Code as Makefile Project -> Next 
 +  *Give it a name
   *Existing Code Location > Browse... > //Look for the firmware folder//   *Existing Code Location > Browse... > //Look for the firmware folder//
 +  *//Toolchain for Indexer Settings// can be ignored.
   *Finish   *Finish
 +
  
 === Setting up Eclipse Debugging environment === === Setting up Eclipse Debugging environment ===
  
-  * Go to: Run>Debug Configurations...+  * Go to: Run > Debug Configurations...
   * Double click 'GDB OpenOCD Debugging'   * Double click 'GDB OpenOCD Debugging'
  
Line 75: Line 82:
  
 {{:projects:crazyflie2:development:stm_openocd_main.png?200|}} {{:projects:crazyflie2:development:stm_openocd_main.png?200|}}
 +
 +Insert the filepath to the cf2.elf file to //C/C++ Application//.
 + 
  
  
Line 82: Line 92:
  
 check the following settings: check the following settings:
-OpenOCD setup -> Config options: -f interface/stlink-v2.cfg -f target/stm32f4x.cfg -c init -c targets +OpenOCD setup -> Config options: <code> -f interface/stlink-v2.cfg -f target/stm32f4x.cfg -c init -c targets </code> 
-GDB Client Setup -> Commands:  set mem inaccessible-by-default off+GDB Client Setup: 
 +  * Executable name: Filepath to gdb toolchain 
 +  * Commands: <code> set mem inaccessible-by-default off </code>
  
 == Startup == == Startup ==
Line 98: Line 110:
 </WRAP> </WRAP>
  
 +==== Mac OS ====
 +
 +Install gdb and openocd
 +
 +<code>
 +brew install gdb
 +brew install open-ocd
 +</code>
 +
 +Install java JDK [[https://www.oracle.com/technetwork/java/javase/downloads/index.html|java download]]
  
 +Download eclipse [[https://www.eclipse.org/downloads/download.php?file=/oomph/epp/2019-06/R/eclipse-inst-mac64.dmg|eclipse download]]
  
 +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//.
projects/crazyflie2/development/openocd_gdb_debugging.1561558803.txt.gz · Last modified: 2019-06-26 16:20 by kimberly