en:arm_programming
Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revisionLast revisionBoth sides next revision | ||
en:arm_programming [2013/07/27 12:45] – [Introduction for beginners] 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: | ||
- | * An ARM processor of your choice with necessary peripherals ([[en: | + | * ARM processor of your choice with necessary peripherals ([[en: |
- | * Program | + | * Program |
- | * Through serial | + | * Through |
* J-TAG ([[en: | * J-TAG ([[en: | ||
A required SW includes: | A required SW includes: | ||
- | * SW for writing the code / coding Psaní programu | + | * SW for writing the code |
* Compiler | * Compiler | ||
- | * Loading of compiled program | + | * Loading of the compiled program |
===== Compiler ===== | ===== Compiler ===== | ||
- | You can use freely available GNU C compiler, obtainable from git repository [[https:// | + | You can use a freely available GNU C compiler, obtainable from git repository [[https:// |
- | To help you with the Ubuntu installation it is possible to used a ready-made [[https:// | + | To help you with the Ubuntu installation it is possible to used a ready-made [[https:// |
- | == Quick installation using a __repository__ | + | == 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 |
| | ||
== Compilation procedure == | == Compilation procedure == | ||
Line 55: | Line 55: | ||
==== STM32F10X standard peripheral library ==== | ==== STM32F10X standard peripheral library ==== | ||
- | The complete proprietary library from STMicroelectronics, | + | The complete proprietary library from STMicroelectronics, |
It is available for download at [[http:// | It is available for download at [[http:// | ||
Line 62: | Line 62: | ||
==== libopencm3 ==== | ==== libopencm3 ==== | ||
- | A new open-source library with better interface and smaller size, that in unfortunately yet incomplete (though under an ongoing development) | + | A new open-source library with better interface and smaller size, that in unfortunately yet incomplete (though under an ongoing development). |
Line 71: | Line 71: | ||
==== 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 === | + | |
- | Pro aktivaci bootloaderu držte tlačítko BOOT, zmáčkněte tlačítka RESET a poté hned pusťte tlačítko BOOT. | + | === STM32F10xRxT01A module === |
- | S bootloaderem se může komunikovat přes USB nebo přes UART (např. programem [[http:// | + | |
- | == Připojení modulu == | + | 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 použití bootloaderu je třeba modul připojit na seriovou linku. V případě použití modulu | + | |
+ | == Connecting the module == | ||
+ | |||
+ | 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 86: | 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 97: | Line 99: | ||
- | Příklad použití: | + | An example of use: |
sudo stm32flash / | sudo stm32flash / | ||
Line 115: | Line 117: | ||
Resetting device... done. | Resetting device... done. | ||
- | + | An example of program loading: | |
- | Nahravani programu vypada napriklad takto: | + | |
$ ./ | $ ./ | ||
Line 137: | 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 |
+ | |||
+ | For programing is suitable eg. [[http:// | ||
- | Programovat lze např. otevřeným programem [[http:// | + | === Ubuntu === |
- | OpenOCD | + | 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 160: | 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 184: | Line 190: | ||
Info : stm32f1x.cpu: | Info : stm32f1x.cpu: | ||
- | OpenOCD | + | |
+ | Tho OpenOCD | ||
telnet localhost 4444 | telnet localhost 4444 | ||
Line 194: | 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)