Home - multirotor/Multirotor GitHub Wiki
Welcome to the Multirotor wiki!
The two most common OSes are Windows and Linux. To be able to develop for ST32 controllers follow one of the following guides:
- clone libi2cwrapper:
git clone https://github.com/mpruscha/libi2c_wrapper.git
- clone Multirotor:
git clone https://github.com/multirotor/Multirotor.git
Do the following first for the libi2cwrapper library, then for the Multirotor repo:
- run
autoreconf --install
in the repo top directory - create a "build" directory in the top directory
mkdir build
(see out-of-source builds, http://voices.canonical.com/jussi.pakkanen/2013/04/16/why-you-should-consider-using-separate-build-directories/) - switch to the build directory:
cd build
- run
../configure --host=arm-none-eabi
- run
make
- run
make install
You can program the board with the binary file compiled in the build directory. It is called flight_ctrl as of now.
Linux
sudo openocd -f /usr/local/share/openocd/scripts/board/st_nucleo_f4.cfg -c "program flight_ctrl verify reset exit"
To import the project to eclipse following following steps:
- Go to File->Import->C/C++->Existing code as Autotools project
- Click finish
To be able to build inside Eclipse you need to do following adjustment:
- Hit Ctrl-shift-r
- Type in "MakeFile.am"
- Click open (or just hit enter)
- 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)
- Now hit the hammer to build (or use Ctrl-b)
To be able to debug/flash using eclipse follow these steps:
- Go to Help-Install
- Click add and type in http://gnuarmeclipse.sourceforge.net/updates as "Location"
- If nothing found, click in the "Work with" bar and hit enter
- Make sure checkbox "GNU ARM C/C++ Cross Development Tools" is ticked
- Hit next and follow the install guide
- Click on the arrow next to the bug symbol (below menubar in eclipse)
- Choose "Debug configurations"
- Right click on "GDB Hardware Debugging" and choose new
- On page Main, click "Search Project..." and choose the flight_ctrl binary (not build/flight_ctrl!)
- 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
- 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:
- Go to Help->Eclipse markeplace...
- Type in "embsysregview" and search
- Click install when embsysregview 0.2.5 (numbers might be updated in the future) is found
- Follow install guide
- My virtual box disk was to full so could not install it. Will continue guide when I have solved that issue...
Not all pins are 5V tolerant! See here: http://developer.mbed.org/blog/entry/Hands-on-ST-Nucleo-board-with-a-shield/
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"
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