Mac OSX Eclipse/yagarto/qstlink set up
Posted: Fri Mar 23, 2012 12:08 am
So I have been working on getting the toolchain set up on my Mac for a while, I have been able to use a virtual machine to get it to work with Atollic Truestudio. However Atollic just announced they are terminating support for their STM32 version of the software, implementing code/time restrictions on the free version. So I thought, "Atollic is cool, but it is based on eclipse, I till try to get it working on the OSX side of things" So I have found about 5-7 different tutorials online and have tried a handful of them. I am running OSX 10.7.3 on an Air and this is what I was able to do to compile code:
**Note I was only able to have good results with my STMF4DISCOVERY board that used V2 of ST-LINK, this may not work with older DISCOVERY boards**
I will cover 3 parts:
1 - ToolChain (compiler tools)
2 - IDE (Development or code-writing tools)
3 - Software Upload Tools (Uploading the code to the STM32F4DISCOVERY)
1 - ToolChain (compiler tools)
Download YAGARTO from here:
http://www.yagarto.de/
Later on we need to tell OSX where the ARM compiler tools are so we need to make a set folder where to install. Inside your home folder create a folder, name it "Developer".
Inside the Developer folder make a new folder named "yagarto"
Drag the yagarto installer(*cough* self extracting archive*cough*) in the yagarto folder and double click on it.
2 - IDE (Development or code-writing tools)
Install Eclipse. I went about this differently than what was said on the chibiOS site. I just installed the C++/C Developers dmg from the eclipse website.
Download "Eclipse IDE for C/C++ Developers" from the link below:
http://www.eclipse.org/downloads/
Install eclipse into the Developer folder that we created before.
Once installed you will still need to configure GDB for debugging.(I haven't figured this part out yet)
Install GDB inside Eclipse like it says on the chibiOS how to below:
http://chibios.org/dokuwiki/doku.php?id=chibios:guides:eclipse1
you should only need to follow step 11, but if you encounter problems it won't hurt to start from the beginning.
From the chibiOS how to, it stops right there and says you should be able to import the demo application and build correctly. WRONG. Eclipse will not build correctly, we will need to launch eclipse with a bash script that will enable Eclipse to see the YAGARTO toolchain that we set up in step 1.
To make this bash script you will need to copy each line into the terminal one by one to make it work correctly.
This will create a file named "eclipse-3.7-cdt.command". To launch eclipse you will double click on this file that will set the $PATH correctly so that eclipse will compile your project without error. This will need to be done every time you want to open eclipse.
The bash script was adapted from the link below:
http://gnuarmeclipse.sourceforge.net/wiki/Toolchain_installation_OS_X
3 - Software Upload Tools (Uploading the code to the STM32F4DISCOVERY)
Follow the instructions Here:
http://code.google.com/p/qstlink2/wiki/Building_OSX
(To upload you will not need to compile as noted in the Feb 13 2012 post, but you will at least need to download and install the 2 qt packages and also the libUSB package)
Download the binary from here:
http://code.google.com/p/qstlink2/
To upload the code you will launch qstlink and it will discover the STM32F4DISCOVERY automatically, then you can upload the .bin file inside the chibiOS build folder.
I think I read somewhere on this site where Giovani was explaining a way to set up the GDB and the file upload in eclipse. I have yet to do that so I will try to append this document when(if) I figure it out.
-Chris
**Note I was only able to have good results with my STMF4DISCOVERY board that used V2 of ST-LINK, this may not work with older DISCOVERY boards**
I will cover 3 parts:
1 - ToolChain (compiler tools)
2 - IDE (Development or code-writing tools)
3 - Software Upload Tools (Uploading the code to the STM32F4DISCOVERY)
1 - ToolChain (compiler tools)
Download YAGARTO from here:
http://www.yagarto.de/
Later on we need to tell OSX where the ARM compiler tools are so we need to make a set folder where to install. Inside your home folder create a folder, name it "Developer".
Inside the Developer folder make a new folder named "yagarto"
Drag the yagarto installer(*cough* self extracting archive*cough*) in the yagarto folder and double click on it.
2 - IDE (Development or code-writing tools)
Install Eclipse. I went about this differently than what was said on the chibiOS site. I just installed the C++/C Developers dmg from the eclipse website.
Download "Eclipse IDE for C/C++ Developers" from the link below:
http://www.eclipse.org/downloads/
Install eclipse into the Developer folder that we created before.
Once installed you will still need to configure GDB for debugging.(I haven't figured this part out yet)
Install GDB inside Eclipse like it says on the chibiOS how to below:
http://chibios.org/dokuwiki/doku.php?id=chibios:guides:eclipse1
you should only need to follow step 11, but if you encounter problems it won't hurt to start from the beginning.
From the chibiOS how to, it stops right there and says you should be able to import the demo application and build correctly. WRONG. Eclipse will not build correctly, we will need to launch eclipse with a bash script that will enable Eclipse to see the YAGARTO toolchain that we set up in step 1.
To make this bash script you will need to copy each line into the terminal one by one to make it work correctly.
Code: Select all
cd $HOME/Developer
echo '#!/bin/bash' > eclipse-3.7-cdt.command
echo 'export PATH=$HOME/Developer/yagarto/yagarto-4.6.2/bin:$PATH' >> eclipse-3.7-cdt.command
echo '$HOME/Developer/Eclipse/eclipse' >> eclipse-3.7-cdt.command
chmod +x eclipse-3.7-cdt.commandThis will create a file named "eclipse-3.7-cdt.command". To launch eclipse you will double click on this file that will set the $PATH correctly so that eclipse will compile your project without error. This will need to be done every time you want to open eclipse.
The bash script was adapted from the link below:
http://gnuarmeclipse.sourceforge.net/wiki/Toolchain_installation_OS_X
3 - Software Upload Tools (Uploading the code to the STM32F4DISCOVERY)
Follow the instructions Here:
http://code.google.com/p/qstlink2/wiki/Building_OSX
(To upload you will not need to compile as noted in the Feb 13 2012 post, but you will at least need to download and install the 2 qt packages and also the libUSB package)
Download the binary from here:
http://code.google.com/p/qstlink2/
To upload the code you will launch qstlink and it will discover the STM32F4DISCOVERY automatically, then you can upload the .bin file inside the chibiOS build folder.
I think I read somewhere on this site where Giovani was explaining a way to set up the GDB and the file upload in eclipse. I have yet to do that so I will try to append this document when(if) I figure it out.
-Chris