installing_gnu_on_osx
Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
installing_gnu_on_osx [2009/11/03 22:13] – added info about .profile admin | installing_gnu_on_osx [2011/05/21 20:52] (current) – moved page admin | ||
---|---|---|---|
Line 1: | Line 1: | ||
- | ====How to set up the toolchain for coding MIOS32 apps with OS X==== | + | Now located under [[macos_mios32_toolchain_core]] |
- | + | ||
- | You have probably already installed the developper tools provided by apple. You need them before going further. (if you have installed XCode, that's fine). | + | |
- | + | ||
- | ===steps: | + | |
- | 0- about the terminal\\ | + | |
- | 1- get the mios32 files from the repository server\\ | + | |
- | 2- install the STM32 toolchain\\ | + | |
- | 3- configure the paths\\ | + | |
- | + | ||
- | ===0- about the terminal=== | + | |
- | + | ||
- | Most of the things now will be done with the Terminal, if you don't know anything about it here are the basic commands you need:\\ | + | |
- | Launch it from your " | + | |
- | After each command, press " | + | |
- | + | ||
- | Type " | + | |
- | Type " | + | |
- | Type "cd aDirectoryName" | + | |
- | Type "cd aPath" to go to a particular path\\ | + | |
- | Type "cd .." to go to the parent directory\\ | + | |
- | Type "cd ~" to go to your home directory | + | |
- | + | ||
- | A nice shortcut if you want to go to a particular folder without having to type the full path is to type "cd " in the terminal, then open the parent directory of the one you want to go in with the finder, and drag and drop the folder icon inside the terminal. It's path will appear by magic, press " | + | |
- | + | ||
- | ===1- get the files from the repository server=== | + | |
- | + | ||
- | The simplest way to do this is to get the " | + | |
- | Then you are able to drag and drop the " | + | |
- | Now the Unix path of your mios32 files is " | + | |
- | + | ||
- | You can also do this from Xcode itself:\\ | + | |
- | In the " | + | |
- | Under the repositories list clic on the " | + | |
- | Then in the " | + | |
- | In the " | + | |
- | + | ||
- | ===2- install the STM32 toolchain=== | + | |
- | + | ||
- | A nice pre-built binaries archive can be found at this page: " | + | |
- | You don't need to do everything written on this page as we won't use Circle OS and FatFryer.\\ | + | |
- | Just download the pre-built binaries in the section " | + | |
- | Expand the archive, you will then have a " | + | |
- | Check that all the files expanded properly in your /usr folder.\\ | + | |
- | The trick is that the /usr folder is hidden by the finder so if you want to open it, in the finder' | + | |
- | + | ||
- | Personally I tried to expand the files with the terminal as said in the " | + | |
- | You now need to set the path variable for the toolchain, see the next section about this | + | |
- | + | ||
- | ===3- set up the paths variables=== | + | |
- | + | ||
- | For those who don't know anything about Unix like me a few days ago, here's a quick explanation: | + | |
- | In Unix we call a shell the piece of software that provides an interface for users. For example, when you use the terminal in OS X, you are talking to the computer through the " | + | |
- | Your compiler also uses the shell to access to the different files involved. Thus, it has to know where to find these files. | + | |
- | + | ||
- | Setting up path variables in the shell is quite easy: in a terminal window just type\\ | + | |
- | '' | + | |
- | and if you want to check to what the variable has been assigned, type:\\ | + | |
- | '' | + | |
- | this will print what's inside the variable.\\ | + | |
- | For example, type\\ | + | |
- | '' | + | |
- | to set up the mios32 folder path, then type\\ | + | |
- | '' | + | |
- | to check that the path variable has been assigned. | + | |
- | + | ||
- | In our case, we need to set up the path variable for the STM32 toolchain: | + | |
- | type in the terminal\\ | + | |
- | '' | + | |
- | and then we need to set up variables for mios32 itself:\\ | + | |
- | '' | + | |
- | export MIOS32_BIN_PATH=$MIOS32_PATH/ | + | |
- | export MIOS32_GCC_PREFIX=arm-none-eabi\\ | + | |
- | export MIOS32_FAMILY=STM32F10x\\ | + | |
- | export MIOS32_PROCESSOR=STM32F103RE\\ | + | |
- | export MIOS32_BOARD=MBHP_CORE_STM32\\ | + | |
- | export MIOS32_LCD=clcd'' | + | |
- | Here I considered that you have put all the files downloaded from the svn server in the directory " | + | |
- | + | ||
- | Now everything is set up to compile properly your projects. Test if everything is OK, open a terminal window, type\\ | + | |
- | '' | + | |
- | to go to the " | + | |
- | '' | + | |
- | you should have a return looking like this:\\ | + | |
- | '' | + | |
- | Application successfully built for:\\ | + | |
- | Processor: STM32F103RE\\ | + | |
- | Family: | + | |
- | Board: | + | |
- | LCD: | + | |
- | -------------------------------------------------------------------------------'' | + | |
- | and with the finder, go to this tutorial folder, you should have now a .hex file uploadable to your core32 with " | + | |
- | + | ||
- | The annoying point there is that the variables you set up in the shell just disappear when you shut down or log off your computer. That means you have to set them up again when you power on your computer again. There' | + | |
- | The shell will always read particular files before starting up. If you put these variables there they will always be set up. I didn't really understood if the proper file was " | + | |
- | Moreover, all these files are hidden from the finder, so the best way to edit them is to open a terminal window and edit them with the " | + | |
- | If you don't understand what's going on, here's what I did: | + | |
- | + | ||
- | in a terminal window, type:\\ | + | |
- | '' | + | |
- | then copy and paste these lines inside the pico editor:\\ | + | |
- | + | ||
- | '' | + | |
- | export MIOS32_PATH=~/ | + | |
- | export MIOS32_BIN_PATH=$MIOS32_PATH/ | + | |
- | export MIOS32_GCC_PREFIX=arm-none-eabi\\ | + | |
- | export MIOS32_FAMILY=STM32F10x\\ | + | |
- | export MIOS32_PROCESSOR=STM32F103RE\\ | + | |
- | export MIOS32_BOARD=MBHP_CORE_STM32\\ | + | |
- | export MIOS32_LCD=clcd | + | |
- | echo " | + | |
- | + | ||
- | do " | + | |
- | do " | + | |
- | + | ||
- | Once you open a new terminal, the variables will be set automatically, | + | |
- | It isn't required to log off or shut down your computer to test this.\\ | + | |
- | Open a terminal window and check if the variables are all set up by typing:\\ | + | |
- | '' | + | |
- | If you don't see the messages (and MIOS32 variables don't exist), that's probably because a .bash_login or .bash_profile already exists (edit only an already existing file - of none exists, use .profile).\\ | + | |
- | Useful info about bash and initialisation files here:\\ | + | |
- | [[http:// | + | |
- | and here:\\ | + | |
- | [[http:// | + | |
installing_gnu_on_osx.1257286423.txt.gz · Last modified: 2009/11/03 22:13 (external edit)