20336
Kommentar:
|
21681
|
Gelöschter Text ist auf diese Art markiert. | Hinzugefügter Text ist auf diese Art markiert. |
Zeile 244: | Zeile 244: |
#. 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 erwaehnt: Developing Software for ARM Processors DUI0471H_developing_for_arm_processors.pdf |
STM32LAB
Zur Dokumentation geht es hier:
http://elk.informatik.hs-augsburg.de/hhweb/labor/arm/stm32lab
1 Neuigkeiten
Es gibt zwei Git Repositories fuer Beispielprogramme:
https://github.com/hsa-embedded/stm32lab
Im Herbst 2014 arbeitet Andreas Schumann an Software-Beispielen, die er in dieses Repository fuellt.
git://hhoegl.informatik.fh-augsburg.de/srv/git/stm32-at-hsa.git
Dieses Repo ist schon etwas aelter und enthaelt meine urspruengliche Sammlung von Programmbeispielen.
2 "Fremde" Programmbeispiele und Tutorials
-
http://www.emcu.it/STM32/STM32Library/TwoWordsConcerningSTM32Library.html
Beispiel STM32DiscoveryUsart.zip
http://www.keytosmart.com/programming-stm32-usart-gcc-tools-part-1
http://www.keytosmart.com/programming-stm32-usart-gcc-tools-part-2/
Beispiel STM32DiscoveryInterrupts.zip
Tutorials auf embedds.com
- Liste der Cortex-M3/STM32 Tutorials: 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)
Using STM32 discovery kits with open source tools (stlink, summon-arm-toolchain, Chibios)
https://raw.github.com/texane/stlink/master/doc/tutorial/tutorial.pdf
STM32 Tutorial von Diller Technologies (CooCox, CoIDE)
Flashing the STM32VL with stlink, http://gpio.kaltpost.de/?page_id=148
Using the USART, http://gpio.kaltpost.de/?page_id=167
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 fuer 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
STLINK
http://hackaday.com/2011/10/17/how-to-develop-for-stm32-discovery-boards-using-linux/
- http://www.triplespark.net/elec/pdev/arm/stm32.html
- 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/
- 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
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
- http://www.mikrocontroller.net/articles/STM32
Template-Projekte auf Github
- https://github.com/szczys/stm32f0-discovery-basic-template
- https://github.com/mblythe86/stm32f3-discovery-basic-template
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 fuer 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
3 To Do
URL: http://elk.informatik.hs-augsburg.de/hhwiki/es2todo
printf() umsetzen ueber
- 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/
- 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)
- STM32Cube (Nachfolger Std-Periph-Lib), STM32CubeMX (Konfigurationsgenerator)
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 erwaehnt: Developing Software for ARM Processors
DUI0471H_developing_for_arm_processors.pdf
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
enthaelt "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 (.PDSC) 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
5 Materialsammlung
Viele Fundsachen zum STM32:
Eclipse zur Entwicklung fuer 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
- Eine Entwicklungsumgebung von Olimex (Eclipse, Yagarto, und so weiter) fuer 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 fuer STM32F100 und groessere Bausteine, http://andybrown.me.uk/wk/2013/12/28/stm32plus-311/, stm32plus::net
scons
Bauen fuer 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 fuer Cortex-M0, M3, M4
http://www.emb4fun.de/arm/examples/index.html
Hier ist auch das "offizielle" syscalls:
printf() ueber 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
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.pdf
Die 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 noetig!):
#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