16166
Kommentar:
|
261
|
Gelöschter Text ist auf diese Art markiert. | Hinzugefügter Text ist auf diese Art markiert. |
Zeile 20: | Zeile 20: |
Neuigkeiten ----------- 1. Es gibt drei Git Repositories mit Beispielprogrammen: a. https://github.com/hsa-embedded/stm32lab Im Herbst 2014 arbeitet Andreas Schumann an Software-Beispielen, die er in dieses Repository füllt. Siehe auch http://andreas-schumann.eu/stm32lab/. b. `<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. c. https://r-n-d.informatik.hs-augsburg.de:8080/ferdinand.saufler/hsa-pyboard Neuestes Repo, in dem auch das HSA-Pyboard und der aktuelle Stand der Beispielprogramme ist. #. STM32 Forum https://my.st.com/public/STe2ecommunities/mcu/Lists/cortex_mx_stm32/AllItems.aspx #. 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 Interessante Aufgaben --------------------- 1. ``printf()`` umsetzen über - UART - Semihosting - Newlib-nano 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. #. Chibios Demo (HAL) #. 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 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). #. CMSIS-RTOS Demo machen. #. Neue Features in C99 (-std=c99, -std=gnu99) und C11 (--std=c11, --std=gnu11) testen. #. Bei einem vorhandenen Projekt die CMSIS 1.x gegen die neue CMSIS Version 4.2 austauschen. #. Mit pyOCD debuggen ueber CMSIS-DAP: - http://developer.mbed.org/blog/entry/Debugging-from-GDB-using-pyOCD/ - https://github.com/mbedmicro/pyOCD - http://embeddedworldweb.blogspot.co.uk/2013/12/debugging-pyocd-and-gdb-tutorial.html - http://developer.mbed.org/handbook/CMSIS-DAP #. Newlib-nano statt der gewoehnlichen newlib in gcc-arm-embedded verwenden. #. Testprogramme fuer gcc-arm-embedded: cpp, fpin, fpout, minimum, qemu, retarget, semihost. Erlaeutern auch die Verwendung der newlib-nano. https://github.com/jhgorse/gcc-arm-none-eabi_samples/tree/master/samples/src #. In der STM32Cube Software fuer STM32F4 wird FreeRTOS mit dem CMSIS-RTOS API verwendet. Eine Demo waere schoen. CMSIS ----- 2014-11-07 | Getting started with CMSIS - The Cortex Microcontroller Software Interface Standard http://www.doulos.com/knowhow/arm/CMSIS/ https://www.doulos.com/knowhow/arm/Cortex-M3_CMSIS_programming/ https://www.doulos.com/knowhow/arm/Programming_the_MCBSTM32_Evaluation_Board/ 2014-02-27 | CMSIS Info http://www.arm.com/products/processors/cortex-m/cortex-microcontroller-software-interface-standard.php 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 * Template files file:///home/hhoegl/CMSIS4.2/CMSIS/Documentation/Core/html/_templates_pg.html * CMSIS "Handbücher" auf mbed.org - RTOS Handbook https://mbed.org/handbook/CMSIS-RTOS - CMSIS-DAP http://developer.mbed.org/handbook/CMSIS-DAP * CMSIS DSP API, FIR Filter Design mit SciPy (Scientific Python) http://developer.mbed.org/handbook/SciPy-FIR-Filter Notizen ------- 1. 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 #. Fileinklusion mit Doxygen grafisch veranschaulichen http://stackoverflow.com/questions/1190597/open-source-tool-to-visualize-c-c-header-file-dependencies #. Dokumente zum gcc-arm-embedded sind in /opt/gcc-arm-none-eabi-4_8-2014q2/share/doc/gcc-arm-none-eabi/pdf Die einzelnen Dokumente sind:: 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. Die Texinfo Doku ist hier:: /opt/gcc-arm-none-eabi-4_8-2014q2/share/doc/gcc-arm-none-eabi/info #. 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 #. Pflichtlektuere: http://community.arm.com/welcome Fremde Beispiele ---------------- * `<STM32LAB-Examples>`_ Alternative Projekte -------------------- * http://www.arm.com/support/university/educators/embedded/index.php?tab=Freescale+Freedom |