Home - multirotor/Multirotor GitHub Wiki

Welcome to the Multirotor wiki!

Toolchain Setup

The two most common OSes are Windows and Linux. To be able to develop for ST32 controllers follow one of the following guides:

Clone the Repos

Building

Do the following first for the libi2cwrapper library, then for the Multirotor repo:

Programming the Board

You can program the board with the binary file compiled in the build directory. It is called flight_ctrl as of now.

openocd programming

Linux

sudo openocd -f /usr/local/share/openocd/scripts/board/st_nucleo_f4.cfg -c "program flight_ctrl verify reset exit"

Eclipse environement

To import the project to eclipse following following steps:

  1. Go to File->Import->C/C++->Existing code as Autotools project
  2. Click finish

To be able to build inside Eclipse you need to do following adjustment:

  1. Hit Ctrl-shift-r
  2. Type in "MakeFile.am"
  3. Click open (or just hit enter)
  4. Edit the line "flight_ctrl_LDFLAGS = -T ../src/STM32F411RE_FLASH.ld" to "flight_ctrl_LDFLAGS = -T src/STM32F411RE_FLASH.ld" (have to discover why this has to be done)
  5. Now hit the hammer to build (or use Ctrl-b)

To be able to debug/flash using eclipse follow these steps:

  1. Go to Help-Install
  2. Click add and type in http://gnuarmeclipse.sourceforge.net/updates as "Location"
  3. If nothing found, click in the "Work with" bar and hit enter
  4. Make sure checkbox "GNU ARM C/C++ Cross Development Tools" is ticked
  5. Hit next and follow the install guide
  6. Click on the arrow next to the bug symbol (below menubar in eclipse)
  7. Choose "Debug configurations"
  8. Right click on "GDB Hardware Debugging" and choose new
  9. On page Main, click "Search Project..." and choose the flight_ctrl binary (not build/flight_ctrl!)
  10. On page "Debugger": 10a. Change GDB Command to "arm-none-eabi-gdb" 10b. Change "JTAG device" to "GNU ARM openocd" 10b. Change Port number to 3333
  11. Hit apply

Now you can hopefully debug the target by hitting the bug button. This will open a new perspective that allows you to step through the code!

Further useful setup:

To be able to see how registers are set during debugging you can use embsysregview, follwo these steps:

  1. Go to Help->Eclipse markeplace...
  2. Type in "embsysregview" and search
  3. Click install when embsysregview 0.2.5 (numbers might be updated in the future) is found
  4. Follow install guide
  5. My virtual box disk was to full so could not install it. Will continue guide when I have solved that issue...

Attaching sensors and using I/O pins

5V tolerant?

Not all pins are 5V tolerant! See here: http://developer.mbed.org/blog/entry/Hands-on-ST-Nucleo-board-with-a-shield/

Debugging

Using GDB

ARM Eclipse Plugin with OpenOCD debugging

  • Install GDB: sudo apt-get install gdb-arm-none-eabi
  • Follow http://gnuarmeclipse.livius.net/blog/plugins-install/
  • Select the "GNU ARM C/C++ OpenOCD debugging" plugin in the install dialogue
  • When configuring GDB in Eclipse, change the line "${cross_prefix}gdb${cross_suffix}" in GDB Client Setup to "arm-none-eabi-gdb"
  • Change the Config Options into "-f /usr/local/share/openocd/scripts/board/st_nucleo_f4.cfg"

Resizing virtualbox harddrive

If you do a stupid misstake as I did and choose to little space on your virtualbox hardrive follow this guide:

http://trivialproof.blogspot.se/2011/01/resizing-virtualbox-virtual-hard-disk.html

API

⚠️ **GitHub.com Fallback** ⚠️