25762
Kommentar:
|
24875
|
Gelöschter Text ist auf diese Art markiert. | Hinzugefügter Text ist auf diese Art markiert. |
Zeile 24: | Zeile 24: |
Es gibt zwei Git Repositories für Beispielprogramme: * https://github.com/hsa-embedded/stm32lab Im Herbst 2014 arbeitet Andreas Schumann an Software-Beispielen, die er in dieses Repository füllt. * git://hhoegl.informatik.fh-augsburg.de/srv/git/stm32-at-hsa.git Dieses Repo ist schon etwas älter und enthält meine ursprüngliche Sammlung von Programmbeispielen. |
1. Es gibt zwei Git Repositories für Beispielprogramme: https://github.com/hsa-embedded/stm32lab Im Herbst 2014 arbeitet Andreas Schumann an Software-Beispielen, die er in dieses Repository füllt. `<git://hhoegl.informatik.fh-augsburg.de/srv/git/stm32-at-hsa.git>`_ Dieses Repo ist schon etwas älter und enthält meine ursprüngliche Sammlung von Programmbeispielen. #. STM32 Forum https://my.st.com/public/STe2ecommunities/mcu/Lists/cortex_mx_stm32/AllItems.aspx #. Viele Fundsachen zum STM32: http://hhoegl.informatik.fh-augsburg.de/cdrom-stm32/ #. Eclipse zur Entwicklung für den STM32 http://hhoegl.informatik.fh-augsburg.de/pub/stm32lab/Hauffe-Fischer-Eclipse/bericht.html #. Demos der Standard Peripherie-Lib unter Linux http://hhoegl.informatik.fh-augsburg.de/pub/stm32lab/stdperiph-demos-hh |
Zeile 42: | Zeile 59: |
1. Things to remember when developing a program for STM32 using STM32-Library - http://www.emcu.it/STM32/STM32VLDiscovery_Test/Things%20to%20remember%20when%20developing%20a%20program%20for%20STM32%20using%20STM32-Library.html - http://www.emcu.it/STM32/STM32Library/TwoWordsConcerningSTM32Library.html - http://www.emcu.it/STM32.html#TUTORIAL_and_SW_examples |
1. Übersicht zum Familie der STM32 Controller auf mikrocontroller.net http://www.mikrocontroller.net/articles/STM32 |
Zeile 77: | Zeile 90: |
#. Things to remember when developing a program for STM32 using STM32-Library - http://www.emcu.it/STM32/STM32VLDiscovery_Test/Things%20to%20remember%20when%20developing%20a%20program%20for%20STM32%20using%20STM32-Library.html - http://www.emcu.it/STM32/STM32Library/TwoWordsConcerningSTM32Library.html - http://www.emcu.it/STM32.html#TUTORIAL_and_SW_examples |
|
Zeile 87: | Zeile 109: |
#. Flashing the STM32VL with stlink, http://gpio.kaltpost.de/?page_id=148 Using the USART, http://gpio.kaltpost.de/?page_id=167 |
#. Flashing the STM32VL with stlink - http://gpio.kaltpost.de/?page_id=148 - Using the USART, http://gpio.kaltpost.de/?page_id=167 |
Zeile 110: | Zeile 134: |
Zeile 124: | Zeile 147: |
#. STM32F0-discovery default demo using FreeRTOSv7.5.2, codesourcery arm-gcc, and Eclipse. | #. STM32F0-discovery default demo using FreeRTOSv7.5.2, codesourcery arm-gcc, and Eclipse. |
Zeile 128: | Zeile 153: |
Zeile 131: | Zeile 157: |
#. STLINK | #. Mike Szczys, How to develop for STM32 discovery boards using Linux, 10/2011 (verwendet die STLINK Software). |
Zeile 136: | Zeile 163: |
#. http://www.triplespark.net/elec/pdev/arm/stm32.html #. http://hackaday.com/2012/09/27/beginners-look-at-on-chip-debugging/ |
#. Programming STM32 F2, F4 ARMs under Linux: A Tutorial from Scratch http://www.triplespark.net/elec/pdev/arm/stm32.html #. Mike Szczys, Beginner’s look at On-Chip Debugging, 9/2012 http://hackaday.com/2012/09/27/beginners-look-at-on-chip-debugging/ |
Zeile 146: | Zeile 177: |
#. http://balau82.wordpress.com/2013/08/14/flashing-the-stm32-p152-board-with-openocd/ #. http://en.radzio.dxp.pl/stm32vldiscovery #. http://dangerousprototypes.com/tag/stm32 |
#. Tutorial von Radoslaw Kwiecien. Code jedoch nur für MDK-ARM geschrieben. http://en.radzio.dxp.pl/stm32vldiscovery #. All articles with tag "stm32" http://dangerousprototypes.com/tag/stm32 |
Zeile 158: | Zeile 190: |
Zeile 161: | Zeile 194: |
Zeile 163: | Zeile 195: |
Zeile 165: | Zeile 196: |
Zeile 172: | Zeile 202: |
Zeile 176: | Zeile 207: |
#. http://www.mikrocontroller.net/articles/STM32 | |
Zeile 179: | Zeile 209: |
- https://github.com/szczys/stm32f0-discovery-basic-template - https://github.com/mblythe86/stm32f3-discovery-basic-template |
|
Zeile 198: | Zeile 225: |
- Getting Started with the STM32F4 and GCC (Ubuntu 11.10, summon-arm-toolchain) | - Getting Started with the STM32F4 and GCC (Ubuntu 11.10, summon-arm-toolchain) |
Zeile 204: | Zeile 232: |
Links zu den Templates: https://github.com/szczys/stm32f0-discovery-basic-template https://github.com/mblythe86/stm32f3-discovery-basic-template |
|
Zeile 217: | Zeile 251: |
darin erwähnt: Developing Software for ARM Processors DUI0471H_developing_for_arm_processors.pdf |
darin erwähnt: Developing Software for ARM Processors (DUI0471H_developing_for_arm_processors.pdf) http://balau82.wordpress.com/2013/08/14/flashing-the-stm32-p152-board-with-openocd/ |
Zeile 247: | Zeile 283: |
Stoffsammlung zu printf() über UART - http://forum.superkato.net/viewtopic.php?t=81 - https://balau82.wordpress.com/2010/12/16/using-newlib-in-arm-bare-metal-programs - http://www.embedded.com/design/prototyping-and-development/4024867/Embedding-with-GNU-Newlib - http://e2e.ti.com/support/microcontrollers/stellaris_arm/f/471/t/45015.aspx - http://koda-karma.blogspot.de/2006/05/newlib-printf-through-uart-on-gnu-arm.html - http://siwawi.bauing.uni-kl.de/avr_projects/arm_projects/#gcc_stdio - http://embdev.net/topic/129810 - http://wiki.osdev.org/Porting_Newlib |
|
Zeile 270: | Zeile 320: |
#. STM32 Forum https://my.st.com/public/STe2ecommunities/mcu/Lists/cortex_mx_stm32/AllItems.aspx |
#. Qemu für Cortex-M3 testen #. Device Firmware Upgrade Utility, auch für STM32 geeignet Homepage: http://dfu-util.gnumonks.org Code: https://gitorious.org/dfu-util #. Quelltext der STM32 stdperiph lib untersuchen Mit ``find`` und ``grep`` nach einem Namen suchen. Problematisch ist, dass in manchen Dateinamen ein Leerzeichen ist. Das kann man so umgehen:: find . -name *.c -print0 | xargs -0 grep -i RCC_AHBPeriphClockCmd Klären: Wie wurde die Hilfedatei erstellt? Antwort: doxygen :: stm32vldiscovery_package/stm32f10x_an3268_fw.chm <-- M$ Format! Im Quelltext stehen @page, @verbatim, @file, @version, @author, @date, @defgroup, @addtogroup, @brief, @param, @arg, @retval, @note, @copy, ... Genauso wurde CMSIS dokumentiert. #. Lizenzen bei STM32 Projekten prüfen Codesourcery Compiler kommerziell, teilweise geschlossen (das betrifft CM3 Startup Code). Besser wären - https://launchpad.net/gcc-arm-embedded - summon arm toolchain https://github.com/esden/summon-arm-toolchain - Ubuntu gcc-arm-linux-gnueabi Lizenz der Std-Periph Lib: http://www.st.com/software_license_agreement_liberty_v2 besser: CMSIS End User License Agreement Keil RTX für Cortex M ist unter BSD Lizenz: cmsis_rtos_rtx_v4p70.zip Keil RTX ist zu CMSIS kompatibel. Sollte man es in die Liste der freien RTOSse für CM3 aufnehmen? (FreeRTOS, ChibiOS, RTX). |
Zeile 333: | Zeile 431: |
Materialsammlung ---------------- * Viele Fundsachen zum STM32: http://hhoegl.informatik.fh-augsburg.de/cdrom-stm32/ * Eclipse zur Entwicklung für den STM32 http://hhoegl.informatik.fh-augsburg.de/pub/stm32lab/Hauffe-Fischer-Eclipse/bericht.html * Demos der Standard Peripherie-Lib unter Linux http://hhoegl.informatik.fh-augsburg.de/pub/stm32lab/stdperiph-demos-hh * Olimex GCCFD |
Notizen ------- 1. Olimex GCCFD |
Zeile 356: | Zeile 442: |
* stm32plus C++ Bibliothek von Andy Brown | #. stm32plus C++ Bibliothek von Andy Brown |
Zeile 358: | Zeile 445: |
https://github.com/andysworkshop/stm32plus.git Website http://andybrown.me.uk/wk/ Aktuelle Version 3.1.1: Support für STM32F100 und grössere Bausteine, http://andybrown.me.uk/wk/2013/12/28/stm32plus-311/, stm32plus::net scons Bauen für VL Discovery mit:: |
https://github.com/andysworkshop/stm32plus.git Website http://andybrown.me.uk/wk/ Aktuelle Version 3.1.1: Support für STM32F100 und grössere Bausteine, http://andybrown.me.uk/wk/2013/12/28/stm32plus-311/, stm32plus::net scons Bauen für VL Discovery mit:: |
Zeile 371: | Zeile 457: |
Ergebnis: lib mit etwa 8 MByte | Ergebnis: lib mit etwa 8 MByte:: hhoegl@aspire1:~/STM32/STM32-Baustelle/stm32plus$ ls -l ./lib/build/fast-f1mdvl-8000000/libstm32plus-master-f1mdvl-fast.a -rw-r--r-- 1 hhoegl hhoegl 7799686 Feb 27 16:54 ./lib/build/fast-f1mdvl-8000000/libstm32plus-master-f1mdvl-fast.a gcc Aufruf beim Bauen:: arm-none-eabi-g++ -o lib/build/fast-f1mdvl-8000000/src/usart/interrupts/Usart2InterruptHandler.o -c -Wextra -Werror -pedantic-errors -fno-rtti -std=gnu++0x -fno-threadsafe-statics -pipe -Wall -Werror -ffunction-sections -fdata-sections -fno-exceptions -mthumb -gdwarf-2 -pipe -DHSE_VALUE=8000000 -mcpu=cortex-m3 -DSTM32PLUS_F1_MD_VL -O3 -Ilib/include -Ilib/include/stl -Ilib lib/src/usart/interrupts/Usart2InterruptHandler.cpp u.s.w. #. Jede Menge Tests von Michael Fischer für Cortex-M0, M3, M4 http://www.emb4fun.de/arm/examples/index.html Hier ist auch das "offizielle" syscalls: http://www.emb4fun.de/download/arm/examples/syscalls.c |
Zeile 373: | Zeile 476: |
:: hhoegl@aspire1:~/STM32/STM32-Baustelle/stm32plus$ ls -l ./lib/build/fast-f1mdvl-8000000/libstm32plus-master-f1mdvl-fast.a -rw-r--r-- 1 hhoegl hhoegl 7799686 Feb 27 16:54 ./lib/build/fast-f1mdvl-8000000/libstm32plus-master-f1mdvl-fast.a gcc Aufruf beim Bauen:: arm-none-eabi-g++ -o lib/build/fast-f1mdvl-8000000/src/usart/interrupts/Usart2InterruptHandler.o -c -Wextra -Werror -pedantic-errors -fno-rtti -std=gnu++0x -fno-threadsafe-statics -pipe -Wall -Werror -ffunction-sections -fdata-sections -fno-exceptions -mthumb -gdwarf-2 -pipe -DHSE_VALUE=8000000 -mcpu=cortex-m3 -DSTM32PLUS_F1_MD_VL -O3 -Ilib/include -Ilib/include/stl -Ilib lib/src/usart/interrupts/Usart2InterruptHandler.cpp u.s.w. * Jede Menge Tests von Michael Fischer für Cortex-M0, M3, M4 http://www.emb4fun.de/arm/examples/index.html Hier ist auch das "offizielle" syscalls: http://www.emb4fun.de/download/arm/examples/syscalls.c * printf() über UART, Stoffsammlung - http://forum.superkato.net/viewtopic.php?t=81 - https://balau82.wordpress.com/2010/12/16/using-newlib-in-arm-bare-metal-programs - http://www.embedded.com/design/prototyping-and-development/4024867/Embedding-with-GNU-Newlib - http://e2e.ti.com/support/microcontrollers/stellaris_arm/f/471/t/45015.aspx - http://koda-karma.blogspot.de/2006/05/newlib-printf-through-uart-on-gnu-arm.html - http://siwawi.bauing.uni-kl.de/avr_projects/arm_projects/#gcc_stdio - http://embdev.net/topic/129810 - http://wiki.osdev.org/Porting_Newlib * Fileinklusion mit Doxygen grafisch veranschaulichen http://stackoverflow.com/questions/1190597/open-source-tool-to-visualize-c-c-header-file-dependencies |
#. Fileinklusion mit Doxygen grafisch veranschaulichen http://stackoverflow.com/questions/1190597/open-source-tool-to-visualize-c-c-header-file-dependencies |
Zeile 410: | Zeile 480: |
* Dokumente zum gcc-arm-embedded sind in /opt/gcc-arm-none-eabi-4_7-2013q3/share/doc/gcc-arm-none-eabi/pdf/ |
#. Dokumente zum gcc-arm-embedded sind in /opt/gcc-arm-none-eabi-4_7-2013q3/share/doc/gcc-arm-none-eabi/pdf/ |
Zeile 423: | Zeile 493: |
* Man kann den arm-gcc mit --std=c11 verwenden, dann kennt er aber keine asm() Anweisung mehr. Die funktioniert mit --std=gnu11. * Manche Demos verwenden die Header-Datei "STM32vldiscovery.h". Diese ist nicht in der Std-Periph-Lib enhalten, sondern man findet sie z.B. hier: |
#. Man kann den arm-gcc mit --std=c11 verwenden, dann kennt er aber keine asm() Anweisung mehr. Die funktioniert mit --std=gnu11. #. Manche Demos verwenden die Header-Datei "STM32vldiscovery.h". Diese ist nicht in der Std-Periph-Lib enhalten, sondern man findet sie z.B. hier:: |
Zeile 432: | Zeile 501: |
In dieser Header Datei ist eine Include-Anweisung, die man korrigieren muss | In dieser Header Datei ist eine Include-Anweisung, die man korrigieren muss |
Zeile 434: | Zeile 503: |
Zeile 440: | Zeile 510: |
* 2013-10-25 | Lizenzen bei STM32 Projekten prüfen - Codesourcery Compiler kommerziell, teilweise geschlossen (das betrifft CM3 Startup Code). Besser wären - https://launchpad.net/gcc-arm-embedded - summon arm toolchain https://github.com/esden/summon-arm-toolchain - Ubuntu gcc-arm-linux-gnueabi - Lizenz der Std-Periph Lib: http://www.st.com/software_license_agreement_liberty_v2 besser: CMSIS End User License Agreement - Keil RTX für Cortex M ist unter BSD Lizenz: cmsis_rtos_rtx_v4p70.zip Keil RTX ist zu CMSIS kompatibel. Sollte man es in die Liste der freien RTOSse für CM3 aufnehmen? (FreeRTOS, ChibiOS, RTX). * Quelltext der STM32 stdperiph lib untersuchen Mit ``find`` und ``grep`` nach einem Namen suchen. Problematisch ist, dass in manchen Dateinamen ein Leerzeichen ist. Das kann man so umgehen:: find . -name *.c -print0 | xargs -0 grep -i RCC_AHBPeriphClockCmd Klären: - Wie wurde die Hilfedatei erstellt? Antwort: doxygen :: stm32vldiscovery_package/stm32f10x_an3268_fw.chm <-- M$ Format! Im Quelltext stehen @page, @verbatim, @file, @version, @author, @date, @defgroup, @addtogroup, @brief, @param, @arg, @retval, @note, @copy, ... Genauso wurde CMSIS dokumentiert. * 2013-11-20 | Device Firmware Upgrade Utility, auch für STM32 geeignet Homepage: http://dfu-util.gnumonks.org Code: https://gitorious.org/dfu-util |
STM32LAB
Inhalt
Zur Dokumentation geht es hier:
http://elk.informatik.hs-augsburg.de/hhweb/labor/arm/stm32lab
1 Neuigkeiten
Es gibt zwei Git Repositories für Beispielprogramme:
https://github.com/hsa-embedded/stm32lab
Im Herbst 2014 arbeitet Andreas Schumann an Software-Beispielen, die er in dieses Repository füllt.
git://hhoegl.informatik.fh-augsburg.de/srv/git/stm32-at-hsa.git
Dieses Repo ist schon etwas älter und enthält meine ursprüngliche Sammlung von Programmbeispielen.
- STM32 Forum https://my.st.com/public/STe2ecommunities/mcu/Lists/cortex_mx_stm32/AllItems.aspx
Viele Fundsachen zum STM32:
Eclipse zur Entwicklung für den STM32
http://hhoegl.informatik.fh-augsburg.de/pub/stm32lab/Hauffe-Fischer-Eclipse/bericht.html
Demos der Standard Peripherie-Lib unter Linux
http://hhoegl.informatik.fh-augsburg.de/pub/stm32lab/stdperiph-demos-hh
2 "Fremde" Programmbeispiele und Tutorials
Übersicht zum Familie der STM32 Controller auf mikrocontroller.net
Tutorial auf keytosmart.com
- http://www.keytosmart.com/programming-stm32-usart-gcc-tools-part-1
- http://www.keytosmart.com/programming-stm32-usart-gcc-tools-part-2/
- http://www.keytosmart.com/stm32-interrupts-programming-gcc/
- ...
Dieses Tutorial ist auch auf embedds.com gespiegelt:
- http://www.embedds.com/arm-cortex-tutorials/
- http://www.embedds.com/do-we-need-arm/
- http://www.embedds.com/programming-stm32f10x-io-port-pins/
- http://www.embedds.com/programming-stm32-usart-using-gcc-tools-part-1/
- http://www.embedds.com/programming-stm32-usart-using-gcc-tools-part-2/
- http://www.embedds.com/using-direct-memory-access-dma-in-stm23-projects/
- http://www.embedds.com/introducing-to-stm32-adc-programming-part1/
- http://www.embedds.com/introducing-to-stm32-adc-programming-part2/
- http://www.embedds.com/stm32-nucleo-boards-enable-faster-prototyping/
- http://www.embedds.com/stm32-interrupts-and-programming-with-gcc/
- http://www.embedds.com/st32mvldiscovery-project-template-for-gcc/
- http://www.embedds.com/setting-arm-gcc-development-environment/
- http://www.embedds.com/programming-stm32-discovery-using-gnu-tools-startup-code/
- http://www.embedds.com/programming-stm32-discovery-using-gnu-tools-linker-script/
- http://www.embedds.com/st32mvldiscovery-project-template-for-gcc/ (STM32DiscoveryTemplate.zip)
Things to remember when developing a program for STM32 using STM32-Library
Using STM32 discovery kits with open source tools (stlink, summon-arm-toolchain, Chibios, 10 Seiten, aus der STLINK Dokumentation).
https://raw.github.com/texane/stlink/master/doc/tutorial/tutorial.pdf
STM32 Tutorial von Diller Technologies (CooCox, CoIDE)
Flashing the STM32VL with stlink
Tutorials von Hussam Al-Hertani
STM32F0Discovery Under Linux Tutorial Part 1 – Setting up the GCC ARM Toolchain, OpenOCD and stlink
http://hertaville.com/2013/09/02/stm32f0discovery-part-1-linux/
STM32F0Discovery Under Linux Tutorial Part 2 – Using a Minimalist Integrated Development Environment From the Command Line (mit Beispiel iotogglem0)
http://hertaville.com/2013/09/03/stm32f0discovery-command-line-ide
Tutorial für Windows
Discovering the STM32 Microcontroller von Geoffrey Brown (verwendet stlink)
http://developers.stf12.net/cpp-demo/gcc-linker-script-and-stm32-a-tutorial
http://developers.stf12.net/projects-list
STM32F0-discovery default demo using FreeRTOSv7.5.2, codesourcery arm-gcc, and Eclipse.
- https://sites.google.com/site/stm32discovery/open-source-development-with-the-stm32-discovery/setting-up-eclipse-for-stm32-discovery-development
Mike Szczys, How to develop for STM32 discovery boards using Linux, 10/2011 (verwendet die STLINK Software).
http://hackaday.com/2011/10/17/how-to-develop-for-stm32-discovery-boards-using-linux/
Programming STM32 F2, F4 ARMs under Linux: A Tutorial from Scratch
Mike Szczys, Beginner’s look at On-Chip Debugging, 9/2012
http://hackaday.com/2012/09/27/beginners-look-at-on-chip-debugging/
- Game of snake http://hackaday.com/2012/09/21/classic-game-of-snake-on-an-arm-controller/
Tutorial von Radoslaw Kwiecien. Code jedoch nur für MDK-ARM geschrieben.
All articles with tag "stm32"
STM32/ARM Cortex-M3 HOWTO: Development under Ubuntu (Debian)
JorgeAparicio / bareCortexM, An Eclipse project template for bare metal development of ARM Cortex M processors. https://github.com/JorgeAparicio/bareCortexM Siehe auch andere Sachen: - Terminal Program https://github.com/JorgeAparicio/qSerialTerm - C++ template library for STM32 https://github.com/JorgeAparicio/libstm32pp - https://github.com/JorgeAparicio/libKiCad - STM32F4 https://github.com/JorgeAparicio/F4Dev (kleine Platine mit
STM32F4 und vielen Sensoren (accel, gyro, ...), mit KiCad gezeichnet.
Beispielprogramme von Martin Thomas
http://siwawi.bauing.uni-kl.de/avr_projects/arm_projects/index_cortex.html
Template-Projekte auf Github
This package is for use when compiling programs for STM32F05xx ARM microcontrollers using arm-none-eabi-gcc (I'm using the Code Sourcery G++:Lite Edition toolchain). The Makefile in the main directory will call the Make file in the Libraries directory, thereby automatically building the STM peripheral library. However, running 'make clean' will not affect the peripherals library (the same command can be run from the Libraries directory to do this).
This template will serve as a quick-start for those who do not wish to use an IDE, but rather develop in a text editor of choice and build from the command line. It is based on an example template for the F4 Discovery board put together by Jeremy Herbert.
Die Tutorials basieren auf dem Tutorial von Jeremy Herbert für den F4:
Getting Started with the STM32F4 and GCC (Ubuntu 11.10, summon-arm-toolchain)
- Anwendungsbeispiel:
- http://www.emcu.it/Dog-Cat-Automation/Dog-Cat-Automation.html
Links zu den Templates:
https://github.com/szczys/stm32f0-discovery-basic-template
https://github.com/mblythe86/stm32f3-discovery-basic-template
Sehr detaillierte Artikel von Balau
http://balau82.wordpress.com/2010/02/14/simplest-bare-metal-program-for-arm/ (arm926) http://balau82.wordpress.com/2011/09/03/using-codesourcery-bare-metal-toolchain-for-cortex-m3/
http://balau82.wordpress.com/2010/02/28/hello-world-for-bare-metal-arm-using-qemu/
http://balau82.wordpress.com/2010/12/05/using-ubuntu-arm-cross-compiler-for-bare-metal-programming/
http://balau82.wordpress.com/2010/12/16/using-newlib-in-arm-bare-metal-programs/
darin erwähnt: Developing Software for ARM Processors (DUI0471H_developing_for_arm_processors.pdf)
http://balau82.wordpress.com/2013/08/14/flashing-the-stm32-p152-board-with-openocd/
- Cortex-M3 Assemblerprogrammierung auf dem STM32, 2011 http://pygmy.utoh.org/riscy/cortex/led-stm32.html Der Autor Frank Sergeant hat auch das Pygmy Forth geschrieben, das es auch für den STM32 gibt: http://pygmy.utoh.org/riscy. Es ist auch portiert für TI/LuminaryMicro. preasm.tcl, OpenOCD, Olimex ARM USB Tiny JTAG adaptor, gdb, Emacs, M-x arm-elf-gdb --annotate=3, .gdbinit, Text mit Emacs org-mode geschrieben. http://pygmy.utoh.org/riscy/cortex/
3 Interessante Aufgaben
printf() umsetzen über
- UART
- Semihosting
Retargetting a C Library Function (printf() auf die UART Konsole, mit Keil MDK)
http://doulos.com/knowhow/arm/Retargetting_a_C_library_function/
Stoffsammlung zu printf() über UART
- http://forum.superkato.net/viewtopic.php?t=81
- https://balau82.wordpress.com/2010/12/16/using-newlib-in-arm-bare-metal-programs
- http://www.embedded.com/design/prototyping-and-development/4024867/Embedding-with-GNU-Newlib
- http://e2e.ti.com/support/microcontrollers/stellaris_arm/f/471/t/45015.aspx
- http://koda-karma.blogspot.de/2006/05/newlib-printf-through-uart-on-gnu-arm.html
- http://siwawi.bauing.uni-kl.de/avr_projects/arm_projects/#gcc_stdio
- http://embdev.net/topic/129810
- http://wiki.osdev.org/Porting_Newlib
- Serielle Kommunikation über UART mit Interrupts.
Serieller GDB Debug Stub
siehe z.B. https://groups.google.com/forum/#!topic/diyrovers/GtfSQDLP2_E
Adafruit 1.8" SPI TFT display, 160x128 18-bit color, ST7735R
http://www.adafruit.com/products/618
Von Adafruit gibt es eine Bibliothek für den ST7735, allerdings nur für den Arduino. Gibt es auch Bibliotheken in C?
- Servo Demo (siehe stm32-servo.c und stm32-servo-4.c)
- FreeRTOS Demo
- CMSIS RTOS, a.k.a. "Keil RTX" (BSD Lizenz), Demo mit GCC machen.
STM32Cube (Nachfolger Std-Periph-Lib)
STM32CubeMX (Konfigurationsgenerator)
- Qemu für Cortex-M3 testen
Device Firmware Upgrade Utility, auch für STM32 geeignet
Homepage: http://dfu-util.gnumonks.org
Quelltext der STM32 stdperiph lib untersuchen
Mit find und grep nach einem Namen suchen.
Problematisch ist, dass in manchen Dateinamen ein Leerzeichen ist. Das kann man so umgehen:
find . -name *.c -print0 | xargs -0 grep -i RCC_AHBPeriphClockCmd
Klären:
Wie wurde die Hilfedatei erstellt? Antwort: doxygen
stm32vldiscovery_package/stm32f10x_an3268_fw.chm <-- M$ Format!
Im Quelltext stehen @page, @verbatim, @file, @version, @author, @date, @defgroup, @addtogroup, @brief, @param, @arg, @retval, @note, @copy, ...
Genauso wurde CMSIS dokumentiert.
Lizenzen bei STM32 Projekten prüfen
Codesourcery Compiler kommerziell, teilweise geschlossen (das betrifft CM3 Startup Code). Besser wären
- https://launchpad.net/gcc-arm-embedded
- summon arm toolchain https://github.com/esden/summon-arm-toolchain
- Ubuntu gcc-arm-linux-gnueabi
Lizenz der Std-Periph Lib:
http://www.st.com/software_license_agreement_liberty_v2
besser: CMSIS End User License Agreement
Keil RTX für Cortex M ist unter BSD Lizenz: cmsis_rtos_rtx_v4p70.zip
Keil RTX ist zu CMSIS kompatibel. Sollte man es in die Liste der freien RTOSse für CM3 aufnehmen? (FreeRTOS, ChibiOS, RTX).
4 CMSIS
2014-02-27 | CMSIS Info (sollte in STM32LAB)
Download CMSIS von https://silver.arm.com/browse/CMSIS (mit login/pwd) Aktuelle Version 4.0 (CMSIS-SP-00300-r4p0-00rel0.zip, ca. 63 MByte gross)
Doku von KEIL: - http://www.keil.com/pack/doc/CMSIS/General/html/index.html - http://www.keil.com/pack/doc/CMSIS/Core/html/index.html
enthält "Using CMSIS in embedded applications"
http://www.keil.com/pack/doc/CMSIS/Driver/html/index.html Peripheral Driver Interface
http://www.keil.com/pack/doc/CMSIS/DSP/html/index.html DSP Software Library
http://www.keil.com/pack/doc/CMSIS/RTOS/html/index.html CMSIS RTOS
http://www.keil.com/pack/doc/CMSIS/Pack/html/index.html
"Pack" concept: The Pack Concept supports devices, boards, and software components. It describes the content of a Software Pack in a way that allows development tools to pick-up device or board information and related software components and make it available to the user. Software components can have dependencies to devices or other software components that are part of the same or any other Software Pack.
All files that belong to a Software Pack are compressed into a PACK file using a standard ZIP file format. The content of each Software Pack is described in the Pack Description (DSC) file that is part of each Pack. Refer to Pack Description (PDSC) Format for more information.
http://www.keil.com/pack/doc/CMSIS/SVD/html/index.html CMSIS System View Definition
CMSIS-SVD formalizes the description of the programmer's view for the system contained in ARM Cortex-M processor-based microcontrollers, in particular the memory mapped registers of the peripherals. The detail contained in system view descriptions is comparable to what is found in device reference manuals published by silicon vendors. The information ranges from a high level functional description of a peripheral all the way down to the definition and purpose of an individual bit field in a memory mapped register. CMSIS-SVD files are developed and maintained by the silicon vendors. Silicon vendors manage their descriptions in a central, web-based Device Database and the CMSIS-SVD files are downloadable via a public web interface once they have been released by the silicon vendor. Tool vendors use these descriptions for providing device-specific debug views of peripherals in their debugger. Last but not least CMSIS compliant device header files are generated
CMSIS-RTOS Handbook
5 Notizen
Olimex GCCFD
- Eine Entwicklungsumgebung von Olimex (Eclipse, Yagarto, und so weiter) für Windows.
- Wahrscheinlich heisst das nun ODS = Olimex OpenOCD Development Suite https://www.olimex.com/Products/ARM/JTAG/_resources/OpenOCD/
stm32plus C++ Bibliothek von Andy Brown
https://github.com/andysworkshop/stm32plus.git
Website http://andybrown.me.uk/wk/
- Aktuelle Version 3.1.1: Support für STM32F100 und grössere Bausteine,
- http://andybrown.me.uk/wk/2013/12/28/stm32plus-311/, stm32plus::net
scons
Bauen für VL Discovery mit:
scons mode=fast mcu=f1mdvl hse=8000000
Ergebnis: lib mit etwa 8 MByte:
hhoegl@aspire1:~/STM32/STM32-Baustelle/stm32plus$ ls -l ./lib/build/fast-f1mdvl-8000000/libstm32plus-master-f1mdvl-fast.a -rw-r--r-- 1 hhoegl hhoegl 7799686 Feb 27 16:54 ./lib/build/fast-f1mdvl-8000000/libstm32plus-master-f1mdvl-fast.a
gcc Aufruf beim Bauen:
arm-none-eabi-g++ -o lib/build/fast-f1mdvl-8000000/src/usart/interrupts/Usart2InterruptHandler.o -c -Wextra -Werror -pedantic-errors -fno-rtti -std=gnu++0x -fno-threadsafe-statics -pipe -Wall -Werror -ffunction-sections -fdata-sections -fno-exceptions -mthumb -gdwarf-2 -pipe -DHSE_VALUE=8000000 -mcpu=cortex-m3 -DSTM32PLUS_F1_MD_VL -O3 -Ilib/include -Ilib/include/stl -Ilib lib/src/usart/interrupts/Usart2InterruptHandler.cpp u.s.w.
Jede Menge Tests von Michael Fischer für Cortex-M0, M3, M4
http://www.emb4fun.de/arm/examples/index.html
Hier ist auch das "offizielle" syscalls: http://www.emb4fun.de/download/arm/examples/syscalls.c
Fileinklusion mit Doxygen grafisch veranschaulichen
Dokumente zum gcc-arm-embedded sind in
/opt/gcc-arm-none-eabi-4_7-2013q3/share/doc/gcc-arm-none-eabi/pdf/
Dort sind zu finden:
annotate.pdf binutils.pdf gdbint.pdf ld.pdf libm.pdf as.pdf etc gdb.pdf libc.pdf refcard.pdf bfd.pdf gcc gprof.pdf libiberty.pdf stabs.pdfDie Beschreibung der "newlib" 1.19.0 ist in libc.pdf. Auch die System Calls und Reentrancy sind hier bescrieben.
- Man kann den arm-gcc mit --std=c11 verwenden, dann kennt er aber keine asm() Anweisung mehr. Die funktioniert mit --std=gnu11.
Manche Demos verwenden die Header-Datei "STM32vldiscovery.h". Diese ist nicht in der Std-Periph-Lib enhalten, sondern man findet sie z.B. hier:
FreeRTOSV7.5.3/CORTEX_STM32F100_Atollic/Utilities/STM32_EVAL/STM32_Discovery/STM32vldiscovery.h
In dieser Header Datei ist eine Include-Anweisung, die man korrigieren muss (Kleinschreibung nötig!):
#include "STM32f10x.h"
- Auch die Datei "stm32f10x.h" wird oft importiert, sie kommt von CMSIS::
- STM32F10x_StdPeriph_Lib_V3.5.0/Libraries/CMSIS/CM3/DeviceSupport/ST/STM32F10x/stm32f10x.h