en:arm_programming
Differences
This shows you the differences between two versions of the page.
Next revision | Previous revisionLast revisionBoth sides next revision | ||
en:arm_programming [2013/07/27 12:09] – created fluktuacia | en:arm_programming [2013/11/08 13:05] – [Compiler] kaklik | ||
---|---|---|---|
Line 1: | Line 1: | ||
====== ARM STM32 processors programming ====== | ====== ARM STM32 processors programming ====== | ||
- | The best working environment for ARM processors is the Linux OS. That is why the following manual describes the installation process and how to handle the tools for work with ARM in this system. [[http:// | + | The best working environment for ARM processors is the Linux OS. That is why the following manual describes the installation process and how to handle the tools for work with ARM in this particular |
All the software that is mentioned in this guide can be obtained for free. | All the software that is mentioned in this guide can be obtained for free. | ||
Line 9: | Line 9: | ||
A required HW includes: | A required HW includes: | ||
- | * ARM processor of your choice with necessary peripherals ([[cs: | + | * ARM processor of your choice with necessary peripherals ([[en: |
- | * Zvolený procesor ARM s potřebnou periferií ([[cs: | + | * Program __loading__ |
- | * Nahrání programu | + | |
- | | + | * J-TAG ([[en: |
- | * J-TAG ([[cs: | + | |
- | Potřebný SW | + | |
- | * Psaní programu | + | |
- | * Kompilátor | + | |
- | * Nahrání přeloženého programu | + | |
+ | A required SW includes: | ||
+ | * SW for writing the code | ||
+ | * Compiler | ||
+ | * Loading of the compiled program | ||
- | ===== Kompilátor ===== | ||
- | Jako volně dostupný kompilátor se může použít GNU C Compiler, dostupný v git repositáři [[https:// | + | ===== Compiler |
- | Pro instalaci do Ubuntu je možné využít před připravené | + | You can use a freely available GNU C compiler, obtainable from git repository |
- | == Rychlá instalace pomocí depozitáře | + | To help you with the Ubuntu installation it is possible to used a ready-made [[https:// |
+ | |||
+ | == Quick installation using a software repository | ||
sudo add-apt-repository ppa: | sudo add-apt-repository ppa: | ||
sudo apt-get update | sudo apt-get update | ||
- | sudo apt-get install gcc-arm-none-eabisudo | + | sudo apt-get install gcc-arm-none-eabi |
| | ||
- | == Postup kompilace | + | == Compilation procedure |
- | V terminálu je potřeba se nacházet ve složce, kde se nachází soubory potřebné pro kompilaci | + | |
+ | Open a terminal and change the directory to the one containing the compilation files. Start the compilation process using the MAKE command. | ||
| | ||
- | ===== Programovací | + | ===== GUI ===== |
Line 48: | Line 50: | ||
sudo apt-get install codeblocks | sudo apt-get install codeblocks | ||
- | ===== Knihovna | + | |
+ | ===== Libraries | ||
==== STM32F10X standard peripheral library ==== | ==== STM32F10X standard peripheral library ==== | ||
- | Úplná proprietární knihovna od STMicroelectronics, | + | The complete proprietary library from STMicroelectronics, |
+ | |||
+ | It is available for download at [[http:// | ||
- | Dostupná ke stažení na [[http:// | ||
==== libopencm3 ==== | ==== libopencm3 ==== | ||
- | Nová open-source | + | A new open-source |
- | [[http:// | + | |
- | ===== Nahrávání | + | [[http:// |
+ | |||
+ | ===== Loading | ||
==== Bootloader ==== | ==== Bootloader ==== | ||
- | Užití bootloaderu je výhodné v případech, | + | The use of bootloader is useful in cases when we do not intend to use any additional programming HW and we do not need advanced developmental functions like debugger. |
- | === Modul STM32F10xRxT01A === | + | |
+ | === STM32F10xRxT01A | ||
+ | |||
+ | To activate the bootloader, hold the BOOT key, then press the RESET key and immediately release the BOOT key. It is possible to communicate with the bootloader through USB or UART (using e.g. [[http:// | ||
- | Pro aktivaci bootloaderu držte tlačítko BOOT, zmáčkněte tlačítka RESET a poté hned pusťte tlačítko BOOT. | ||
- | S bootloaderem se může komunikovat přes USB nebo přes UART (např. programem [[http:// | ||
- | == Připojení modulu | + | == Connecting the module |
- | Pro použití bootloaderu je třeba modul připojit na seriovou linku. V případě použití modulu | + | In order to be able to use the bootloader, it in necessary to connect it to the serial link. In the case of using [[en: |
Line 80: | Line 87: | ||
| RXD | PA9 | | | RXD | PA9 | | ||
- | Ostatní signály | + | Professionals can connect other DTR and RTS signals as well, to get rid of an annoying pressing of the keys during every upload |
- | (Tato funkce vyžaduje upravený | + | (This function requires a modified |
- | == Kompilace | + | |
+ | == stm32flash | ||
svn checkout http:// | svn checkout http:// | ||
Line 91: | Line 99: | ||
- | Příklad použití: | + | An example of use: |
sudo stm32flash / | sudo stm32flash / | ||
Line 109: | Line 117: | ||
Resetting device... done. | Resetting device... done. | ||
- | + | An example of program loading: | |
- | Nahravani programu vypada napriklad takto: | + | |
$ ./ | $ ./ | ||
Line 131: | Line 138: | ||
=== dfu-util === | === dfu-util === | ||
- | Přeložené bináry této utility | + | The binaries for this utility |
- | Pro aktivaci bootloaderu přes USB musíte připojit | + | To activate the bootloader through |
- | Dávka pro volání | + | A __batch__ to call the dfu-util |
+ | |||
+ | You can test the firmware loading, using this sample binary, that creates the USB HID mouse out of the STM32F107 processor. [[http:// | ||
- | Nahrání firmware si můžete vyzkoušet pomocí tohoto vzorového bináru, který z procesoru STM32F107 udělá USB HID myš, která opisuje kolečko: [[http:// | ||
| | ||
==== J-TAG ==== | ==== J-TAG ==== | ||
- | K programování přes JTAG se potřebuje externí programátor. Na modulu | + | An external programmer is required to program through |
- | Programovat lze např. otevřeným programem | + | For programing is suitable eg. [[http:// |
- | OpenOCD | + | |
+ | === Ubuntu === | ||
+ | |||
+ | Though there already exist natively supported packages for OpenOCD | ||
+ | quite old compared to the latest development. It is therefore recommended to compile the current version... | ||
sudo apt-get install libtool git gcc automake libftdi-dev texinfo | sudo apt-get install libtool git gcc automake libftdi-dev texinfo | ||
Line 154: | Line 166: | ||
make | make | ||
sudo make install | sudo make install | ||
- | | + | |
- | Tím máme v systému naistalováno | + | To uninstal the OpenOCD, |
sudo make uninstall | sudo make uninstall | ||
- | Pokud máme k počítači připojený modul [[cs: | + | If you have a [[cs: |
sudo openocd -f " | sudo openocd -f " | ||
Line 178: | Line 190: | ||
Info : stm32f1x.cpu: | Info : stm32f1x.cpu: | ||
- | OpenOCD | + | |
+ | Tho OpenOCD | ||
telnet localhost 4444 | telnet localhost 4444 | ||
Line 188: | Line 201: | ||
> | > | ||
+ | |||
+ | === Mac OS X === | ||
+ | |||
+ | |||
+ | ./configure --enable-ft2232_ftd2xx openocd -f busblaster.cfg -f / | ||
+ | \\ | ||
+ | busblaster.cfg: | ||
+ | interface ft2232 | ||
+ | ft2232_device_desc "Dual RS232-HS" | ||
+ | ft2232_layout jtagkey | ||
+ | ft2232_vid_pid 0x0403 0x6010 | ||
+ | |||
+ | basic info: http:// | ||
+ | |||
===== RTOS ===== | ===== RTOS ===== | ||
==== Chibios ==== | ==== Chibios ==== | ||
- | [[http:// | + | [[http:// |
- | + | ||
- | Jde o základní relaltime operační systém s HAL zjednodušující práci s mikroprocesorem. Pro snazší práci byla vytvorena kofigurace | + | Chibios is a basic realtime OS with HAL component that simplifies the work with a microprocessor. To facilitate the work, a Chibios |
+ | |||
+ | In order to obtain more documentation use [[http:// | ||
- | Další programová dokumentace je dostupná [[http:// | + | === LED blink demo === |
- | === Demo blikání | + | |
#include < | #include < |
en/arm_programming.txt · Last modified: 2013/11/08 13:05 (external edit)