guides:stm32toolchain
Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
guides:stm32toolchain [2014/08/17 16:52] – [Step 4 - Adjust for your device] jonsowman | guides:stm32toolchain [2016/04/07 20:48] (current) – [Step 5 (libopencm3 Libraries)] mbrejza | ||
---|---|---|---|
Line 12: | Line 12: | ||
* For use of newlib-nano, | * For use of newlib-nano, | ||
* Extract to somewhere like /usr/local and add / | * Extract to somewhere like /usr/local and add / | ||
- | export PATH=/ | + | '' |
*Then to use the amended PATH: | *Then to use the amended PATH: | ||
- | $ source ~/.bashrc | + | '' |
* Alternatively (and for when they fix newlib nano in the repos), install from ppa: | * Alternatively (and for when they fix newlib nano in the repos), install from ppa: | ||
- | $ sudo add-apt-repository ppa: | + | '' |
- | $ sudo apt-get update | + | '' |
- | $ sudo apt-get install gcc-arm-none-eabi | + | '' |
* Check install is working by running | * Check install is working by running | ||
- | $ arm-none-eabi-gcc --version | + | '' |
==== Step 2 - Clone a blank project ==== | ==== Step 2 - Clone a blank project ==== | ||
- | $ git clone https:// | + | '' |
==== Step 3 - Fetch and build libopencm3 ==== | ==== Step 3 - Fetch and build libopencm3 ==== | ||
- | - `cd` into the root of the repo | + | - '' |
- | - Run $ `git submodule update --init` to fetch libopencm3. | + | - Run '' |
- | - `cd` to the libopencm3 directory and run `make` to build. | + | - '' |
==== Step 4 - Adjust for your device ==== | ==== Step 4 - Adjust for your device ==== | ||
- | Open up Makefile in firmware/ | ||
- | * include ../ | ||
- | * include ../ | ||
- | We've not got things set up for the F1 (or other) series yet, give us a shout if this is what you're after and we can help. | + | **We've not got things set up for the F1 (or other) series yet, give us a shout if this is what you're after and we can help.** |
+ | |||
+ | Open up Makefile in firmware/ | ||
+ | * '' | ||
+ | * '' | ||
- | Now open up common/ | + | Now open up common/ |
==== Step 5 - Install flashing/ | ==== Step 5 - Install flashing/ | ||
* Clone texane' | * Clone texane' | ||
- | * Follow the " | + | * Follow the " |
==== Step 6 - Build ==== | ==== Step 6 - Build ==== | ||
A libopencm3 LED blink example is provided in firmware/ | A libopencm3 LED blink example is provided in firmware/ | ||
- | `cd` to this directory and build the firmware with $ make - this should produce the main.elf file. | + | '' |
- | If you're having issues then use $ make V=1 for more verbose build output. | + | If you're having issues then use '' |
==== Step 7 - Flash the firmware ==== | ==== Step 7 - Flash the firmware ==== | ||
* Connect the board to the machine via the USB port | * Connect the board to the machine via the USB port | ||
- | * Erase the device with $ st-flash erase | + | * Erase the device with '' |
- | * Make the .bin version of the binary with $ make bin | + | * Make the .bin version of the binary with '' |
- | * Flash the firmware to the device with $ st-flash write main.bin 0x8000000 | + | * Flash the firmware to the device with '' |
* 0x800000 is the start address of the flash memory in the device memory address space | * 0x800000 is the start address of the flash memory in the device memory address space | ||
- | **On Linux, st-flash needs root privileges ($ sudo ./st-flash ...) to access the USB system until you set up udev rules** | + | **On Linux, st-flash needs root privileges ('' |
---- | ---- | ||
Line 108: | Line 109: | ||
==== Step 5 (libopencm3 Libraries) ==== | ==== Step 5 (libopencm3 Libraries) ==== | ||
- | Firstly add the libopencm3 files to the project directory. This can be fetched from the [[https:// | + | Firstly add the libopencm3 files to the project directory. This can be fetched from the [[https:// |
The final file needed is part of the linker script. Copy [[https:// | The final file needed is part of the linker script. Copy [[https:// |
guides/stm32toolchain.1408294333.txt.gz · Last modified: 2014/08/17 16:52 by jonsowman