<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://wiki.sgmk-ssam.ch/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=0rel</id>
	<title>SGMK-SSAM-WIKI - User contributions [en]</title>
	<link rel="self" type="application/atom+xml" href="https://wiki.sgmk-ssam.ch/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=0rel"/>
	<link rel="alternate" type="text/html" href="https://wiki.sgmk-ssam.ch/wiki/Special:Contributions/0rel"/>
	<updated>2026-07-22T01:07:00Z</updated>
	<subtitle>User contributions</subtitle>
	<generator>MediaWiki 1.41.0</generator>
	<entry>
		<id>https://wiki.sgmk-ssam.ch/index.php?title=File:ProtokollGV2018.pdf&amp;diff=10569</id>
		<title>File:ProtokollGV2018.pdf</title>
		<link rel="alternate" type="text/html" href="https://wiki.sgmk-ssam.ch/index.php?title=File:ProtokollGV2018.pdf&amp;diff=10569"/>
		<updated>2022-12-05T10:10:46Z</updated>

		<summary type="html">&lt;p&gt;0rel: 0rel uploaded a new version of File:ProtokollGV2018.pdf&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;File uploaded with MsUpload&lt;/div&gt;</summary>
		<author><name>0rel</name></author>
	</entry>
	<entry>
		<id>https://wiki.sgmk-ssam.ch/index.php?title=Projects&amp;diff=10303</id>
		<title>Projects</title>
		<link rel="alternate" type="text/html" href="https://wiki.sgmk-ssam.ch/index.php?title=Projects&amp;diff=10303"/>
		<updated>2022-05-29T09:00:14Z</updated>

		<summary type="html">&lt;p&gt;0rel: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== [[3rd Party Boards]] ==&lt;br /&gt;
Getting started with different Boards&lt;br /&gt;
&lt;br /&gt;
== [[E-bow (Ralf)]] ==&lt;br /&gt;
&lt;br /&gt;
== [[DIY Solder Mask]] ==&lt;br /&gt;
&lt;br /&gt;
== [[Ralf&#039;s Piezo-Amp]] ==&lt;br /&gt;
&lt;br /&gt;
[[File:Piezo_pre_workshop_circuit.jpeg|400px|link=Ralf&#039;s Piezo-Amp]]&lt;br /&gt;
&lt;br /&gt;
== [[Pimp Up Your Volca]] ==&lt;br /&gt;
[[File:IMG_20191210_121029~2.jpg|400px|link=Pimp Up Your Volca]]&lt;br /&gt;
&lt;br /&gt;
== [[Gcode 2d-plotter]] ==&lt;br /&gt;
&lt;br /&gt;
Based on GCodeToAnalog board by GaudiLabs: https://github.com/GaudiLabs/GCodeToAnalog&lt;br /&gt;
&lt;br /&gt;
== [[DIY LED-NEON Signs]] ==&lt;br /&gt;
[[File:AllSign_mechartlab.jpg|400px|link=DIY_LED-NEON_Signs]]&lt;br /&gt;
&lt;br /&gt;
== [[PCB tinning]] ==&lt;br /&gt;
[[File:pcb_before_and_after_tinning.JPG|320px|link=PCB_tinning]]&lt;br /&gt;
&lt;br /&gt;
== [[Volx Micro Mechanic Macintosh Monitor]] ==&lt;br /&gt;
[https://www.flickr.com/photos/haus-ek/24444823599/in/album-72157663717666630/ Photos H3K]&lt;br /&gt;
&lt;br /&gt;
== [[Motörheadz]] ==&lt;br /&gt;
[[File:MotörheadzEntwurf.jpg|320px|link=Motörheadz]]&lt;br /&gt;
&lt;br /&gt;
== [[BalanZBot]] ==&lt;br /&gt;
[[File:BalanZeBot_Prototyp.jpg|320px|link=BalanZBot]]&lt;br /&gt;
&lt;br /&gt;
== [[MicMacMC]] ==&lt;br /&gt;
[[File:MicMacMc_Set.jpg|320px|link=MicMacMC]]&lt;br /&gt;
&lt;br /&gt;
== [[SmartHomeNightLight]] ==&lt;br /&gt;
[[File:SmartHome_NightLight.pdf|320px|link=SmartHomeNightLight]]&lt;br /&gt;
&lt;br /&gt;
== [[IoT Clock]] ==&lt;br /&gt;
That blinky thing hanging over the door now.&lt;br /&gt;
&lt;br /&gt;
The web app to control it:&lt;br /&gt;
https://iot-clock2.appspot.com/&lt;br /&gt;
&lt;br /&gt;
== [[Arduino Uno R3 as HID]] ==&lt;br /&gt;
Turning the Arduino UNO R3 into a HID is very easy. But the documentation on the web just sucks. Get the recipe here at SGMK.&lt;br /&gt;
&lt;br /&gt;
== [[Elektronisches Heimatwerk Luzern 28.2.-10.3.2013]] ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== [[Workshopology]] ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== [[WatchOut]] ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== [[Thermal IR-Camera]] ==&lt;br /&gt;
[[File:ThermalCam_PD.png|320px|link=Thermal_IR-Camera]]&lt;br /&gt;
&lt;br /&gt;
== [[SGMKmorseAttacks]] ==&lt;br /&gt;
[[File:P1080620.JPG|320px|link=SGMKmorseAttacks]]&lt;br /&gt;
&lt;br /&gt;
== [[CyberDudelsack]] ==&lt;br /&gt;
&lt;br /&gt;
== [[SGMKtiny]] ==&lt;br /&gt;
&lt;br /&gt;
== [[SGMKduino]] ==&lt;br /&gt;
[[File:SGMKduino_v3_web.png|320px|link=SGMKduino]]&lt;br /&gt;
&lt;br /&gt;
== [[Gnusbuino]] ==&lt;br /&gt;
[[File:Gnusbuino_pcb.gif|320px|link=Gnusbuino]]&lt;br /&gt;
&lt;br /&gt;
The Gnusbuino is an adaption of Michael Egger&#039;s gnusb that is (more or less) compatible with the Arduino environment.&lt;br /&gt;
It uses the V-USB virtual USB driver from obdev.at instead of a dedicated USB chip (FTDI on the Arduino) - is thus a lot easier and cheaper to build oneself - very few components, single sided PCB…&lt;br /&gt;
It has a bootloader and can programmed directly through USB. It can mimic many devices (like the USBasp AVR programmer or a standard USB-MIDI interface). &lt;br /&gt;
&lt;br /&gt;
Offspring:&lt;br /&gt;
*[[Midignusbuino]] - Arduino compatible USB-MIDI controller / interface&lt;br /&gt;
*[[Babygnusbuino]] - ridiculously small bare-bones Arduino&lt;br /&gt;
* [https://github.com/mirdej/gnusbuino/tree/gnusbuino88 Gnusbuino88] Atmega88 version&lt;br /&gt;
*[[Babygnusbuino-v2]] - more free pins on already ridiculously small bare-bones Arduino&lt;br /&gt;
* [[Babymidimultiplexgnusbuino]] - 8 channel MIDI controller&lt;br /&gt;
* [[8bit Mix Tape]] &lt;br /&gt;
[[File:Babygnusbuino.jpg|400px]]&lt;br /&gt;
&lt;br /&gt;
== [[Postduino]] and related Fantasies ==&lt;br /&gt;
&lt;br /&gt;
Discussions at the anyma research week 2014, after hours and hours of discussions, late night fights and yelling, nightmares and fantasies about what comes after the arduino.... cheap, simple, easy to make? or next level shit using arm-processors? more pins / less pins? fuck attiny85 forever? what about the 32u4 chip? or just buy the [http://arduino.cc/en/Main/arduinoBoardMicro arduino micro]? or should we just use the [[Gnusbuino]], as we always had? or what about that Atmega88 chip? or, or, or, or,...&lt;br /&gt;
&lt;br /&gt;
== [[8bit Mix Tape]] ==&lt;br /&gt;
[[File:8bit_mixedTapev02.jpg|left|400px|link=8bit_Mix_Tape]] {{#widget:Vimeo|id=58727965}}&lt;br /&gt;
&lt;br /&gt;
The 8bit MixTape is an arduino compatible sound gadget, based on the BabyGnusbuino ([http://www.anyma.ch/blogs/research/ anyma]) and [http://youtube.com/watch?v=GtQdIYUtAHg Viznut&#039;s &amp;quot;Algorithmic symphonies from one line of code&amp;quot;], put together by dusjagr, [http://lifepatch.org/ ucok] and iyok...&lt;br /&gt;
&lt;br /&gt;
New version, v0.2, nicely fits into a tape, with battery, USB programming interface, LEDs and a button to choose different codes.&lt;br /&gt;
&lt;br /&gt;
links:&lt;br /&gt;
http://youtube.com/watch?v=GtQdIYUtAHg&lt;br /&gt;
http://wurstcaptures.untergrund.net/music/&lt;br /&gt;
http://wiki.sgmk-ssam.ch/index.php/Babygnusbuino&lt;br /&gt;
&lt;br /&gt;
== [[DIY Micro Laser Cutter]] ==&lt;br /&gt;
&lt;br /&gt;
Step by Step Instruction for building your DIY Laser Cutter.&lt;br /&gt;
&lt;br /&gt;
== little cutie code snippets ==&lt;br /&gt;
* [[tone sweep arduino]] combine with a maotor driver or mosfet for speakers + maizena&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== [[20_pix display]] ==&lt;br /&gt;
&lt;br /&gt;
{{#widget:Vimeo|id=10895002}}&lt;br /&gt;
&lt;br /&gt;
[[Category:Projects]]&lt;br /&gt;
&lt;br /&gt;
== [[Vive la Resistance aka NanoSmano Sajica]] ==&lt;br /&gt;
[[File:sajica_circuit.jpg|320px|link=Vive_la_Resistance_aka_NanoSmano_Sajica]]&lt;br /&gt;
&lt;br /&gt;
== [[Shruti Hacking  - Radel Nano Dx]] ==&lt;br /&gt;
Instruction on how to digitally hack the legendary Indian musical instruments by Radel. Radel Electronics Pvt. Ltd. is the pioneer in the field of electronic musical instruments for Indian music. &amp;lt;br&amp;gt;&lt;br /&gt;
[[File:shruti_hack.jpg|140px|link=Shruti_Hacking__-_Radel_Nano_Dx]]&lt;br /&gt;
&lt;br /&gt;
== [[microRing]] ==&lt;br /&gt;
&lt;br /&gt;
The Idea is to generate two squarewaves with two NAND-Gatters of a 4093 IC and use the other two NAND as an XOR stage. The two waveforms are then send as inputs to the XOR and we have a Ring Modulation. Best of it, it&#039;s all on just one 4093. The additional parts are also very easy.&lt;br /&gt;
&lt;br /&gt;
== [[microNAND]] ==&lt;br /&gt;
&lt;br /&gt;
This Circuit is the result of the first try to build the microRing described above. Due to some misonceptions, this circuit is not a ring modulator, but nevertheless sounds great. So i leave this stuff on.&lt;br /&gt;
&lt;br /&gt;
{{#widget:Vimeo|id=72336145}}&lt;br /&gt;
&lt;br /&gt;
== [[micronoise]] ==&lt;br /&gt;
[[File:mask_engl.png|320px|link=Micronoise]]&lt;br /&gt;
&lt;br /&gt;
== [[micronoise pro]] ==&lt;br /&gt;
&lt;br /&gt;
the micronoise pro is a further development of the original micronoise. it uses all 4 NAND gates of the 4093 chip.&lt;br /&gt;
&lt;br /&gt;
[[File:micronoise_pro.jpg|320px|link=micronoise_pro]]&lt;br /&gt;
&lt;br /&gt;
== [[8step sequencer]] ==&lt;br /&gt;
&lt;br /&gt;
some designs of simple 8step sequencers based on the 4022 chip&lt;br /&gt;
&lt;br /&gt;
[[File:Modula_seq_small.jpg|320px|link=8step_sequencer]]&lt;br /&gt;
&lt;br /&gt;
== [[SinkDriverArduinoShield]] ==&lt;br /&gt;
[[File:ArduinoPOWERshield-1.jpg|320px|link=SinkDriverArduinoShield]]&lt;br /&gt;
&lt;br /&gt;
== [[CapSense (QTouchADC)]] ==&lt;br /&gt;
&lt;br /&gt;
== [[Fermento Mods]] ==&lt;br /&gt;
&lt;br /&gt;
== Masken ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== BitBadge ===&lt;br /&gt;
&lt;br /&gt;
[[File:BitBadge_2014.pdf]]&lt;br /&gt;
&lt;br /&gt;
[[Category:Projects]]&lt;br /&gt;
&lt;br /&gt;
== Bits&amp;amp;Bytes ==&lt;br /&gt;
&lt;br /&gt;
[[processingDataDDisplay]]&lt;br /&gt;
&lt;br /&gt;
== [[EtchingBox]] ==&lt;br /&gt;
A mobile PCB etching station&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== [[Dual TBridge Percussion]] ==&lt;br /&gt;
&lt;br /&gt;
Dual Electronic Percussion based on the TBridge Circuit&lt;br /&gt;
&lt;br /&gt;
[[File:dualTbridge.JPG|300px|link=Dual_TBridge_Percussion]]&lt;br /&gt;
&lt;br /&gt;
== [[CocoTeens7 - Hit The Tune]] ==&lt;br /&gt;
[[File:CocoTeens7_HitTheTune_front.jpg|400px|link=CocoTeens7_-_Hit_The_Tune]]&lt;br /&gt;
&lt;br /&gt;
== [[Shenzhen Ready]] ==&lt;br /&gt;
[[File:IMG_20160518_102335.jpg|400px|link=Shenzhen_Ready]]&lt;br /&gt;
&lt;br /&gt;
== [[Electronic Voodoo Doll Advanced]] ==&lt;br /&gt;
[[File:voodoo.jpg|400px|link=Electronic_Voodoo_Doll_Advanced]]&lt;br /&gt;
&lt;br /&gt;
== [[Simple Theremin]] ==&lt;br /&gt;
[[File:Simple_theremin_case.jpg|400px|link=Simple_Theremin]]&lt;br /&gt;
&lt;br /&gt;
== [[LDR - Cell Phone Door Opener]] ==&lt;br /&gt;
[[File:DoorOpener.jpg|400px|link=LDR_-_Cell_Phone_Door_Opener]]&lt;br /&gt;
&lt;br /&gt;
== [[Pixel drift]] ==&lt;br /&gt;
[[File:Pixel_drift_earphones.jpg|400px|link=Pixel_drift]]&lt;br /&gt;
&lt;br /&gt;
== [[Solar bird]] ==&lt;br /&gt;
[[File:solarbird_pcb_top_400x1000.png|x400px|link=Solar_bird]]&lt;br /&gt;
&lt;br /&gt;
== [[Krabbenarm]] ==&lt;br /&gt;
[[File: Krabbenarm_Render.png|400px]]&lt;br /&gt;
A better helping hand. Very easy to build DIY version.&lt;br /&gt;
&lt;br /&gt;
==[[ELVESolar]]==&lt;br /&gt;
[[File:Toolelf.jpeg|200px|thumb|left|toolboxELVES]]&lt;br /&gt;
&lt;br /&gt;
Solar Upgrade Kits for vintage Swiss Army flashlights&lt;/div&gt;</summary>
		<author><name>0rel</name></author>
	</entry>
	<entry>
		<id>https://wiki.sgmk-ssam.ch/index.php?title=KIBLIX_2011_-_Organisational_Team&amp;diff=10066</id>
		<title>KIBLIX 2011 - Organisational Team</title>
		<link rel="alternate" type="text/html" href="https://wiki.sgmk-ssam.ch/index.php?title=KIBLIX_2011_-_Organisational_Team&amp;diff=10066"/>
		<updated>2021-12-21T03:11:19Z</updated>

		<summary type="html">&lt;p&gt;0rel: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Core Team==&lt;br /&gt;
&lt;br /&gt;
=== Dejan Pestotnik (SI) - KIBLA ===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Producer and managing director&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Dejan Pestotnik is Multimedia producer, Vice president of Multimedia&lt;br /&gt;
Center KIBLA (Maribor, Slovenia). As a manager he is working on EU&lt;br /&gt;
projects (IST, FP6, FP7, EU Culture, EU Structural Founds,…). With his&lt;br /&gt;
work, he is managing promotion of contemporary art production, focused on&lt;br /&gt;
multimedia and intermedia art on international level (contemporary art&lt;br /&gt;
exhibitions, presentations, strategic communications, found raising,&lt;br /&gt;
sponsorships) and connecting culture with business sector. He is author of&lt;br /&gt;
Marketing, strategic communication and promotion document for Maribor&lt;br /&gt;
candidacy for European Capital of Culture 2012 under KIBLA production.&lt;br /&gt;
Maribor was selected for this title in a competition of 4 Slovenian&lt;br /&gt;
cities. Also author of several articles about cultural management and new&lt;br /&gt;
media art production in national and international media.&lt;br /&gt;
&lt;br /&gt;
=== Marc Dusseiller (CH) - SGMK / Hackteria ===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Festival coordinator and curator for educational program &#039;&#039; &lt;br /&gt;
&lt;br /&gt;
Marc R. Dusseiller is a transdisciplinary scholar, lecturer for micro- and nanotechnology, cultural facilitator and artist. He works in an integral way to combine science, art and education. He performs DIY-workshops in lo-fi electronics, music and robotics, has made various short movies and is currently developing means to perform biological science (Hackteria | Open Source Biological Art) in a DIY fashion in your kitchen or your atelier. He is also co-organizing Dock18, Room for Mediacultures, and various other engagments like the diy* festival, national and international workshops for both artists and schools and children as the president of the Swiss Mechatronic Art Society, SGMK.&lt;br /&gt;
&lt;br /&gt;
links:&lt;br /&gt;
&lt;br /&gt;
[http://www.dusseiller.ch/labs dusjagr labs]&lt;br /&gt;
&lt;br /&gt;
[http://www.mechatronicart.ch Swiss Mechatronic Art Society]&lt;br /&gt;
	&lt;br /&gt;
[http://hackteria.org Hackteria | Open Source Biological Art]&lt;br /&gt;
&lt;br /&gt;
=== Miha Horvat (SI) - son:DA ===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Festival coordinator - adviser for exhibition and education&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Miha Horvat holds BA from ethnology and cultural anthropology at Faculty of arts Ljubljana. He studied film-directing at AGRFT in Ljubljana and at film school in UAD Helsinki. He finished his MA at University of applied arts Vienna and is currently a pDH-candidate at University in Koper at department of Philosophy and theory of visual culture. Since 2000 he&#039;s part of artistic alliance son:DA and of the off-space garage projects. In 2009 son:DA became a foundation for theory and practice of audio-visual art.  &lt;br /&gt;
&lt;br /&gt;
More on http://sonda.kibla.org&lt;br /&gt;
&lt;br /&gt;
=== Pei-Wen Liu (TW/CH) - SGMK / playaround.cc ===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;International coordinator and curator for sound &amp;amp; performances and exhibition&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Pei has dabbled in a variety of digital domains, but has concentrated on soundscape, composition and streaming video art since 1999. Her work has been influenced by neo-dada, freeform jazz as well as avant-garde electronic musicians and minimalist painter/composers. She made music pieces for radio, animation, dance,theatre projects and installations as well organising and performing at experimental electronic music events. One of her radio piece &amp;gt; un canny &amp;lt; received Honorary Mention of Digital Music in Ars Electronic 2007.&lt;br /&gt;
&lt;br /&gt;
[http://www.little-object.com little object]&lt;br /&gt;
&lt;br /&gt;
[http://2010.playaround.cc/ playaround.cc]&lt;br /&gt;
&lt;br /&gt;
=== Monika Pocrnjić (SI) - KIBLIX ===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Local coordinator and co-curator for student/educational program&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
=== Urs Gaudenz (CH) - SGMK ===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Coordinator SGMK, Laboratory coordination, Co-Curation&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== tba, someone local,  ===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;tech/hacker/enthusiast&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
== KIBLA team ==&lt;br /&gt;
&lt;br /&gt;
=== Communication ===&lt;br /&gt;
&lt;br /&gt;
=== Website, IT infrastructure&lt;br /&gt;
&lt;br /&gt;
=== Finances ===&lt;br /&gt;
&lt;br /&gt;
Aleksandra&lt;br /&gt;
&lt;br /&gt;
=== General Helpers ===&lt;br /&gt;
&lt;br /&gt;
== SGMK team ==&lt;br /&gt;
&lt;br /&gt;
=== Markus Haselbach (CH) - SGMK ===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Financial Management Swiss side&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
wont come to Maribor&lt;br /&gt;
&lt;br /&gt;
=== Effi Tanner (CH) - SGMK ===&lt;br /&gt;
&lt;br /&gt;
=== Christoph Stähli (CH) - SGMK ===&lt;br /&gt;
&lt;br /&gt;
=== not confirmed ===&lt;br /&gt;
&lt;br /&gt;
==== Maki3000 (CH) - SGMK ====&lt;br /&gt;
&lt;br /&gt;
== Volunteers ==&lt;br /&gt;
&lt;br /&gt;
they&#039;ll get a free t-shirt, food and a day fee (20€)&lt;br /&gt;
&lt;br /&gt;
=== Marysa ===&lt;br /&gt;
&lt;br /&gt;
=== Spela ===&lt;br /&gt;
&lt;br /&gt;
=== Maja ===&lt;br /&gt;
&lt;br /&gt;
== External Partners ==&lt;br /&gt;
&lt;br /&gt;
=== Aleš Loren (US/SI) ===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;External advisor&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
=== Robertina šebjanič - Ljudmila ===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;External advisor and Ljudmila partner for Theremin&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
=== Gorazd Pleninsic, needs to be confirmed ===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;External advisor, phyisics education&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
=== Dusan Zidar ===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;External advisor&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Organisational Structure and Management ==&lt;br /&gt;
&lt;br /&gt;
we need a diagramm...&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Festival Core Management ===&lt;br /&gt;
&lt;br /&gt;
Dejan, Marc&lt;br /&gt;
&lt;br /&gt;
=== General Maribor Coordination ===&lt;br /&gt;
&lt;br /&gt;
Miha, Dejan&lt;br /&gt;
&lt;br /&gt;
=== International Artist Coordination and Communication ===&lt;br /&gt;
&lt;br /&gt;
Pei, KIBLA (who)&lt;br /&gt;
&lt;br /&gt;
=== Maribor Educational Programm ===&lt;br /&gt;
&lt;br /&gt;
Monika, Miha, Marc&lt;br /&gt;
&lt;br /&gt;
=== SGMK &amp;lt;-&amp;gt; KIBLIX coordination and finances ===&lt;br /&gt;
&lt;br /&gt;
Marc, Urs, Markus&lt;br /&gt;
&lt;br /&gt;
=== Workshop Coordination ===&lt;br /&gt;
&lt;br /&gt;
==== preparation ====&lt;br /&gt;
Pei, Marc, KIBLA (who)&lt;br /&gt;
&lt;br /&gt;
==== registration and organisation ====&lt;br /&gt;
&lt;br /&gt;
KIBLA&lt;br /&gt;
&lt;br /&gt;
=== Symposia ===&lt;br /&gt;
==== Workshopology ====&lt;br /&gt;
&lt;br /&gt;
Marc, chair still open&lt;br /&gt;
&lt;br /&gt;
==== Artist Presentation / Unconference ====&lt;br /&gt;
&lt;br /&gt;
???&lt;br /&gt;
&lt;br /&gt;
=== Exhibition ===&lt;br /&gt;
&lt;br /&gt;
Miha, Pei?, KIBLA (who)&lt;br /&gt;
&lt;br /&gt;
=== Locations for KIBLIX ===&lt;br /&gt;
&lt;br /&gt;
Miha, KIBLA (who)&lt;br /&gt;
&lt;br /&gt;
=== Public Communication ===&lt;br /&gt;
&lt;br /&gt;
Dejan, Marc, Snejena&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Food and Hospitality ===&lt;br /&gt;
&lt;br /&gt;
??&lt;br /&gt;
&lt;br /&gt;
=== Accommodation ===&lt;br /&gt;
&lt;br /&gt;
Miha, KIBLA (who), Monika&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Finances and Accounting ===&lt;br /&gt;
&lt;br /&gt;
Dejan, Markus, KIBLA (who)&lt;br /&gt;
&lt;br /&gt;
=== Visit Coordination and Translation for dimension+ ===&lt;br /&gt;
&lt;br /&gt;
Ida, Pei, Marc&lt;br /&gt;
&lt;br /&gt;
=== Website, IT ===&lt;br /&gt;
&lt;br /&gt;
Tobi?, KIBLA (who)&lt;/div&gt;</summary>
		<author><name>0rel</name></author>
	</entry>
	<entry>
		<id>https://wiki.sgmk-ssam.ch/index.php?title=HOME_MADE_2012_Participants&amp;diff=9512</id>
		<title>HOME MADE 2012 Participants</title>
		<link rel="alternate" type="text/html" href="https://wiki.sgmk-ssam.ch/index.php?title=HOME_MADE_2012_Participants&amp;diff=9512"/>
		<updated>2021-04-19T18:09:03Z</updated>

		<summary type="html">&lt;p&gt;0rel: /* orl */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;List of Homemade 2012 participants, use prename or online handle as you like. Note that any information given is publicly available.&lt;br /&gt;
&lt;br /&gt;
Write about your projects and wishes, what you will bring and what you will need, what you know and want to share/present/do a workshop, what you want to learn, if you need a lift to ticino or have free space in your car, etc.&lt;br /&gt;
&lt;br /&gt;
== Anna ==&lt;br /&gt;
&lt;br /&gt;
Will be there with my daughter- so no &amp;quot;big projects&amp;quot; planned- just doing some fun children&#039;s stuff with her or ralf&#039;s &amp;quot;analog birds&amp;quot;&lt;br /&gt;
&lt;br /&gt;
I&#039;ll bring motors, LEDs, toys, cardboard,lots of paper, paint&amp;amp;markers. Could bring a &amp;quot;Dremel-tool&amp;quot; if needed...&lt;br /&gt;
&lt;br /&gt;
We would like to join a &amp;quot;shuttle&amp;quot; from Melide on Sunday afternoon. 12:09 train from Zurich arrives 15:05 in Melide.&lt;br /&gt;
&lt;br /&gt;
== Oli ==&lt;br /&gt;
&lt;br /&gt;
Will bring: hackable shruti-1 Synth, other sound stuff&lt;br /&gt;
&lt;br /&gt;
Workshop: simple 8 Step sequencer for cv &amp;amp; gate&lt;br /&gt;
&lt;br /&gt;
Projects: PCB for VCA/Envelope Modul (SGMK modular synth), microcontroller step sequencer&lt;br /&gt;
&lt;br /&gt;
== Jördis ==&lt;br /&gt;
will bring VolxTV kits &amp;amp; show the assembly in workshops if wanted.&lt;br /&gt;
see main page workshops.&lt;br /&gt;
&lt;br /&gt;
== Stahl ==&lt;br /&gt;
&lt;br /&gt;
Will bring: two ARM boards, st32f4discovery and beaglebone. lot&#039;s of attiny13 and attiny85, more.&lt;br /&gt;
&lt;br /&gt;
Share/Workshop: SGMKTinyuiouino see [[Hands On AVR]]&lt;br /&gt;
&lt;br /&gt;
Projects: development of a software synth on the stm32f4discovery. Need help in low level C programming.&lt;br /&gt;
&lt;br /&gt;
== dusjagr ==&lt;br /&gt;
&lt;br /&gt;
Yeah...&lt;br /&gt;
&lt;br /&gt;
== Urbi ==&lt;br /&gt;
&lt;br /&gt;
Maybe I will just join some other projects and forget about these ideas! I will take my E-double-bass with me, ready to try out some new filters and distorters!, and to join some jam sessions?&lt;br /&gt;
&lt;br /&gt;
Ideas to join or quit:&lt;br /&gt;
1. MakeArt! 2. EpsonPrinter TO Laser/Cutter 3. pulsed infraread instrument pickup 4. LED as Sensor Experiments&lt;br /&gt;
&lt;br /&gt;
Share/Workshop: I will bring some material and a sample program to try out microcontroller programming for [http://www.mechatronicart.ch/diymakeaway/solarbird the digital version of the solar bird].&lt;br /&gt;
Share/Test: test a digital LFO module.&lt;br /&gt;
&lt;br /&gt;
== Veli ==&lt;br /&gt;
&lt;br /&gt;
Audio; Making a PCB for delay/hall/echo using the PT2395 with external RAM chip plus noise hacks. If possible providing kits for a Workshop.&lt;br /&gt;
&lt;br /&gt;
Repair my sequencer made in Gais last year.&lt;br /&gt;
&lt;br /&gt;
Like to build SGMK&#039;s hi-/lo-pass filter.&lt;br /&gt;
&lt;br /&gt;
Digital; Programming the QGO sending MIDI to Siduino.&lt;br /&gt;
&lt;br /&gt;
== Pei &amp;amp; Tobias (kiilo) ==&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;kiilo&#039;&#039;&#039;&lt;br /&gt;
Prototyping for Internet of Thing, will bring [http://www.raspberrypi.org raspberry pi], [http://beagleboard.org/bone beagleboard], [http://www.arduino.cc arduino], lots of plugable code snippets.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;pei&#039;&#039;&#039;&lt;br /&gt;
Observer and writer on a series of mediaLab worldwide, 11 articles will publish in Mandarin on [http://www.digiarts.org.tw/ National Taiwan Museum of Fine Art&#039;s Tech and digital art portal]&lt;br /&gt;
&lt;br /&gt;
List of MediaLab : &lt;br /&gt;
&lt;br /&gt;
[http://access-space.org * access space (Sheffield, UK)]&lt;br /&gt;
&lt;br /&gt;
[http://www.mechatronicart.ch * SGMK (Zurich, CH)]&lt;br /&gt;
&lt;br /&gt;
[http://www.natural-fiber.com * HONF (Yogyakarta, ID)]&lt;br /&gt;
&lt;br /&gt;
[http://www.ljudmila.si * Ljudmila (Ljubljana, SI)]&lt;br /&gt;
&lt;br /&gt;
[http://www.openlabtaipei.org * OpenLabTaipei (TW)]&lt;br /&gt;
&lt;br /&gt;
[http://hackteria.org * Hackteria (Int&#039;l)]&lt;br /&gt;
&lt;br /&gt;
[http://www.studioxx.org Studio XX] / [http://www.articule.org Articule] / [http://foulab.org Foulab (Montreal, CA)]&lt;br /&gt;
&lt;br /&gt;
[http://c-base.org * C-base] / [http://ccc.de CCC (Berlin, DE)]&lt;br /&gt;
&lt;br /&gt;
[http://www.nycresistor.com * Resistor (NY, US)]&lt;br /&gt;
&lt;br /&gt;
[http://medialab-prado.es * MediaLab Prado (Madrid, SP)]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== orl ==&lt;br /&gt;
&lt;br /&gt;
&amp;gt; ESc r&amp;amp;d&lt;br /&gt;
*) exe cut able sound on different hardware (Raspberry Pi, BeagleBone, miniITX?)&lt;br /&gt;
*) testing &amp;amp; concepting -&amp;gt; interface, patch server?&lt;br /&gt;
*) ES jam!&lt;br /&gt;
&lt;br /&gt;
&amp;gt; mini digital synth experiments&lt;br /&gt;
*) ATtiny makeaway: playful interface and simple &amp;quot;composition&amp;quot; framework for workshops?&lt;br /&gt;
*) STM32F4 testing with Stahl&lt;br /&gt;
*) Arduino TVOut etc.&lt;br /&gt;
&lt;br /&gt;
&amp;gt; rc pyro tech&lt;br /&gt;
*) remote &amp;lt;strike&amp;gt;ignition/control of fireworks and moving parts&amp;lt;/strike&amp;gt;candle lighting machine&lt;br /&gt;
*) Arduino + ethernet shield + web server&lt;br /&gt;
&lt;br /&gt;
== ralf ==&lt;br /&gt;
&lt;br /&gt;
share/workshop: simple logic turntable sequencer (change cartridge with fotoresistor)&lt;br /&gt;
&lt;br /&gt;
share/workshop: analogue singing birds or insects &lt;br /&gt;
&lt;br /&gt;
share/workshop (electronic free!): bird calls &lt;br /&gt;
http://www.homemade-labor.ch/weblog/archives/2010/08/schoener_zwitsc.html&lt;br /&gt;
&lt;br /&gt;
== deb ==&lt;br /&gt;
&lt;br /&gt;
arrival: 12 aug in luzern (7:40) or zurich (8:30) via bus from zagreb... if there is a free space in ur cars for a girl and her middle sized suitcase filled with toyz that would be perfect :) (will share expenses for traffic and fuel), if not no problemo goin&#039; via train to lugano after first morning coffee in luzern or zurich, also for a company if some... &lt;br /&gt;
&lt;br /&gt;
doing between soldering smoke and dismantling thingz: writing and obsessively photo-documenting stuff...&lt;br /&gt;
&lt;br /&gt;
bringing some stuff for circuit bending: mini casio mono keyboard, loop/synth toy, pedal set for gaming, nintendo &amp;amp; sega joysticks, arduino mega ADK, a pair of gloves with flex sensors (it&#039;s practically finished, already made a shield for arduino UNO, now i&#039;m only stuck with the software part - Pduino or Maxuino) - &amp;gt; one glove has 5 photocell sensors, dunno if it&#039;s even necessarily... um, then lilypad and conductive thread &amp;amp; textiles too... let&#039;s see, i have tones of toyz... :)&lt;br /&gt;
&lt;br /&gt;
(pls, like numbers 12 or 13, so put me there, who comes next ;)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== daniel ==&lt;br /&gt;
&lt;br /&gt;
- solar bird`s, try out analog diffrent circuit`s examples (with mentor uwe on the side :), no SMD PCB structure, flying soldering. everybody can join in.&lt;br /&gt;
- solar bird`s digital, i like to join urbi, maybe expand the circuit with the solar cell as a sensor (input uwe SHIFT 2011)&lt;br /&gt;
(bring also some atiny`s to program)&lt;br /&gt;
&lt;br /&gt;
p.s.&lt;br /&gt;
I will travel on saturday from Basel, if anyone passes by with a car, i join in, if not i catch the train.&lt;br /&gt;
&lt;br /&gt;
== daniel (gaess) ==&lt;br /&gt;
&lt;br /&gt;
- play around with the motors from philip (the yellow one&#039;s)&amp;lt;br /&amp;gt;&lt;br /&gt;
- try to get my magnet field sensors measuring some fields&amp;lt;br /&amp;gt;&lt;br /&gt;
- Work on my new synth project mega83 or Harmophon (that&#039;s actually an old one) (2nd priority)&amp;lt;br /&amp;gt;&lt;br /&gt;
- join some others to see and learn&amp;lt;br /&amp;gt;&lt;br /&gt;
- maybe do some installations in old vico village?&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
Will bring:&amp;lt;br /&amp;gt; &lt;br /&gt;
- SIDuino-Designs and Code&amp;lt;br /&amp;gt;&lt;br /&gt;
- MIDI-Keyboard (if i can fit it inside my backpacker)&amp;lt;br /&amp;gt;&lt;br /&gt;
- Triacs (installed in Power-Sockets)&amp;lt;br /&amp;gt;&lt;br /&gt;
- ATMega 168 and 328s&amp;lt;br /&amp;gt;&lt;br /&gt;
- AVR-Programmer&lt;/div&gt;</summary>
		<author><name>0rel</name></author>
	</entry>
	<entry>
		<id>https://wiki.sgmk-ssam.ch/index.php?title=SHIFT_Festival_2011&amp;diff=9511</id>
		<title>SHIFT Festival 2011</title>
		<link rel="alternate" type="text/html" href="https://wiki.sgmk-ssam.ch/index.php?title=SHIFT_Festival_2011&amp;diff=9511"/>
		<updated>2021-04-19T18:06:30Z</updated>

		<summary type="html">&lt;p&gt;0rel: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;=== SHIFT Festival 2011 ===&lt;br /&gt;
&lt;br /&gt;
[[File:shift_logo.jpg|frameless|shift]]&lt;br /&gt;
&lt;br /&gt;
= Allgemeins =&lt;br /&gt;
&lt;br /&gt;
* Doodle:&lt;br /&gt;
http://www.doodle.com/6cnpy9ebgdse6trd&lt;br /&gt;
&lt;br /&gt;
* Page:&lt;br /&gt;
http://www.shiftfestival.ch/&lt;br /&gt;
&lt;br /&gt;
http://www.shiftfestival.ch/de/shift-2011/programm/shift-workshops/&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Makers Update ==&lt;br /&gt;
&lt;br /&gt;
= Rollenverteilung =&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Dani Reichmuth&#039;&#039;&#039;: Koordination &lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Orl&#039;&#039;&#039;: Koordination&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Felix&#039;&#039;&#039;: Manuals&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Urban&#039;&#039;&#039;: Digital Solar-Bird Bausatz&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Uwe&#039;&#039;&#039;: Analog Solar-Bird Bausatz&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Con&#039;&#039;&#039;: Lichtorgel&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Daniel Savi&#039;&#039;&#039;: Transport ZH -&amp;gt; BS -&amp;gt; ZH&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;+ Workshop-Helfer&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
= Todo =&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Material von ZH nach BS am Donnerstag 27.10.&#039;&#039;&#039; (Dani):&lt;br /&gt;
&lt;br /&gt;
Wer Material mit-transportieren will: &lt;br /&gt;
&lt;br /&gt;
Bei Daniel Savi melden oder -&amp;gt; erscheinen am Donnerstag 27. Oktober 2011, 14:00 Uhr im Lab.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Druck von Anleitungen zu den einzelnen Workshopteile.&#039;&#039;&#039; (Felix):&lt;br /&gt;
&lt;br /&gt;
Wer seinen Workshopteil dokumentiert haben will: &lt;br /&gt;
&lt;br /&gt;
Texte, Bilder, Schaltpläne mit Beschreib an Felix -&amp;gt; bitte bis am Montag 10. Oktober 2011, 12:00 Uhr Texte&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
= Raumeinteilung =&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Löt-Tisch&#039;&#039;&#039;: Hauptbereich zum Löten&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Code-Tisch&#039;&#039;&#039;: 1-3 Programmierstationen für ATtinys&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Bastel-Tisch&#039;&#039;&#039;: makeaways frei formen&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Demo-Tisch&#039;&#039;&#039;: Flyers, fertige Makeaways, Demos, WIP-Projekte&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Wand&#039;&#039;&#039;: SGMK-Banner, Ausgedruckter Code usw.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
= Material =&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Löt-Material&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
* Bauteile für Solar Birds (digital) -&amp;gt; Urban und Con&lt;br /&gt;
* Bauteile für Solar Birds (analog) -&amp;gt; Uwe&lt;br /&gt;
* Bauteile für Lichtorgel -&amp;gt; Con&lt;br /&gt;
* Bauteile für Micro Noise -&amp;gt; aus Lab ZH&lt;br /&gt;
* Zusätzliche Elektronik-Bauteile (Notfälle, freie Mods usw.) -&amp;gt; aus Lab ZH&lt;br /&gt;
* Werkzeug: Lötstationen, Zangen (Entisolier-Zange, Seitenschneider, &amp;quot;Rundzange&amp;quot;), dritte Hände -&amp;gt; aus Lab ZH&lt;br /&gt;
* Lämpchen -&amp;gt; aus Lab ZH&lt;br /&gt;
* Heissleim + Munition -&amp;gt; aus Lab ZH&lt;br /&gt;
* Lötzinn -&amp;gt; aus Lab ZH&lt;br /&gt;
* Anleitungen für alle Makeaways (laminiert, und zum Mitnehmen) -&amp;gt; Felix&lt;br /&gt;
* 2-5 Lötanleitungen (evtl. laminiert) -&amp;gt; Felix&lt;br /&gt;
* Rasterplatinen -&amp;gt; aus Lab ZH&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Coding-Material&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
* 1-3 Computer mit installiertem AVRDUDE -&amp;gt; wer bringt mit? Urban 1 Do, Fr, So&lt;br /&gt;
* AVRprogrammers -&amp;gt; Dani 1, Urban 1, Uwe 2?&lt;br /&gt;
* Evtl. Drucker (um Code auszudrucken) -&amp;gt; aus Lab ZH&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Bastel-Material&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
* Elektroherd + Pfanne (für Polymorph)&lt;br /&gt;
* evtl. Heissluftfön (zum Trocknen, hat&#039;s evtl. im Lab) -&amp;gt; aus Lab ZH ?&lt;br /&gt;
* genügend Heissleim -&amp;gt; aus Lab ZH&lt;br /&gt;
* Pinsel + Farben + Becher + Kartons + Teller usw. -&amp;gt; woher ?&lt;br /&gt;
* Evtl. Pigmente -&amp;gt; woher?&lt;br /&gt;
* Sternchenfaden o.ä. (zum Aufhängen) -&amp;gt; woher ?&lt;br /&gt;
* evtl. Filzstifte&lt;br /&gt;
* Perlen, Stoff, Steine, Textilien, Fell in Krimskramskiste -&amp;gt; aus Lab ZH&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Demo-Material&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
* Work-In-Progress-Makeaways (Bitcrusher, stxlrxs u.a.)&lt;br /&gt;
* DIY-Tech (Con: Laser Show, Urs: Plotter u.a.)&lt;br /&gt;
* SMD LED OVEN&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Misc-Material&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
* 2-3 Aktivboxen -&amp;gt; 1 aus Lab&lt;br /&gt;
* SGMK-Flyers -&amp;gt; Workshops Herbst/Winter von Dani&lt;br /&gt;
* Mailinglist-Liste -&amp;gt; Felix?&lt;br /&gt;
* SGMK-Makeaway-Banner -&amp;gt; aus Lab ZH&lt;br /&gt;
&lt;br /&gt;
= Docu =&lt;br /&gt;
&lt;br /&gt;
* Polymorph + Acrylfarbe: Check!&lt;br /&gt;
&lt;br /&gt;
[[File:polymorph_acryl_fx0.jpeg | polymorph_acryl0]]&lt;br /&gt;
&lt;br /&gt;
* Finally the new manuals:&lt;br /&gt;
&lt;br /&gt;
[[File:uwe.jpg | dual solar bird]]&lt;br /&gt;
&lt;br /&gt;
[[File:con.jpg | lichtorgel]]&lt;br /&gt;
&lt;br /&gt;
[[File:urbi.jpg | solarvogel]]&lt;/div&gt;</summary>
		<author><name>0rel</name></author>
	</entry>
	<entry>
		<id>https://wiki.sgmk-ssam.ch/index.php?title=HeK_2012_-_Sensing_Place&amp;diff=9510</id>
		<title>HeK 2012 - Sensing Place</title>
		<link rel="alternate" type="text/html" href="https://wiki.sgmk-ssam.ch/index.php?title=HeK_2012_-_Sensing_Place&amp;diff=9510"/>
		<updated>2021-04-19T18:05:57Z</updated>

		<summary type="html">&lt;p&gt;0rel: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== FACTS ==&lt;br /&gt;
&lt;br /&gt;
[http://www.haus-ek.org/de/content/sensing-place-zur-medialen-durchdringung-des-urbanen-raums?loc=PA Exhibition &amp;quot;Sensing Place&amp;quot;@ HeK, Basel / Date : 31. August 2012 - 11. November 2012]&lt;br /&gt;
&lt;br /&gt;
Sensing Place. Zur medialen Durchdringung des urbanen Raums&lt;br /&gt;
&lt;br /&gt;
[[File:HeK_logo.png]] [[File:SensingPlace.jpg]]&lt;br /&gt;
&lt;br /&gt;
=== Workhsop ===&lt;br /&gt;
&lt;br /&gt;
A) 11h-18h, 6./7. Oktober 2012 (proposed title as:)&lt;br /&gt;
&lt;br /&gt;
- Morse Attacks!&lt;br /&gt;
&lt;br /&gt;
- We Want Morse (out)&lt;br /&gt;
&lt;br /&gt;
- Morse Revisited (out)&lt;br /&gt;
&lt;br /&gt;
- Transceive! (out)&lt;br /&gt;
&lt;br /&gt;
- Plateaux Mobiles (out)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
B) 13h - 17h, 28. Oktober 2012: Familientag:&lt;br /&gt;
Workshop: DIY Makeaway (SolarWatch, Solar Bird or SGMKtiny)&lt;br /&gt;
&lt;br /&gt;
=== Environment ===&lt;br /&gt;
&lt;br /&gt;
[http://goo.gl/maps/Rc24p HeK on GoogleMaps]&lt;br /&gt;
&lt;br /&gt;
[[File:HeK_Environment_01a.jpg|350px]] [[File:HeK_Environment_00a.jpg|350px]]&lt;br /&gt;
&lt;br /&gt;
== Workshop A ==&lt;br /&gt;
=== Concept ===&lt;br /&gt;
&lt;br /&gt;
Extracting common environment data via self-built device which encode environment data such as temperature, vibration, brightness, frequency of on/off event to morse-code of participant defined message, participant can read, listen and send our environment as morse code instantly thru walkie-talkie frequency to the installation. &lt;br /&gt;
&lt;br /&gt;
Rather than mere a passive listener, the device also reacts to certain morse code messages that could be defined by the participant with simple programming with ATtiny chip.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
To-Dev&lt;br /&gt;
* audio signal transmission&lt;br /&gt;
* communication protocol allows all devices to establised bi-direction communication to exchange data.&lt;br /&gt;
&lt;br /&gt;
Requirement from paticipant&lt;br /&gt;
* Nope, perhaps an OpenMind, &lt;br /&gt;
* but welcome to bring a laptop if one likes to dig in their own ATtiny code &amp;amp; web interaction&lt;br /&gt;
&lt;br /&gt;
=== DIY Device === &lt;br /&gt;
&lt;br /&gt;
[http://wiki.sgmk-ssam.ch/index.php/SGMKmorseAttack &amp;gt;&amp;gt; Dev-Page]&lt;br /&gt;
&lt;br /&gt;
Sender :&lt;br /&gt;
* microcontroller (ATtiny)&lt;br /&gt;
* walki talki&lt;br /&gt;
* various sensor (temperature, piezo, light resistor, contact pad) &lt;br /&gt;
* PCB board/wire&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Receiver : &lt;br /&gt;
* microcontroller (ATtiny) &lt;br /&gt;
* small LCD Display &lt;br /&gt;
* walki talki &lt;br /&gt;
* PCB board/wire&lt;br /&gt;
* ear plug for mute section&lt;br /&gt;
* It&#039;s possible to develop a &amp;quot;transceiver&amp;quot; (sender&amp;amp;receive as one device) &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Fee for participant : sFr 80&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==== Morsecode encoder / decoder device ====&lt;br /&gt;
[[File:Morse board bb.png|800px]]&lt;br /&gt;
&lt;br /&gt;
[[File:Screenshot from 2012-09-03 00-57-58.png|800px]]&lt;br /&gt;
&lt;br /&gt;
Bill of Materials: morse board.fzz&lt;br /&gt;
&lt;br /&gt;
Saturday, September 1 2012, 15:01:59&lt;br /&gt;
Assembly List&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
| Label 	|| Part Type || 	Properties&lt;br /&gt;
|-&lt;br /&gt;
| ATtiny85 ||	DIP - 8 pins ||	package DIP (Dual Inline) [THT]; hole size 1.0mm,0.508mm; true; chip label ATtiny85; pins 8; pin spacing 300mil&lt;br /&gt;
|-&lt;br /&gt;
|C1 ||	Ceramic Capacitor ||	package 100 mil [THT, multilayer]; capacitance 47µF; voltage 6.3V&lt;br /&gt;
|-&lt;br /&gt;
| C2 ||	Electrolytic Capacitor ||	package 100 mil [THT, electrolytic]; capacitance 4.7µF; voltage 6.3V&lt;br /&gt;
|-&lt;br /&gt;
|J1 ||	Piezo Speaker || 	&lt;br /&gt;
|-&lt;br /&gt;
|LED1 ||	Red LED - 5mm ||	package 5 mm [THT]; leg yes; color Red (633nm)&lt;br /&gt;
|-&lt;br /&gt;
|LED3 || 	Red LED - 5mm ||	package 5 mm [THT]; leg yes; color Red (633nm)&lt;br /&gt;
|-&lt;br /&gt;
|MIC1 	|| Microphone ||  	&lt;br /&gt;
|-&lt;br /&gt;
| Q2 ||	PNP-Transistor ||	package TO92 [THT]; type PNP&lt;br /&gt;
|-&lt;br /&gt;
| R1 ||	8k Ω Resistor ||	package THT; tolerance ±5%; bands 4; resistance 8kΩ; pin spacing 400 mil&lt;br /&gt;
|-&lt;br /&gt;
| R3 || 	8k Ω Resistor ||	package THT; tolerance ±5%; bands 4; resistance 8kΩ; pin spacing 400 mil&lt;br /&gt;
|-&lt;br /&gt;
| R4 ||	220 Ω Resistor ||	package THT; tolerance ±5%; bands 4; resistance 220Ω; pin spacing 400 mil&lt;br /&gt;
|-&lt;br /&gt;
|R5 ||	10k Ω Resistor ||	package THT; tolerance ±5%; bands 4; resistance 10kΩ; pin spacing 400 mil&lt;br /&gt;
|-&lt;br /&gt;
|R6 ||	3.5k Ω Resistor ||	package THT; tolerance ±5%; bands 4; resistance 3.5kΩ; pin spacing 400 mil&lt;br /&gt;
|-&lt;br /&gt;
|R7 ||	10k Ω Resistor ||	package THT; tolerance ±5%; bands 4; resistance 10kΩ; pin spacing 400 mil&lt;br /&gt;
|-&lt;br /&gt;
|R8 ||	220 Ω Resistor ||	package THT; tolerance ±5%; bands 4; resistance 220Ω; pin spacing 400 mil&lt;br /&gt;
|-&lt;br /&gt;
|U1 ||	555 Timer ||	package DIP8 [THT]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Shopping List&lt;br /&gt;
Amount 	Part Type 	Properties&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|2 ||	Piezo Speaker || &lt;br /&gt;
|-	&lt;br /&gt;
|1 ||	Electrolytic Capacitor ||	package 100 mil [THT, electrolytic]; capacitance 4.7µF; voltage 6.3V&lt;br /&gt;
|-&lt;br /&gt;
|1 ||	Ceramic Capacitor ||	package 100 mil [THT, multilayer]; capacitance 47µF; voltage 6.3V&lt;br /&gt;
|-&lt;br /&gt;
|2 ||	Red LED - 5mm ||	package 5 mm [THT]; leg yes; color Red (633nm)&lt;br /&gt;
|-&lt;br /&gt;
|1 ||	DIP - 8 pins ||	package DIP (Dual Inline) [THT]; hole size 1.0mm,0.508mm; true; chip label ATtiny85; pins 8; pin spacing 300mil&lt;br /&gt;
|-&lt;br /&gt;
|1 ||	555 Timer ||	package DIP8 [THT]&lt;br /&gt;
|-&lt;br /&gt;
|2 ||	10k Ω Resistor ||	package THT; tolerance ±5%; bands 4; resistance 10kΩ; pin spacing 400 mil&lt;br /&gt;
|-&lt;br /&gt;
|2 ||	220 Ω Resistor ||	package THT; tolerance ±5%; bands 4; resistance 220Ω; pin spacing 400 mil&lt;br /&gt;
|-&lt;br /&gt;
|1 ||	3.5k Ω Resistor|| 	package THT; tolerance ±5%; bands 4; resistance 3.5kΩ; pin spacing 400 mil&lt;br /&gt;
|-&lt;br /&gt;
|2 ||	8k Ω Resistor || 	package THT; tolerance ±5%; bands 4; resistance 8kΩ; pin spacing 400 mil&lt;br /&gt;
|-&lt;br /&gt;
|1 ||	PNP-Transistor ||	package TO92 [THT]; type PNP&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Exported with Fritzing 0.7.7- http://fritzing.org&lt;br /&gt;
&lt;br /&gt;
=== proof of concept ===&lt;br /&gt;
&lt;br /&gt;
{{#widget:YouTube|id=-9o40UYi2Jk}}&lt;br /&gt;
&lt;br /&gt;
http://youtu.be/-9o40UYi2Jk &lt;br /&gt;
&lt;br /&gt;
=== Software/Protocol ===&lt;br /&gt;
* pd&lt;br /&gt;
* ATtiny programming&lt;br /&gt;
* Arduino (optional)&lt;br /&gt;
&lt;br /&gt;
=== Letter from Morse/Electronic Poster === &lt;br /&gt;
[[File:Morse-Revisited web.jpg|500px]]&lt;br /&gt;
&lt;br /&gt;
An A0 size poster with embedded LED Array, able to listen to morse code from sender and display the message sent. The concept of poster is to mimic Morse&#039;s dedication for communication, spoken out and be understood via rapid long-distance transmission, the poster is an funcational object allow workshop participant to test their, and later as the documention of workshop remain in HeK.    &lt;br /&gt;
&lt;br /&gt;
Component :&lt;br /&gt;
* A1 printed poster (594 x 841 mm)&lt;br /&gt;
* 44 characters &amp;amp; 150 LED&lt;br /&gt;
* Arduino + walkie talkie + mic circuit&lt;br /&gt;
* wifi sender to web (optional) that same physical poster also display as virtual poster on web page&lt;br /&gt;
* poster has two modes (live &amp;amp; workshop documentation)&lt;br /&gt;
* Three layers design (1. tracing paper of orignal print, 2. LED illuminated room of min 15 mm thick wood, 3. LED compartment with 5mm circle of each position, min 12 mm thick)&lt;br /&gt;
* trial cut 20h30, 18 SEP @ Lucern FabLab&lt;br /&gt;
&lt;br /&gt;
=== SGMKer ===&lt;br /&gt;
* Pei&lt;br /&gt;
* Toibas&lt;br /&gt;
* Daniel Savi&lt;br /&gt;
* Ubran&lt;br /&gt;
* Orl&lt;br /&gt;
* ?? &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
write your name here who like to develop, run, join this module ~&lt;br /&gt;
&lt;br /&gt;
== Workshop B - DIY Makeaway ==&lt;br /&gt;
=== SolarWatch? ===&lt;br /&gt;
=== Solar Bird? (Analog/Digital?)===&lt;br /&gt;
=== or SGMKtiny ===&lt;br /&gt;
=== SGMKer ===&lt;br /&gt;
* ?&lt;br /&gt;
* ??&lt;br /&gt;
&lt;br /&gt;
write your name here who like to develop, run, join this module ~&lt;br /&gt;
&lt;br /&gt;
== Tech ==&lt;br /&gt;
&lt;br /&gt;
http://cosm.com/&lt;br /&gt;
&lt;br /&gt;
http://en.wikipedia.org/wiki/Internet_of_Things&lt;br /&gt;
&lt;br /&gt;
http://en.wikipedia.org/wiki/Transceiver&lt;br /&gt;
&lt;br /&gt;
=== Example Works ===&lt;br /&gt;
&lt;br /&gt;
http://aporee.org/maps/&lt;br /&gt;
&lt;br /&gt;
http://www.and-or.ch/beforethesatellite/&lt;br /&gt;
&lt;br /&gt;
http://www.and-or.ch/wardive_android/&lt;br /&gt;
&lt;br /&gt;
http://www.pool09.ch/project/detail/141&lt;br /&gt;
&lt;br /&gt;
http://www.haus-ek.org/de/content/cctv-trail-images-ein-spaziergang-durch-die-%C3%BCberwachte-stadt-mit-der-mediengruppe-bitnik&lt;br /&gt;
&lt;br /&gt;
=== Example Images ===&lt;br /&gt;
&lt;br /&gt;
[[File:IoT_Insp_02a.jpg|300px]] [[File:IoT_Insp_00a.jpg|300px]] [[File:IoT_Insp_01a.jpg|300px]]&lt;br /&gt;
&lt;br /&gt;
== Ref. LINKS ==&lt;br /&gt;
&lt;br /&gt;
New 3G + GPS shield for Arduino&lt;br /&gt;
http://www.cooking-hacks.com/index.php/documentation/tutorials/arduino-3g-gprs-gsm-gps&lt;br /&gt;
&lt;br /&gt;
Arduino GSM shield&lt;br /&gt;
AT Commands&lt;br /&gt;
http://labs.arduino.cc/GPRS/Index&lt;br /&gt;
http://en.wikipedia.org/wiki/Hayes_command_set&lt;br /&gt;
http://www.open-electronics.org/arduino-gsm-shield/&lt;br /&gt;
&lt;br /&gt;
Cellular Shield with SM5100B&lt;br /&gt;
https://www.sparkfun.com/products/9607?&lt;br /&gt;
&lt;br /&gt;
open source wireless sensor platform&lt;br /&gt;
http://www.cooking-hacks.com/index.php/documentation/tutorials/waspmote?utm_source=banner_waspmote_sidebar&amp;amp;utm_medium=banner&lt;br /&gt;
&lt;br /&gt;
WASPMOTE&lt;br /&gt;
http://www.libelium.com/products/waspmote&lt;br /&gt;
&lt;br /&gt;
SquidBee &lt;br /&gt;
http://www.libelium.com/squidbee/index.php?title=Main_Page&lt;br /&gt;
&lt;br /&gt;
SMS@Arduino&lt;br /&gt;
http://finch.am/projects/arduinogsm/&lt;br /&gt;
http://www.dealextreme.com/p/usb-tri-band-gprs-modem-cell-phone-radio-gsm-900-1800-1900mhz-12057&lt;br /&gt;
&lt;br /&gt;
Using the nRF24L01 wireless module&lt;br /&gt;
http://www.insidegadgets.com/2012/08/22/using-the-nrf24l01-wireless-module/#more-3560&lt;br /&gt;
http://www.tinkerer.eu/AVRLib/nRF24L01&lt;br /&gt;
http://www.nordicsemi.com/eng/Products/2.4GHz-RF/nRF24L01&lt;br /&gt;
http://arduino-info.wikispaces.com/Nrf24L01-2.4GHz-HowTo&lt;br /&gt;
&lt;br /&gt;
Sensor Networks&lt;br /&gt;
http://www.sensor-networks.org/&lt;br /&gt;
&lt;br /&gt;
Freeloader&lt;br /&gt;
http://www.solartechnology.co.uk/shop/freeloader-pico.htm&lt;br /&gt;
&lt;br /&gt;
Migros Budget Internet Stick (Swisscom: works on Linux!) + Raspberry Pi?&lt;br /&gt;
http://www.migros.ch/de/supermarkt/m-budget/m-budget-mobile-internet.html&lt;br /&gt;
&lt;br /&gt;
MQTT&lt;br /&gt;
http://en.wikipedia.org/wiki/MQ_Telemetry_Transport&lt;br /&gt;
&lt;br /&gt;
ADK&lt;br /&gt;
https://www.adafruit.com/products/563&lt;br /&gt;
&lt;br /&gt;
Walkie Talkie&lt;br /&gt;
http://www.ebay.ch/itm/Motorola-TLKR-T4-PMR-Funkgerat-/160862252542?pt=DE_Handys_Kommunikation_Funktechnik&amp;amp;hash=item2574232dfe#ht_2470wt_907&lt;br /&gt;
http://www.ebay.ch/itm/Switel-WTE-020-Walkie-Talkie-Set-duo-max-Reichweite-3k-/400314840381?pt=DE_Handys_Kommunikation_Funktechnik&amp;amp;hash=item5d349fb53d#ht_2747wt_907&lt;br /&gt;
&lt;br /&gt;
http://www.ladyada.net/make/tweetawatt/receiver.html&lt;br /&gt;
&lt;br /&gt;
XBee radiosWireless Arduino programming/serial link&lt;br /&gt;
http://www.ladyada.net/make/xbee/arduino.html&lt;br /&gt;
http://www.digi.com/products/wireless-wired-embedded-solutions/zigbee-rf-modules/zigbee-mesh-module/xbee-zb-module#specs&lt;br /&gt;
http://www.digi.com/products/wireless-wired-embedded-solutions/zigbee-rf-modules/point-multipoint-rfmodules/xbee-series1-module#specs&lt;br /&gt;
&lt;br /&gt;
EnOcean Wireless&lt;br /&gt;
http://www.enocean.com/de/batterielose-funktechnologie/&lt;br /&gt;
&lt;br /&gt;
Multi-Remote Receiver operated on/off Switch &lt;br /&gt;
http://www.hobbyking.com/hobbyking/store/__12615__Multi_Remote_Receiver_operated_on_off_Switch_.html&lt;br /&gt;
&lt;br /&gt;
Tweet-a-wattMake the receiver&lt;br /&gt;
http://www.ladyada.net/make/tweetawatt/receiver.html&lt;br /&gt;
&lt;br /&gt;
Walkie Talkie&lt;br /&gt;
http://www.ebay.ch/itm/Motorola-TLKR-T4-PMR-Funkgerat-/160862252542?pt=DE_Handys_Kommunikation_Funktechnik&amp;amp;hash=item2574232dfe#ht_2470wt_907&lt;br /&gt;
&lt;br /&gt;
XBees&lt;br /&gt;
http://www.digi.com/products/wireless-wired-embedded-solutions/zigbee-rf-modules/point-multipoint-rfmodules/xbee-series1-module#specs&lt;br /&gt;
&lt;br /&gt;
RC Hobby Controllers and Arduino &lt;br /&gt;
http://www.sparkfun.com/tutorials/348&lt;br /&gt;
&lt;br /&gt;
FS-GT2 3ch 2.4GHz Transmitter Receiver RC CAR FS 2.4G&lt;br /&gt;
http://www.ebay.com/itm/FS-GT2-3ch-2-4GHz-Transmitter-Receiver-RC-CAR-FS-2-4G-/280930040917?pt=Radio_Control_Parts_Accessories&amp;amp;hash=item4168bc3c55#ht_2785wt_1073&lt;/div&gt;</summary>
		<author><name>0rel</name></author>
	</entry>
	<entry>
		<id>https://wiki.sgmk-ssam.ch/index.php?title=SHIFT_Festival_2011&amp;diff=9509</id>
		<title>SHIFT Festival 2011</title>
		<link rel="alternate" type="text/html" href="https://wiki.sgmk-ssam.ch/index.php?title=SHIFT_Festival_2011&amp;diff=9509"/>
		<updated>2021-04-19T18:05:28Z</updated>

		<summary type="html">&lt;p&gt;0rel: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;=== SHIFT Festival 2011 ===&lt;br /&gt;
&lt;br /&gt;
[[File:shift_logo.jpg|frameless|shift]]&lt;br /&gt;
&lt;br /&gt;
= Allgemeins =&lt;br /&gt;
&lt;br /&gt;
* Doodle:&lt;br /&gt;
http://www.doodle.com/6cnpy9ebgdse6trd&lt;br /&gt;
&lt;br /&gt;
* Page:&lt;br /&gt;
http://www.shiftfestival.ch/&lt;br /&gt;
&lt;br /&gt;
http://www.shiftfestival.ch/de/shift-2011/programm/shift-workshops/&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Makers Update ==&lt;br /&gt;
&lt;br /&gt;
= Rollenverteilung =&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Dani Reichmuth&#039;&#039;&#039;: Koordination &lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Orl&#039;&#039;&#039;: Koordination&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Felix&#039;&#039;&#039;: Manuals&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Urban&#039;&#039;&#039;: Digital Solar-Bird Bausatz&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Uwe&#039;&#039;&#039;: Analog Solar-Bird Bausatz&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Con&#039;&#039;&#039;: Lichtorgel&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Daniel Savi&#039;&#039;&#039;: Transport ZH -&amp;gt; BS -&amp;gt; ZH&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;+ Workshop-Helfer&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
= Todo =&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Material von ZH nach BS am Donnerstag 27.10.&#039;&#039;&#039; (Dani):&lt;br /&gt;
&lt;br /&gt;
Wer Material mit-transportieren will: &lt;br /&gt;
&lt;br /&gt;
Bei Daniel Savi melden oder -&amp;gt; erscheinen am Donnerstag 27. Oktober 2011, 14:00 Uhr im Lab.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Druck von Anleitungen zu den einzelnen Workshopteile.&#039;&#039;&#039; (Felix):&lt;br /&gt;
&lt;br /&gt;
Wer seinen Workshopteil dokumentiert haben will: &lt;br /&gt;
&lt;br /&gt;
Texte, Bilder, Schaltpläne mit Beschreib an Felix -&amp;gt; bitte bis am Montag 10. Oktober 2011, 12:00 Uhr Texte&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
= Raumeinteilung =&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Löt-Tisch&#039;&#039;&#039;: Hauptbereich zum Löten&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Code-Tisch&#039;&#039;&#039;: 1-3 Programmierstationen für ATtinys&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Bastel-Tisch&#039;&#039;&#039;: makeaways frei formen&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Demo-Tisch&#039;&#039;&#039;: Flyers, fertige Makeaways, Demos, WIP-Projekte&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Wand&#039;&#039;&#039;: SGMK-Banner, Ausgedruckter Code usw.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
= Material =&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Löt-Material&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
* Bauteile für Solar Birds (digital) -&amp;gt; Urban und Con&lt;br /&gt;
* Bauteile für Solar Birds (analog) -&amp;gt; Uwe&lt;br /&gt;
* Bauteile für Lichtorgel -&amp;gt; Con&lt;br /&gt;
* Bauteile für Micro Noise -&amp;gt; aus Lab ZH&lt;br /&gt;
* Zusätzliche Elektronik-Bauteile (Notfälle, freie Mods usw.) -&amp;gt; aus Lab ZH&lt;br /&gt;
* Werkzeug: Lötstationen, Zangen (Entisolier-Zange, Seitenschneider, &amp;quot;Rundzange&amp;quot;), dritte Hände -&amp;gt; aus Lab ZH&lt;br /&gt;
* Lämpchen -&amp;gt; aus Lab ZH&lt;br /&gt;
* Heissleim + Munition -&amp;gt; aus Lab ZH&lt;br /&gt;
* Lötzinn -&amp;gt; aus Lab ZH&lt;br /&gt;
* Anleitungen für alle Makeaways (laminiert, und zum Mitnehmen) -&amp;gt; Felix&lt;br /&gt;
* 2-5 Lötanleitungen (evtl. laminiert) -&amp;gt; Felix&lt;br /&gt;
* Rasterplatinen -&amp;gt; aus Lab ZH&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Coding-Material&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
* 1-3 Computer mit installiertem AVRDUDE -&amp;gt; wer bringt mit? Urban 1 Do, Fr, So&lt;br /&gt;
* AVRprogrammers -&amp;gt; Dani 1, Urban 1, Uwe 2?&lt;br /&gt;
* Evtl. Drucker (um Code auszudrucken) -&amp;gt; aus Lab ZH&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Bastel-Material&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
* Elektroherd + Pfanne (für Polymorph) -&amp;gt; Aurelio&lt;br /&gt;
* evtl. Heissluftfön (zum Trocknen, hat&#039;s evtl. im Lab) -&amp;gt; aus Lab ZH ?&lt;br /&gt;
* genügend Heissleim -&amp;gt; aus Lab ZH&lt;br /&gt;
* Pinsel + Farben + Becher + Kartons + Teller usw. -&amp;gt; woher ?&lt;br /&gt;
* Evtl. Pigmente -&amp;gt; woher?&lt;br /&gt;
* Sternchenfaden o.ä. (zum Aufhängen) -&amp;gt; woher ?&lt;br /&gt;
* evtl. Filzstifte&lt;br /&gt;
* Perlen, Stoff, Steine, Textilien, Fell in Krimskramskiste -&amp;gt; aus Lab ZH&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Demo-Material&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
* Work-In-Progress-Makeaways (Bitcrusher, stxlrxs u.a.)&lt;br /&gt;
* DIY-Tech (Con: Laser Show, Urs: Plotter u.a.)&lt;br /&gt;
* SMD LED OVEN&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Misc-Material&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
* 2-3 Aktivboxen -&amp;gt; 1 aus Lab&lt;br /&gt;
* SGMK-Flyers -&amp;gt; Workshops Herbst/Winter von Dani&lt;br /&gt;
* Mailinglist-Liste -&amp;gt; Felix?&lt;br /&gt;
* SGMK-Makeaway-Banner -&amp;gt; aus Lab ZH&lt;br /&gt;
&lt;br /&gt;
= Docu =&lt;br /&gt;
&lt;br /&gt;
* Polymorph + Acrylfarbe: Check!&lt;br /&gt;
&lt;br /&gt;
[[File:polymorph_acryl_fx0.jpeg | polymorph_acryl0]]&lt;br /&gt;
&lt;br /&gt;
* Finally the new manuals:&lt;br /&gt;
&lt;br /&gt;
[[File:uwe.jpg | dual solar bird]]&lt;br /&gt;
&lt;br /&gt;
[[File:con.jpg | lichtorgel]]&lt;br /&gt;
&lt;br /&gt;
[[File:urbi.jpg | solarvogel]]&lt;/div&gt;</summary>
		<author><name>0rel</name></author>
	</entry>
	<entry>
		<id>https://wiki.sgmk-ssam.ch/index.php?title=Electron_Festival_2011&amp;diff=9508</id>
		<title>Electron Festival 2011</title>
		<link rel="alternate" type="text/html" href="https://wiki.sgmk-ssam.ch/index.php?title=Electron_Festival_2011&amp;diff=9508"/>
		<updated>2021-04-19T18:04:58Z</updated>

		<summary type="html">&lt;p&gt;0rel: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[Category:makeaway]]&lt;br /&gt;
[[Category:Workshops]]&lt;br /&gt;
[[File:Website-Headers-3-en.png|640px|http://www.electronfestival.ch/2011/en]]&lt;br /&gt;
[[File:Pmina.jpg|240px]]&lt;br /&gt;
= electron festival geneva =&lt;br /&gt;
&lt;br /&gt;
SGMK -Société suisse des Arts mecatroniques&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
DIY MAKEAWAY @ Bâtiment d&#039;art contemporain (Bac)&lt;br /&gt;
&lt;br /&gt;
Opening &amp;amp; preparing /&lt;br /&gt;
Wednesday 20 april&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Swiss Mechatronic Art Society – DIY makeaway /&lt;br /&gt;
&lt;br /&gt;
Thursday 21 april 16h00 - 21h00&lt;br /&gt;
&lt;br /&gt;
Friday 22 april 16h00 - 21h00 &lt;br /&gt;
&lt;br /&gt;
Saturday 23 april 14h00 - 21h00&lt;br /&gt;
&lt;br /&gt;
Sunday 24 april 11h00 - 21h00&lt;br /&gt;
&lt;br /&gt;
= workshop = &lt;br /&gt;
* [http://new.mechatronicart.ch/index.php?id=134 micro_noise] / handout in [http://wiki.sgmk-ssam.ch/images/9/9e/A4_MicroNoise.pdf EN-A4]; [http://wiki.sgmk-ssam.ch/images/e/ec/A3_micronoise.pdf EN-A3] / [http://www.mechatronicart.ch/diymakeaway/wp-content/uploads/2008/07/breadboard_micronoise_big.png circuit on breadboard] / [http://www.mechatronicart.ch/diymakeaway/wp-content/uploads/2008/10/maske_new-scaled_mirrored_6x_160x100.png etching graph]&lt;br /&gt;
* [http://new.mechatronicart.ch/index.php?id=135 Light Seeker] / handout in [http://wiki.sgmk-ssam.ch/images/c/c8/LightSeeker2011.pdf EN-A4]; [http://wiki.sgmk-ssam.ch/images/4/47/A3_LightSeeker.pdf EN-A3]&lt;br /&gt;
* I&#039;M NUDE  (Ionchamber for Monitoring NUclear DEsasters ) [http://wiki.sgmk-ssam.ch/images/1/14/A4_I_am_nude.pdf EN-A4]; [http://wiki.sgmk-ssam.ch/images/9/97/A3_I_am_nude.pdf EN-A3]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
under the competent guidance of the electro-tinkerers of the Swiss Mechatronic Art Society (SGMK) one can solder an electronic toy or instrument such as a mini-robot or noise-synthesizer around 45 minutes.&lt;br /&gt;
&lt;br /&gt;
The SGMK is one of the most important groups on the current Swiss DIY scene. Until now, their activities where mostly in the German-speaking part of Switzerland (and in many countries abroad). The Electron festival will be a good occasion for them to connect. &lt;br /&gt;
&lt;br /&gt;
* http://www.electronfestival.ch/2011/en/dates.html?ditto_gd_documents=340&lt;br /&gt;
&lt;br /&gt;
== location == &lt;br /&gt;
* Venue address : BAC - Bâtiment d&#039;art contemporain, Rue des Bains 28, 1205 Genève&lt;br /&gt;
 &lt;br /&gt;
* google maps: [http://maps.google.com/maps?f=q&amp;amp;source=s_q&amp;amp;hl=en&amp;amp;geocode=&amp;amp;q=B%C3%A2timent+d%27art+contemporain,+GENEVA&amp;amp;aq=&amp;amp;sll=37.0625,-95.677068&amp;amp;sspn=48.77566,114.169922&amp;amp;ie=UTF8&amp;amp;hq=B%C3%A2timent+d%27art+contemporain,&amp;amp;hnear=Geneva,+Gen%C3%A8ve,+Canton+of+Geneva,+Switzerland&amp;amp;t=h&amp;amp;z=16&amp;amp;iwloc=A&amp;amp;cid=2717002044073977934 Bâtiment d&#039;art contemporain]&lt;br /&gt;
&lt;br /&gt;
{{#widget:GoogleMaps&lt;br /&gt;
|key=ABQIAAAAlPm43KFQwtkRrWYtQdVTphSRNxm4qhmcBlD3iKkEiWOO73bkTBQ01pa1G4IuDXbR7MXXesalyHMJ9A&lt;br /&gt;
|width=600&lt;br /&gt;
|height=400&lt;br /&gt;
|lat=46.198661&lt;br /&gt;
|lng=6.138223&lt;br /&gt;
|centermarker=yes&lt;br /&gt;
|maptypecontrol=yes&lt;br /&gt;
|largemapcontrol=yes&lt;br /&gt;
|overviewmapcontrol=no&lt;br /&gt;
|scalecontrol=yes&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Accomodation == &lt;br /&gt;
{|&lt;br /&gt;
|&lt;br /&gt;
{{#widget:GoogleMaps&lt;br /&gt;
|key=ABQIAAAAlPm43KFQwtkRrWYtQdVTphSRNxm4qhmcBlD3iKkEiWOO73bkTBQ01pa1G4IuDXbR7MXXesalyHMJ9A&lt;br /&gt;
|width=600&lt;br /&gt;
|height=400&lt;br /&gt;
|lat=46.186964&lt;br /&gt;
|lng=6.122204&lt;br /&gt;
|centermarker=yes&lt;br /&gt;
|maptypecontrol=yes&lt;br /&gt;
|largemapcontrol=no&lt;br /&gt;
|overviewmapcontrol=no&lt;br /&gt;
|scalecontrol=yes&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
||&lt;br /&gt;
&#039;&#039;&#039;Informations pratiques&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Ouverture&#039;&#039;&#039;&lt;br /&gt;
Du mardi au dimanche de 14h à 18h et sur rendez-vous&lt;br /&gt;
Nocturne le jeudi jusqu&#039;à 20h&lt;br /&gt;
Visites guidées pour les groupes sur demande&lt;br /&gt;
Entrée libre&lt;br /&gt;
&lt;br /&gt;
Buvette pendant les expositions le jeudi de 18h à 20h et le dimanche de 14h à 18h&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Adresse&#039;&#039;&#039;&lt;br /&gt;
Villa Bernasconi&lt;br /&gt;
Route du Grand-Lancy 8&lt;br /&gt;
1212 Grand-Lancy&lt;br /&gt;
+41(0)22 794 73 03&lt;br /&gt;
info@villabernasconi.ch&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Accès&#039;&#039;&#039;&lt;br /&gt;
Trams 15 arrêt Mairie de Lancy&lt;br /&gt;
Tram 17 arrêt Pont-Rouge&lt;br /&gt;
Train depuis la gare Cornavin arrêt Pont-Rouge&lt;br /&gt;
Parking de l&#039;Etoile&lt;br /&gt;
Télécharger le plan d&#039;accès&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Service culturel de la Ville de Lancy&#039;&#039;&#039;&lt;br /&gt;
www.lancy.ch&lt;br /&gt;
Françoise Mamie et Hélène Mariéthoz, responsables&lt;br /&gt;
Déléguées à la culture&lt;br /&gt;
Route du Grand-Lancy 41&lt;br /&gt;
1212 Grand-Lancy&lt;br /&gt;
+41(0)22 706 15 33 ou 34&lt;br /&gt;
f.mamie@lancy.ch&lt;br /&gt;
h.mariethoz@lancy.ch&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Equipe à la Villa Bernasconi&#039;&#039;&#039;&lt;br /&gt;
Marie Roduit, assistante +41(0)22 794 73 03 m.roduit@lancy.ch&lt;br /&gt;
Antoine Maret, régisseur +41(0)22 794 73 57&lt;br /&gt;
&lt;br /&gt;
[[File:Villabernasconi.jpg|180px]]&lt;br /&gt;
|&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== people ==&lt;br /&gt;
we have the following people helping:&lt;br /&gt;
* Tobias Hoffmann (DE/CH)&lt;br /&gt;
* Uwe Schüler &amp;amp; Jördis Drawe (DE)&lt;br /&gt;
* Monika Pocrnjić (SI)&lt;br /&gt;
* Ranga Adrian (CA/CH), speaks fluent french&lt;br /&gt;
* Pei-Wen Liu (TW/CH)&lt;br /&gt;
* Michael Ulber (CH), speaks o.k. french&lt;br /&gt;
&lt;br /&gt;
== attendance list ==&lt;br /&gt;
&lt;br /&gt;
please attend  @ 3 workshops at least&lt;br /&gt;
{| style=&amp;quot;background-color:#ffffee;&amp;quot; cellpadding=&amp;quot;4&amp;quot; cellspacing=&amp;quot;0&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|             || ^Thu 16-21h || ^Fr.16-21h|| ^Sa.14-17:30h|| ^Sa.17:30-21h || ^Su.11-17:30h || ^Su.17:30-21h  &lt;br /&gt;
|-&lt;br /&gt;
|  Tobias     ||     x       ||     x     ||              ||       x     ||      x        ||       x       &lt;br /&gt;
|-&lt;br /&gt;
|  Pei        ||     x       ||     x     ||              ||       x     ||             ||    x       &lt;br /&gt;
|-&lt;br /&gt;
|  Uwe        ||     x       ||      x    ||       x      ||             ||      x       ||                 &lt;br /&gt;
|-&lt;br /&gt;
|  Jördis     ||     x       ||      x    ||       x      ||             ||      x       ||              &lt;br /&gt;
|-&lt;br /&gt;
|  Monica     ||      x      ||      x    ||              ||        x    ||              ||   x           &lt;br /&gt;
|-&lt;br /&gt;
|  Adrian     ||             ||           ||              ||             ||              ||              &lt;br /&gt;
|-&lt;br /&gt;
|  Orl    ||             ||      x    ||      x       ||             ||             ||      x       &lt;br /&gt;
|-&lt;br /&gt;
|  Michael    ||             ||      x    ||      x       ||             ||              ||              &lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== TODO ==&lt;br /&gt;
* check &amp;amp; prepare material&lt;br /&gt;
* inform helpers &lt;br /&gt;
* outline schedule &lt;br /&gt;
* prepare handouts&lt;br /&gt;
&lt;br /&gt;
== Photo Documentation ==&lt;br /&gt;
&lt;br /&gt;
* 20/21 Apr diymakeaway @ http://is.gd/jHJFsV&lt;br /&gt;
* 22 Apr diymakeaway @ http://is.gd/ecIjvc&lt;br /&gt;
* 23 Apr diymakeaway @ http://is.gd/s9Nnqq&lt;br /&gt;
* 24 Apr diymakeaway @ http://is.gd/VhUEtX&lt;br /&gt;
* photo by Uwe @ http://is.gd/zMZqba&lt;br /&gt;
* photo by electron festival @ http://www.flickr.com/photos/electron-festival&lt;br /&gt;
&lt;br /&gt;
[http://editingwritingservices.org/article.php article writing service]&lt;/div&gt;</summary>
		<author><name>0rel</name></author>
	</entry>
	<entry>
		<id>https://wiki.sgmk-ssam.ch/index.php?title=PachubeHackathon2011&amp;diff=9507</id>
		<title>PachubeHackathon2011</title>
		<link rel="alternate" type="text/html" href="https://wiki.sgmk-ssam.ch/index.php?title=PachubeHackathon2011&amp;diff=9507"/>
		<updated>2021-04-19T18:03:57Z</updated>

		<summary type="html">&lt;p&gt;0rel: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[Category:Workshops]]&lt;br /&gt;
&lt;br /&gt;
{|&lt;br /&gt;
|[[File:Pachube_hackathon_2_200.png]]&lt;br /&gt;
|{{#widget:Twitter Search&lt;br /&gt;
|query=#pachubehack &lt;br /&gt;
|title=pachube&lt;br /&gt;
|height=200&lt;br /&gt;
}}&lt;br /&gt;
|{{#widget:Iframe&lt;br /&gt;
|url=http://webchat.freenode.net/?channels=pachube&lt;br /&gt;
|width=480&lt;br /&gt;
|height=340&lt;br /&gt;
|border=0&lt;br /&gt;
}}&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
= MechArtLab Live Radio =&lt;br /&gt;
&lt;br /&gt;
(player works &#039;&#039;&#039;in fresh browsers&#039;&#039;&#039; &lt;br /&gt;
eg: chrome, firefox4, ...)&lt;br /&gt;
&lt;br /&gt;
{{#widget:Html5Media&lt;br /&gt;
|url=http://kiilo.org:8080/pachube.ogg&lt;br /&gt;
|width=200&lt;br /&gt;
|height=32&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
from their website: http://community.pachube.com/iot_hackathon&lt;br /&gt;
&lt;br /&gt;
= Pachube International Internet of Things Hackathon - April 8-9, 2011 =&lt;br /&gt;
&lt;br /&gt;
* 24 hours&lt;br /&gt;
* hackathon&lt;br /&gt;
* pachube&lt;br /&gt;
&lt;br /&gt;
The First Pachube International Internet of Things Hackathon is a global 24-hour event that starts on April 8, 2011 at 2pm (UK time) and ends on April 9, 2011 at 2pm (UK time). (kiilo &#039;&#039;&#039;08.04.2011 15:00 MEZ - 09.04.2011 15:00 Mez)&#039;&#039;&#039; &lt;br /&gt;
&lt;br /&gt;
Calling all developers, designers, makers, mixers, mashers, tinkerers, philosopher-mechanics and sales engineers! Join us in helping to define and build the Internet of Things on Global Internet of Things Day! Use Pachube if you want, or build on other APIs - make something physical, or virtual; hardware or software; conceptual or practical - the point is for us to spend 24 hours connecting up our things to the web, our environments to our things, and our things to US! Starts on April 8, 2011 at 2pm UK time (which is 10pm in Tokyo, 11pm in Sydney, 6am in San Francisco) and goes on for 24 hours until 2pm (UK time) on April 9, 2011.&lt;br /&gt;
&lt;br /&gt;
[http://community.pachube.com/iot_hackathon We will continue to update this page with details].&lt;br /&gt;
&lt;br /&gt;
We will be hosting a hackathon here in London (address to be confirmed) but we also expect Pachube&#039;s global community to host sister events around the world. The idea is for us all, in countries throughout the world, to spend 24 hours on Global Internet of Things day building new devices, applications, and tools, and experimenting with bleeding-edge (beta) Pachube features, connecting to each others&#039; devices and environments in realtime across the planet, and building up a repertoire of innovative applications and services for the Internet of Things that make the vision of a connected planet a reality!&lt;br /&gt;
&lt;br /&gt;
Please either join us in London or host your own local event!&lt;br /&gt;
&lt;br /&gt;
== TWITTER hashtag ==&lt;br /&gt;
for TWITTER use this hashtag &#039;&#039;&#039;[http://twitter.com/#!/search?q=%23pachubehack #pachubehack]&#039;&#039;&#039; !!!&lt;br /&gt;
* http://twitter.com/#!/search?q=%23pachubehack &lt;br /&gt;
&lt;br /&gt;
= Flickr Hashtag =&lt;br /&gt;
&lt;br /&gt;
* http://www.flickr.com/photos/tags/pachubehack/&lt;br /&gt;
&lt;br /&gt;
= what is planned in zurich? =&lt;br /&gt;
&lt;br /&gt;
have a nice come together for some sort of happy hacking soldering party. &lt;br /&gt;
&lt;br /&gt;
Location: MechArtLab http://maps.google.com/maps?q=Hohlstr.+52,+Zurich&lt;br /&gt;
&lt;br /&gt;
We&#039;ll be there from 15:00 Zürich local time.&lt;br /&gt;
&lt;br /&gt;
Bring your own beer, food, sleeping bag/mat.&lt;br /&gt;
&lt;br /&gt;
Please edit this page to add your name (contact exchange by skype: &amp;quot;kiilo_&amp;quot; in case you dont want to publish your details)&lt;br /&gt;
&lt;br /&gt;
== up and running ==&lt;br /&gt;
&lt;br /&gt;
* http://www.pachube.com/feeds/21749 (mbed, MechArtLab temperature)&lt;br /&gt;
* http://www.pachube.com/feeds/13013 (Voltage in Weinfelden)&lt;br /&gt;
* http://www.pachube.com/feeds/2626 (Sensirion sht15, temperature, humidity)&lt;br /&gt;
* http://try.yaler.net/tamberg-polar (tamberg&#039;s heart rate, now via Bluetooth)&lt;br /&gt;
* http://demo.yaler.net/~arduino/led (at Technopark Zürich, with cam)&lt;br /&gt;
* http://demo.yaler.net/~arduino2/led (same as above, at the MechArtLab, use Firefox/Firebug to see API)&lt;br /&gt;
* http://www.pachube.com/feeds/22368 (MechArtLab light intensity sensor)&lt;br /&gt;
* http://www.pachube.com/feeds/22383 (tamberg&#039;s heart rate, now finally on Pachube)&lt;br /&gt;
* http://www.pachube.com/feeds/22377 (Arduino value feed w/ light sensor)&lt;br /&gt;
* [[kiilo-ArduinoEthernetShield-Read/Write]]&lt;br /&gt;
&lt;br /&gt;
== participating ==&lt;br /&gt;
&lt;br /&gt;
* [[User:Kiilo]] contact skype &amp;quot;kiilo_&amp;quot; will bring:&lt;br /&gt;
[[File:PachubeGateway.png|200px]]&lt;br /&gt;
** 2x ethernetshield + 1x wifi adapter + arduino assembled to messure temp % humidity&lt;br /&gt;
** pachube OSC gateway made by proessing + some small PD patches to start with &lt;br /&gt;
** slow internet connection by mobile phone &lt;br /&gt;
** linksys wlan router - has also 4 ethernet ports&lt;br /&gt;
** some relais so we can switch 230V &lt;br /&gt;
** some solid state relais&lt;br /&gt;
** more sensors (GPS, accelerometer, servos, ... decent set)&lt;br /&gt;
** diverse arduino from my personal collection (nano, mini, lilypad ...) &lt;br /&gt;
** stereo microphone + mixer for nice streaming of acoustic atmosphere -- prepared and running&lt;br /&gt;
&lt;br /&gt;
* [http://twitter.com/tamberg @tamberg]&lt;br /&gt;
** 8 port Ethernet Switch and some cables&lt;br /&gt;
** Rather low bandwidth GPRS-to-Wifi/LAN Gateway&lt;br /&gt;
** Arduino w/ Ethernet Shield&lt;br /&gt;
** [http://netduino.com/netduinoplus/specs.htm Netduino Plus] w/ Ethernet&lt;br /&gt;
** [http://netduino.com/netduino/specs.htm Netduino]&lt;br /&gt;
** [http://www.sparkfun.com/products/9367 WiFly Shield]&lt;br /&gt;
** [http://www.instructables.com/id/Arduino-Web-LED/ Web controlled tri color LED]&lt;br /&gt;
** [http://www.flickr.com/photos/23124942@N03/5513400724/ Web controlled power outlet] (Optocoupler based)&lt;br /&gt;
** [http://www.flickr.com/photos/23124942@N03/5471584311/ Web controlled radio controlled power outlets] (work in progress)&lt;br /&gt;
** [http://www.flickr.com/photos/23124942@N03/sets/72157624780632982/ Web enabled bathroom scale] (work in progress)&lt;br /&gt;
** [http://www.sparkfun.com/products/8661 Polar heart rate monitor interface] board / sensor&lt;br /&gt;
** [http://oreilly.com/catalog/9780596802479 Arduino Cookbook]&lt;br /&gt;
** [http://oreilly.com/catalog/0636920013037 Getting Started with the Internet of Things] book&lt;br /&gt;
&lt;br /&gt;
* dusjagr&lt;br /&gt;
** a lot of worms&lt;br /&gt;
&lt;br /&gt;
* gaess&lt;br /&gt;
** Most important first: ADSL Internet is ordered, should by up and running on 8th April!&lt;br /&gt;
** Arduino and magnetic field sensors&lt;br /&gt;
** i could bring 1 or 2 triacs to&lt;br /&gt;
** Brain ready to learn!&lt;br /&gt;
** I can provide sleeping space for 3 people in my living room, about 15min by foot from the lab.&lt;br /&gt;
&lt;br /&gt;
* gandalf&lt;br /&gt;
** a bunch of arduinos and mbeds&lt;br /&gt;
** arduino ethernet shield for pachube integration&lt;br /&gt;
** various sensors&lt;br /&gt;
** two xbee modules&lt;br /&gt;
** different lcd and tft devices&lt;br /&gt;
** some lcd contraptions for nice visuals&lt;br /&gt;
&lt;br /&gt;
* christoph&lt;br /&gt;
** mbed&lt;br /&gt;
** bunch of X-Bees&lt;br /&gt;
** soldering station&lt;br /&gt;
** seeeduino stalker&lt;br /&gt;
** various sensors curent&lt;br /&gt;
&lt;br /&gt;
* orl&lt;br /&gt;
** Kinect interface (first steps!)&lt;br /&gt;
** laptop with various dev tools and Executable Sound installed&lt;br /&gt;
** some ideas. Kinect-powered sound generation with Stahl&#039;s Hackteria microscope over OSC? (if possible) ;)&lt;br /&gt;
&lt;br /&gt;
* [[User:Stahl]]&lt;br /&gt;
** USB GSM modem (with software - need SIM) &lt;br /&gt;
** toaster&lt;br /&gt;
** microsope&lt;br /&gt;
** parts and stuff&lt;br /&gt;
&lt;br /&gt;
== TODO ==&lt;br /&gt;
* open call&lt;br /&gt;
* increase comfort&lt;br /&gt;
* something i dont know yet ...&lt;br /&gt;
&lt;br /&gt;
== pachube community RSS ==&lt;br /&gt;
{{#widget:Feed&lt;br /&gt;
|feedurl=http://community.pachube.com/rss.xml&lt;br /&gt;
|chan=n&lt;br /&gt;
|num=12&lt;br /&gt;
|desc=0&lt;br /&gt;
|date=n&lt;br /&gt;
|targ=n&lt;br /&gt;
}}&lt;/div&gt;</summary>
		<author><name>0rel</name></author>
	</entry>
	<entry>
		<id>https://wiki.sgmk-ssam.ch/index.php?title=Wahl_der_neuen_Vorstandmitglieder&amp;diff=9506</id>
		<title>Wahl der neuen Vorstandmitglieder</title>
		<link rel="alternate" type="text/html" href="https://wiki.sgmk-ssam.ch/index.php?title=Wahl_der_neuen_Vorstandmitglieder&amp;diff=9506"/>
		<updated>2021-04-19T18:02:55Z</updated>

		<summary type="html">&lt;p&gt;0rel: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;aktueller Vorstand:&lt;br /&gt;
&lt;br /&gt;
Oliver Jäggi (Präsident)&lt;br /&gt;
&lt;br /&gt;
Marc Dusseiller&lt;br /&gt;
&lt;br /&gt;
Urban Bieri&lt;br /&gt;
&lt;br /&gt;
Petra Zumbach&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
zur Wahl vorgeschlagene neue Vorstandsmitglieder:&lt;br /&gt;
&lt;br /&gt;
Jana Honegger&lt;br /&gt;
&lt;br /&gt;
Tillo Bosshard&lt;/div&gt;</summary>
		<author><name>0rel</name></author>
	</entry>
	<entry>
		<id>https://wiki.sgmk-ssam.ch/index.php?title=KIBLIX_2011_-_Participants_List&amp;diff=9505</id>
		<title>KIBLIX 2011 - Participants List</title>
		<link rel="alternate" type="text/html" href="https://wiki.sgmk-ssam.ch/index.php?title=KIBLIX_2011_-_Participants_List&amp;diff=9505"/>
		<updated>2021-04-19T17:56:43Z</updated>

		<summary type="html">&lt;p&gt;0rel: /* Swiss Mechatronic Art Society – SGMK  (CH) */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
== International Artists ==&lt;br /&gt;
&lt;br /&gt;
=== framework radio (UK/EST) - workshop &amp;amp; perforamnce ===&lt;br /&gt;
&lt;br /&gt;
Field-recording, phonography, the art of sound-hunting; open your ears and listen!&lt;br /&gt;
Snemanje na terenu, phonografija, umetnost lovljenja zvoka, odpri ušesa in poslušaj!&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== dimension plus (TW/HK) - workshop &amp;amp; symposia ===&lt;br /&gt;
Devoted to the interactive digital environments, constantly generating new ideas that deal with digital and analog technologies.&lt;br /&gt;
Predan interaktivnim digitalnim okoljem, nenehno ustvarjajo nove ideje, povezane z digitalnimi in analognimi tehnologijami.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Enrique Thomas (ES) - installation ===&lt;br /&gt;
Sound artist - interactive to other existing art forms - visual, computer performative - multifunctional interfaces expression&lt;br /&gt;
Interaktovno na ostale obstoječe umetniške prakse – vizualno, računalniško performativno – vmesniki multifunkcionalnega izražanja.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== »v ŠUM_011« (SI) - installation &amp;amp; lab collaboration ===&lt;br /&gt;
School of Arts, University of Nova Gorica - a collective of students and professors.&lt;br /&gt;
What is needed to transform the creative processes in free connections between movement, sound and picture? How in this context describe (programming) and implement the interaction of different groups, eg. in the face &amp;quot;ignorant&amp;quot; child, &amp;quot;lay person&amp;quot; and &amp;quot;professional&amp;quot; artist?&lt;br /&gt;
Visoka šola za umetnost Univerze v Novi Gorici – kolektiv študentov in profesorjev. &lt;br /&gt;
Kako je potrebno preoblikovati ustvarjalne procese v prostih povezavah med gibom, zvokom in sliko? Kako v tem kontekstu opisati in (programsko) izvesti interakcije različnih uporabniških skupin, npr. v soočenju »neukega« otroka,  »laika« in »profesionalnega« umetnika?&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== HACKING DINNER (CZ) - performative lecture &amp;amp; symposia ===&lt;br /&gt;
future of dining&lt;br /&gt;
Take this as an opportunity to network over DNA &amp;amp; food &amp;amp; design&lt;br /&gt;
prihodnost obedovanja.&lt;br /&gt;
Izkoristi priložnost druženja ob DNA &amp;amp; hrani &amp;amp; in dizajnu.&lt;br /&gt;
&lt;br /&gt;
== Invited Swiss Artsists and Collectives ==&lt;br /&gt;
&lt;br /&gt;
=== Swiss Mechatronic Art Society – SGMK  (CH)===&lt;br /&gt;
&lt;br /&gt;
The Swiss Mechatronic Art Society (SGMK, established in 2006) is a collective of engineers, hackers, scientists and artists that joined to collaborate and promote on creative and critical uses of technology. They develop DIY technologies and organize collaborative events, such as a yearly research-camp in the mountains and local regular workshops in electronics, robotics, physical computing, diy-biology, lofi-music etc. They run a public hacker space „OpenMechArt Lab“ (since 2009) and organize the international diy* festival, held every year in Zürich since 2005. They also cooperate with various socio-cultural organisations to hold creative technology courses at schools and youth communities. With the „diy makeaway“, a series of mini-workshops for kids and other open-minded people, they have been present internationally at various exhibitions and festivals, such as SHIFT Festival in Basel, at Copy!, Poolloop and Dorkbot in Zürich, CTM.09 in Berlin, CEMA in Bangalore, Cellsbutton#03, #04, #05 in Yogyakarta, ISEA2010 in Dortmund, Pixelache in Helsinki and many more.&lt;br /&gt;
&lt;br /&gt;
SGMK bodo: &lt;br /&gt;
Marc Dusseiller (CH)&lt;br /&gt;
Liu, Pei-Wen (TW/CH)&lt;br /&gt;
Maki3000 (CH)&lt;br /&gt;
&lt;br /&gt;
=== Effi Tanner (CH) - workshop mentor ===&lt;br /&gt;
Suitcases are the ultimate sign of mobility. For an traveling artist it‘s the easiest thing to have his work as mobile as possible. Therefore we will talk about traveling, exhibitions, organisations and different kinds of (Art)spaces.&lt;br /&gt;
Kovčki so ultimativni simboli mobilnosti. Za potujočega umetnika je najlažje, da je njegovo delo kar se da mobilno. Zatorej bomo govorili o potovanju, razstavah, organizacijah in različnih vrsta (Art) prostorov&lt;br /&gt;
&lt;br /&gt;
=== Tobias Hoffmann aka kiilo (DE/CH)  - workshop mentor ===&lt;br /&gt;
&amp;quot;I&#039;ve studied physics, special education, fine art and New Media. I am working in the field of audiovisual processing with an emphasis on collaborating with other artists by using interactive programs which allow real-time MM (man-machine) communication«&lt;br /&gt;
&amp;quot;Študiral sem fiziko, specializiral s področja likovne umetnosti in novih medijev. Delam na področju avdiovizualne obdelave s poudarkom na sodelovanju z drugimi umetniki ob uporabi interaktivnih programov, ki omogočajo komunikacijo v realnem času ČS (človek-stroj)«&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Pe Lang (CH) - installation &amp;amp; performative lecture ===&lt;br /&gt;
His work includes sound installations, live performances and compositions based on elegant and minimal kinetic systems, combined with different devices created by himself&lt;br /&gt;
Njegovo delo vključuje zvočne instalacije, nastope v živo in kompozicije na osnovi elegantnih in minimalističnih kinetičnih sistemov, v kombinaciji z različnimi napravami, ki jih ustvari sam.&lt;br /&gt;
&lt;br /&gt;
=== Nara Phister &amp;amp; Mirzlekid  (CH/AT) - performance / urban intervention ===&lt;br /&gt;
A performance series of urban intervention in rediscovering life cycle of a city, about growth and transciense.&lt;br /&gt;
Serija performansov / urbanih intervencij v kontekstu ponovnega odkrivanja življenjskega cikla mesta, o rasti in minljivosti.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Jonas Ohrstrom (CH) - workshop &amp;amp; sound performance ===&lt;br /&gt;
Musician, coder, co-founded of Sonicsquirrel, an groundbreaking platform to promote free music and netlable.&lt;br /&gt;
Glasbenik, koder, soustanovitelj Sonicsquirrel, revolucionarne platforme za spodbujanje prosto dostopne glasbe in netznamk&lt;br /&gt;
&lt;br /&gt;
=== Fabienne Meyer &amp;amp; Marc Widmer (CH) - workshop &amp;amp; installation ===&lt;br /&gt;
&lt;br /&gt;
=== Tim &amp;amp; Puma Mimi (JP/CH) - band performance ===&lt;br /&gt;
Collective madness in making funky, playful electronic music.&lt;br /&gt;
Kolektivna norost v ustvarjanju funky, razposajene elektronske glasbe.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Veli &amp;amp; Amos (SI/CH) - installation &amp;amp; urban intervention ===&lt;br /&gt;
smoke is in the air&lt;br /&gt;
dim je v zraku&lt;br /&gt;
&lt;br /&gt;
=== Christoph Stähli (CH) - dj set &amp;amp; spontaneous workshop ===&lt;br /&gt;
Christoph Stähli is an artist based in Zurich, Switzerland, with a wide range of activities involving developing content and concepts for LED displays, performing lo-fi music diy workshops as a member of the Swiss Mechatronic Art Society, developing experimental audio/visual software for Nintendo DS, GP2x and other platforms. At KIBLIX he will perform a dj set and organise spontaneous USB stick workshops.&lt;/div&gt;</summary>
		<author><name>0rel</name></author>
	</entry>
	<entry>
		<id>https://wiki.sgmk-ssam.ch/index.php?title=STM32_dev&amp;diff=9504</id>
		<title>STM32 dev</title>
		<link rel="alternate" type="text/html" href="https://wiki.sgmk-ssam.ch/index.php?title=STM32_dev&amp;diff=9504"/>
		<updated>2021-04-14T18:04:35Z</updated>

		<summary type="html">&lt;p&gt;0rel: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Overview ==&lt;br /&gt;
&lt;br /&gt;
Notes on STM32 microcontrollers and on how to get them working in DIY projects.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;/// this is a work in progress draft ///&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
== Software ==&lt;br /&gt;
&lt;br /&gt;
All about software tools for STM32 dev. Development environments, compilers, debuggers, IDEs etc.&lt;br /&gt;
&lt;br /&gt;
=== ARM toolchains ===&lt;br /&gt;
&lt;br /&gt;
==== gcc-arm-embedded Toolchain ====&lt;br /&gt;
&lt;br /&gt;
Install the GCC arm-none-eabi toolchain for your OS. On Arch Linux this can be done with the package manager:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
$ sudo pacman -S arm-none-eabi-gcc arm-none-eabi-gdb arm-none-eabi-binutils arm-none-eabi-newlib&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Alternatively, it can be built from scratch, to have all tools and their sources in one place.&lt;br /&gt;
&lt;br /&gt;
* Download the sources here: https://launchpad.net/gcc-arm-embedded/+download&lt;br /&gt;
* Install the &#039;&#039;common tools and libraries&#039;&#039; like described in the [https://launchpadlibrarian.net/231136652/How-to-build-toolchain.pdf documentation].&lt;br /&gt;
* Build the toolchain. - On my system, the following steps were required:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
$ cp gcc-arm-none-eabi-5_2-2015q4-20151219-src.tar.bz2 ~/toolchain&lt;br /&gt;
$ cd ~/toolchain&lt;br /&gt;
$ tar -xjf gcc-arm-none-eabi-5_2-2015q4-20151219-src.tar.bz2&lt;br /&gt;
$ cd ./gcc-arm-none-eabi-5_2-2015q4-20151219/src&lt;br /&gt;
$ find -name &#039;*.tar.*&#039; | xargs -I% tar -xf %&lt;br /&gt;
$ cd ..&lt;br /&gt;
$ ./build-prerequisites.sh --skip_steps=mingw32&lt;br /&gt;
$ ./build-toolchain.sh --skip_steps=mingw32,manual&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
Note that those &#039;&#039;skip_steps&#039;&#039; options were required in my case.&lt;br /&gt;
&lt;br /&gt;
==== Linaro Toolchain ====&lt;br /&gt;
&lt;br /&gt;
The [https://en.wikipedia.org/wiki/Linaro Linaro] toolchain seems to be famous as well.&lt;br /&gt;
&lt;br /&gt;
Install it with your package manager if available, or build it yourself:&amp;lt;br /&amp;gt;&lt;br /&gt;
https://wiki.linaro.org/WorkingGroups/ToolChain&amp;lt;br /&amp;gt;&lt;br /&gt;
https://wiki.linaro.org/WorkingGroups/ToolChain/FAQ&lt;br /&gt;
&lt;br /&gt;
==== devkitpro devkitARM toolchain ====&lt;br /&gt;
&lt;br /&gt;
Another gcc variant: http://devkitpro.org/&lt;br /&gt;
&lt;br /&gt;
Used in the homebrew scene for game consoles like the GP32, Nintendo (3)DS and GBA. It can [http://www.pouet.net/prod.php?which=59095 apparently] also be used for the STM32s as well! And generates probably more optimized binaries?&lt;br /&gt;
&lt;br /&gt;
(On Arch it can be installed from the AUR: https://aur.archlinux.org/packages/devkitarm-bin/ . But beware, the compiler, link, binutils have all the same name as the ones from the official GCC arm-none-eabi toolchain. So it&#039;s probably better to install it manually.)&lt;br /&gt;
&lt;br /&gt;
=== STM32CubeMX on Linux ===&lt;br /&gt;
&lt;br /&gt;
STM32CubeMX is a code generator for STM32 micros that can come in handy when you start a new project. It generates all the necessary init and HAL code, library and custom pin mux code for your specific MCU.&lt;br /&gt;
&lt;br /&gt;
Unfortunately, it comes as a Windows EXE and ST doesn&#039;t mention that it actually is a Java application. Luckily it can be installed on Linux by hand (thanks to 5V Joe&#039;s great note [http://fivevolt.blogspot.ch/2014/07/installing-stm32cubemx-on-linux.html there]):&lt;br /&gt;
&lt;br /&gt;
* Download [http://www.st.com/web/catalog/tools/FM147/CL1794/SC961/SS1743/PF259242?icmp=stm32cubemx_pron_prcube_feb2014&amp;amp;sc=stm32cube-pr STM32CubeMX].&lt;br /&gt;
* Install the application (tested in January 2016):&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
$ unzip SetupSTM32CubeMX-4.12.0.exe -d stm32cube&lt;br /&gt;
$ cd stm32cube&lt;br /&gt;
$ java -cp . com.izforge.izpack.installer.bootstrap.Installer&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
* Run:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
$ cd &amp;lt;install_dir&amp;gt;&lt;br /&gt;
$ unzip STM32CubeMX.exe&lt;br /&gt;
$ java -cp . com.st.microxplorer.maingui.STM32CubeMX&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== STM32CubeMX to Makefile ===&lt;br /&gt;
&lt;br /&gt;
For whatever reason, STM32CubeMX does not export plain GCC/Makefiles along with the initialization code. But instead, it supports an unpopular IDE called [http://www.st.com/web/catalog/tools/FM147/CL1794/SC961/SS1533/PF261797 SW4STM32], which is also based on free GNU tools. So after installing STM32CubeMX, these are the steps to get the GCC/Makefile project running:&lt;br /&gt;
&lt;br /&gt;
* Get this nice Python script by [http://www.ba0sh1.com/ Baoshi] to generate the Makefile for an exported SW4STM32 project:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
$ git clone https://github.com/baoshi/CubeMX2Makefile&lt;br /&gt;
$ cd CubeMX2Makefile&lt;br /&gt;
$ python2 CubeMX2Makefile.py &amp;lt;your_sw4stm32_prject_dir&amp;gt;&lt;br /&gt;
$ cd &amp;lt;your_sw4stm32_prject_dir&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* Fix a tiny bug in the generated Makefile (tested in January 2016). More can be read [http://www.ba0sh1.com/stm32cubemx-gcc-makefile/ here].&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
$ grep __weak Makefile &lt;br /&gt;
C_DEFS = -D__weak=&amp;quot;__attribute__\(\(weak\)\)&amp;quot; -D__packed=&amp;quot;__attribute__\(\(__packed__\)\)&amp;quot; -DUSE_HAL_DRIVER -DSTM32F072xB&lt;br /&gt;
$ sed -i &#039;s/\\(\\(weak\\)\\)/((weak))/g&#039; Makefile &lt;br /&gt;
$ sed -i &#039;s/\\(\\(packed\\)\\)/((packed))/g&#039; Makefile &lt;br /&gt;
$ grep __weak Makefile &lt;br /&gt;
C_DEFS = -D__weak=&amp;quot;__attribute__((weak))&amp;quot; -D__packed=&amp;quot;__attribute__\(\(__packed__\)\)&amp;quot; -DUSE_HAL_DRIVER -DSTM32F072xB&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* Then build the binary:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
$ make&lt;br /&gt;
(...)&lt;br /&gt;
arm-none-eabi-size build/STM32F072RBT6.elf&lt;br /&gt;
   text	   data	    bss	    dec	    hex	filename&lt;br /&gt;
   4568	     12	   1572	   6152	   1808	build/STM32F072RBT6.elf&lt;br /&gt;
arm-none-eabi-objcopy -O ihex build/STM32F072RBT6.elf build/STM32F072RBT6.hex&lt;br /&gt;
arm-none-eabi-objcopy -O binary -S build/STM32F072RBT6.elf build/STM32F072RBT6.bin	&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Flash ===&lt;br /&gt;
&lt;br /&gt;
Install OpenOCD and STLINK. On Arch Linux:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
sudo pacman -S stlink openocd&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now [http://openocd.org/ OpenOCD] and (arm-none-eabi-)gdb can be used to program and debug the MCU. All discovery boards also come with an ST-LINK/V2 programmer right built in speaking over USB to the host and over JTAG/[http://www.arm.com/products/system-ip/debug-trace/coresight-soc-components/serial-wire-debug.php SWD] to the target (note: only two pins are actually required for SWD debugging/flashing (SWDIO/SWCLK), but that for later (see also [[#Hardware]])). STM32 Discovery Boards should show up in the lsusb list like that:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
$ lsusb&lt;br /&gt;
(...)&lt;br /&gt;
Bus 003 Device 006: ID 0483:3748 STMicroelectronics ST-LINK/V2&lt;br /&gt;
(...)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
OpenOCD can now act as a &amp;quot;middleman&amp;quot; between the ST-LINK programmer and the user. As a server on the host, to which you can connect with telnet and GDB.&lt;br /&gt;
&lt;br /&gt;
To configure OpenOCD, put a configuration file called opencd.cfg into the project folder and start OpenOCD. While working on the project, let it run there in the foreground to see all the logs...&lt;br /&gt;
&lt;br /&gt;
For the [http://www.st.com/st-web-ui/static/active/jp/resource/technical/document/user_manual/DM00099401.pdf STM32 F072 Discovery] board this should work, for example:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
$ cd &amp;lt;project_directory&amp;gt;&lt;br /&gt;
$ echo &amp;quot;source [find board/stm32f0discovery.cfg]&amp;quot; &amp;gt; openocd.cfg&lt;br /&gt;
$ openocd&lt;br /&gt;
Open On-Chip Debugger 0.9.0 (2015-05-19-13:50)&lt;br /&gt;
Licensed under GNU GPL v2&lt;br /&gt;
For bug reports, read&lt;br /&gt;
	http://openocd.org/doc/doxygen/bugs.html&lt;br /&gt;
Info : The selected transport took over low-level target control. The results might differ compared to plain JTAG/SWD&lt;br /&gt;
adapter speed: 1000 kHz&lt;br /&gt;
adapter_nsrst_delay: 100&lt;br /&gt;
none separate&lt;br /&gt;
srst_only separate srst_nogate srst_open_drain connect_deassert_srst&lt;br /&gt;
Info : Unable to match requested speed 1000 kHz, using 950 kHz&lt;br /&gt;
Info : Unable to match requested speed 1000 kHz, using 950 kHz&lt;br /&gt;
Info : clock speed 950 kHz&lt;br /&gt;
Info : STLINK v2 JTAG v17 API v2 SWIM v0 VID 0x0483 PID 0x3748&lt;br /&gt;
Info : using stlink api v2&lt;br /&gt;
Info : Target voltage: 2.896454&lt;br /&gt;
Info : stm32f0x.cpu: hardware has 4 breakpoints, 2 watchpoints&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
(Don&#039;t worry about those warnings about the wrong clock speed for now...)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
In order to program the flash, connect to OpenOCD via telnet in another terminal:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
$ telnet 127.0.0.1 4444&lt;br /&gt;
Trying 127.0.0.1...&lt;br /&gt;
Connected to 127.0.0.1.&lt;br /&gt;
Escape character is &#039;^]&#039;.&lt;br /&gt;
Open On-Chip Debugger&lt;br /&gt;
&amp;gt; &lt;br /&gt;
&amp;gt; reset halt&lt;br /&gt;
target state: halted&lt;br /&gt;
target halted due to debug-request, current mode: Thread &lt;br /&gt;
xPSR: 0xc1000000 pc: 0x080014d0 msp: 0x20004000&lt;br /&gt;
&amp;gt; flash probe 0&lt;br /&gt;
device id = 0x20016448&lt;br /&gt;
flash size = 128kbytes&lt;br /&gt;
flash &#039;stm32f1x&#039; found at 0x08000000&lt;br /&gt;
&amp;gt; flash write_image erase build/STM32F072RBT6.elf&lt;br /&gt;
auto erase enabled&lt;br /&gt;
target state: halted&lt;br /&gt;
target halted due to breakpoint, current mode: Thread &lt;br /&gt;
xPSR: 0x61000000 pc: 0x2000003a msp: 0x20004000&lt;br /&gt;
wrote 6144 bytes from file build/STM32F072RBT6.elf in 0.503961s (11.906 KiB/s)&lt;br /&gt;
&amp;gt; reset run&lt;br /&gt;
&amp;gt; exit&lt;br /&gt;
Connection closed by foreign host.&lt;br /&gt;
$&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This should write the binary to the flash memory and start the program.&lt;br /&gt;
Of course, all those steps can be automated further and integrated into an IDE, but that&#039;s for later...&lt;br /&gt;
&lt;br /&gt;
To program the STM32F0Discovery board for example, this can be used to just flash the chip:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
$ openocd -f board/stm32f0discovery.cfg -c &amp;quot;program build/STM32F072RBT6.elf verify reset exit&amp;quot; &lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
To program a custom board for example with the STM32F0x chip, a command like this can be used:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
$ openocd -f interface/stlink-v2.cfg -f target/stm32f0x.cfg -c &amp;quot;program testSTM32F072_interrupt_test0.elf verify reset exit&amp;quot;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
To make things more convenient, add a new target &#039;&#039;flash&#039;&#039; to the Makefile with this command, and you can simply run &#039;&#039;make flash&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The exported main.c from STM32CubeMX was only slightly modified to let the user LEDs flash and react to the user pushbutton:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
******************************************************************************&lt;br /&gt;
* main.c *&lt;br /&gt;
******************************************************************************&lt;br /&gt;
&lt;br /&gt;
#include &amp;quot;stm32f0xx_hal.h&amp;quot;&lt;br /&gt;
&lt;br /&gt;
void SystemClock_Config(void);&lt;br /&gt;
static void MX_GPIO_Init(void);&lt;br /&gt;
&lt;br /&gt;
int main(void)&lt;br /&gt;
{&lt;br /&gt;
  /* Reset of all peripherals, Initializes the Flash interface and the Systick. */&lt;br /&gt;
  HAL_Init();&lt;br /&gt;
&lt;br /&gt;
  /* Configure the system clock */&lt;br /&gt;
  SystemClock_Config();&lt;br /&gt;
&lt;br /&gt;
  /* Initialize all configured peripherals */&lt;br /&gt;
  MX_GPIO_Init();&lt;br /&gt;
&lt;br /&gt;
  while (1)&lt;br /&gt;
  {&lt;br /&gt;
    uint32_t delay;&lt;br /&gt;
    if( HAL_GPIO_ReadPin( GPIOA, GPIO_PIN_0 ) == GPIO_PIN_SET )&lt;br /&gt;
      delay = 50;&lt;br /&gt;
    else&lt;br /&gt;
      delay = 250;&lt;br /&gt;
&lt;br /&gt;
    HAL_GPIO_TogglePin( GPIOC, GPIO_PIN_9 );&lt;br /&gt;
    HAL_Delay( delay );&lt;br /&gt;
    HAL_GPIO_TogglePin( GPIOC, GPIO_PIN_8 );&lt;br /&gt;
    HAL_Delay( delay );&lt;br /&gt;
    HAL_GPIO_TogglePin( GPIOC, GPIO_PIN_7 );&lt;br /&gt;
    HAL_Delay( delay );&lt;br /&gt;
    HAL_GPIO_TogglePin( GPIOC, GPIO_PIN_6 );&lt;br /&gt;
    HAL_Delay( delay );&lt;br /&gt;
&lt;br /&gt;
  }&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
/** System Clock Configuration&lt;br /&gt;
*/&lt;br /&gt;
void SystemClock_Config(void)&lt;br /&gt;
{&lt;br /&gt;
&lt;br /&gt;
  RCC_OscInitTypeDef RCC_OscInitStruct;&lt;br /&gt;
  RCC_ClkInitTypeDef RCC_ClkInitStruct;&lt;br /&gt;
&lt;br /&gt;
  RCC_OscInitStruct.OscillatorType = RCC_OSCILLATORTYPE_HSI;&lt;br /&gt;
  RCC_OscInitStruct.HSIState = RCC_HSI_ON;&lt;br /&gt;
  RCC_OscInitStruct.HSICalibrationValue = 16;&lt;br /&gt;
  RCC_OscInitStruct.PLL.PLLState = RCC_PLL_NONE;&lt;br /&gt;
  HAL_RCC_OscConfig(&amp;amp;RCC_OscInitStruct);&lt;br /&gt;
&lt;br /&gt;
  RCC_ClkInitStruct.ClockType = RCC_CLOCKTYPE_SYSCLK;&lt;br /&gt;
  RCC_ClkInitStruct.SYSCLKSource = RCC_SYSCLKSOURCE_HSI;&lt;br /&gt;
  RCC_ClkInitStruct.AHBCLKDivider = RCC_SYSCLK_DIV1;&lt;br /&gt;
  RCC_ClkInitStruct.APB1CLKDivider = RCC_HCLK_DIV1;&lt;br /&gt;
  HAL_RCC_ClockConfig(&amp;amp;RCC_ClkInitStruct, FLASH_LATENCY_0);&lt;br /&gt;
&lt;br /&gt;
  HAL_SYSTICK_Config(HAL_RCC_GetHCLKFreq()/1000);&lt;br /&gt;
&lt;br /&gt;
  HAL_SYSTICK_CLKSourceConfig(SYSTICK_CLKSOURCE_HCLK);&lt;br /&gt;
&lt;br /&gt;
  /* SysTick_IRQn interrupt configuration */&lt;br /&gt;
  HAL_NVIC_SetPriority(SysTick_IRQn, 0, 0);&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
/** Configure pins as&lt;br /&gt;
        * Analog&lt;br /&gt;
        * Input&lt;br /&gt;
        * Output&lt;br /&gt;
        * EVENT_OUT&lt;br /&gt;
        * EXTI&lt;br /&gt;
*/&lt;br /&gt;
void MX_GPIO_Init(void)&lt;br /&gt;
{&lt;br /&gt;
&lt;br /&gt;
  GPIO_InitTypeDef GPIO_InitStruct;&lt;br /&gt;
&lt;br /&gt;
  /* GPIO Ports Clock Enable */&lt;br /&gt;
  __GPIOA_CLK_ENABLE();&lt;br /&gt;
  __GPIOC_CLK_ENABLE();&lt;br /&gt;
&lt;br /&gt;
  /*Configure GPIO pin : PA0 */&lt;br /&gt;
  GPIO_InitStruct.Pin = GPIO_PIN_0;&lt;br /&gt;
  GPIO_InitStruct.Mode = GPIO_MODE_INPUT;&lt;br /&gt;
  GPIO_InitStruct.Pull = GPIO_NOPULL;&lt;br /&gt;
  HAL_GPIO_Init(GPIOA, &amp;amp;GPIO_InitStruct);&lt;br /&gt;
&lt;br /&gt;
  /*Configure GPIO pins : PC6 PC7 PC8 PC9 */&lt;br /&gt;
  GPIO_InitStruct.Pin = GPIO_PIN_6|GPIO_PIN_7|GPIO_PIN_8|GPIO_PIN_9;&lt;br /&gt;
  GPIO_InitStruct.Mode = GPIO_MODE_OUTPUT_PP;&lt;br /&gt;
  GPIO_InitStruct.Pull = GPIO_NOPULL;&lt;br /&gt;
  GPIO_InitStruct.Speed = GPIO_SPEED_LOW;&lt;br /&gt;
  HAL_GPIO_Init(GPIOC, &amp;amp;GPIO_InitStruct);&lt;br /&gt;
&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
(&lt;br /&gt;
Note that pins -- among various other things -- can be customized in the CubeMX editor. Reexporting code to an existing project is straight forward, and can be done easily while the old Makefile keeps valid for minor changes... - However, STM32CubeMX looks still quite unfinished to me. It&#039;s a nice concept, but where are all the ST libraries, for example for the [http://www.st.com/web/en/catalog/tools/FM147/CL1794/SC961/SS1743/LN1734/PF258658# touch functionality]? It still needs to be downloaded separately... and it comes in a bloody EXE file as well! *arghs*&lt;br /&gt;
&lt;br /&gt;
Unfortunately, things seem to be a bit confusing. If you&#039;re using a STM32F0, then probably need to take a look into the [http://www.st.com/web/catalog/tools/FM147/CL1794/SC961/SS1743/LN1897/PF260612?icmp=pf260612_pron_nb_jun2014&amp;amp;sc=stm32cubef0-pr STM32CubeF0] software bundle, which contains a more up-to-date TouchSensing Library... Hm.&lt;br /&gt;
&lt;br /&gt;
Also, note that most of the provided code by ST is only documented in the source files themselves... And there are at least two vastly differing versions of the basic functions out there, what makes copy/pasting/sharing a bit difficult. I even don&#039;t know if they continue working on this code base, or if they switch over to [https://www.mbed.com/en/ mbed]. That seems to be the focus of those newer [http://www.st.com/web/catalog/tools/FM116/SC959/SS1532/LN1847?sc=stm32nucleo Nucleo] evaluation boards.&lt;br /&gt;
)&lt;br /&gt;
&lt;br /&gt;
=== Debugging: GDB ===&lt;br /&gt;
&lt;br /&gt;
GDB can be used to debug the code right on the hardware. While OpenOCD is running, you can connect to the target like this and step through the program:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
$ arm-none-eabi-gdb -tui build/STM32F072RBT6.elf&lt;br /&gt;
(...)&lt;br /&gt;
Reading symbols from build/STM32F072RBT6.elf...done.&lt;br /&gt;
&lt;br /&gt;
(gdb) target remote :3333&lt;br /&gt;
Remote debugging using :3333&lt;br /&gt;
Python Exception &amp;lt;type &#039;exceptions.NameError&#039;&amp;gt; Installation error: gdb.execute_u&lt;br /&gt;
nwinders function is missing:&lt;br /&gt;
HAL_GetTick () at Drivers/STM32F0xx_HAL_Driver/Src/stm32f0xx_hal.c:298&lt;br /&gt;
&lt;br /&gt;
(gdb) c&lt;br /&gt;
Continuing.&lt;br /&gt;
&lt;br /&gt;
Program received signal SIGINT, Interrupt.&lt;br /&gt;
0x080002f6 in HAL_Delay (Python Exception &amp;lt;type &#039;exceptions.NameError&#039;&amp;gt; Installa&lt;br /&gt;
tion error: gdb.execute_unwinders function is missing:&lt;br /&gt;
Delay=250)&lt;br /&gt;
    at Drivers/STM32F0xx_HAL_Driver/Src/stm32f0xx_hal.c:317&lt;br /&gt;
&lt;br /&gt;
(gdb) break main.c:91&lt;br /&gt;
Breakpoint 1 at 0x8001392: file Src/main.c, line 91.&lt;br /&gt;
&lt;br /&gt;
(gdb) c&lt;br /&gt;
Continuing.&lt;br /&gt;
Note: automatically using hardware breakpoints for read-only addresses.&lt;br /&gt;
Python Exception &amp;lt;type &#039;exceptions.NameError&#039;&amp;gt; Installation error: gdb.execute_u&lt;br /&gt;
nwinders function is missing:&lt;br /&gt;
&lt;br /&gt;
Breakpoint 1, main () at Src/main.c:91&lt;br /&gt;
&lt;br /&gt;
(...)&lt;br /&gt;
(gdb) detach&lt;br /&gt;
(qdb) quit&lt;br /&gt;
$&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
(Note: the -tui option is really great to inspect the code... see [http://ftp.gnu.org/old-gnu/Manuals/gdb-5.1.1/html_chapter/gdb_19.html GDB Text User Interface])&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== IDE: Eclipse SW4STM32 ===&lt;br /&gt;
&lt;br /&gt;
GOOD NEWS: This officially supported Eclipse variant should work out of the box with STM32CubeMX generated project. You simply need to register on that site, and you&#039;ll get a software package that should work:&lt;br /&gt;
&lt;br /&gt;
[http://www.st.com/content/st_com/en/products/development-tools/software-development-tools/stm32-software-development-tools/stm32-ides/sw4stm32.html SW4STM32 - System Workbench for STM32: free IDE on Windows, Linux and OS X ]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
(Side note: I don&#039;t know how well it works when you have another Eclipse installed on your system... currently testing this out.)&lt;br /&gt;
&lt;br /&gt;
=== IDE: Eclipse with GNU ARM Eclipse plugin ===&lt;br /&gt;
&lt;br /&gt;
To use Eclipse as an IDE for the STM32s, just install Eclipse and a the GNU ARM Eclipse Plugin.&lt;br /&gt;
&lt;br /&gt;
* Eclipse IDE for C/C++ (CDT). This can be installed manually or with your package manager.&lt;br /&gt;
* Eclipse Plugin: [https://gnuarmeclipse.github.io/ GNU ARM Eclipse]. - This can be done in the Eclipse Marketplace (under &#039;&#039;Help &amp;gt; Eclipse Marketplace&#039;&#039; (use the default options)).&lt;br /&gt;
* Create a new Eclipse project with the GNU ARM Eclipse (Choose STM32Fxxx C/C++ Project in the Wizard)&lt;br /&gt;
&lt;br /&gt;
With some minor adjustments in the settings (OpenOCD), the basic Blinky example that comes with the plugin should work out of the box, with a STLink v2 programmer. Code completion etc. works fine too.&lt;br /&gt;
&lt;br /&gt;
(/todo: show every step)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
But there&#039;s quite annoying problem with this workflow!:&lt;br /&gt;
&lt;br /&gt;
http://www.carminenoviello.com/en/2015/06/04/stm32-applications-eclipse-gcc-stcube/:&lt;br /&gt;
&amp;lt;blockquote&amp;gt;&lt;br /&gt;
Unfortunately, the plug-in author has updated just the template for STM32-F4 family to the more recently STM32Cube-F4 HAL framework from ST (which still supports only commercial IDE.....), leaving the other templates still based on the old Standard Peripheral Library, which is no longer supported by ST and STM32CubeMX tool used in my tutorial. This causes my instructions to be wrong for processor families different from STM32-F4. &lt;br /&gt;
&amp;lt;/blockquote&amp;gt;&lt;br /&gt;
&lt;br /&gt;
So, several manual setup steps will be required to get started with your own STM32 project. To goal is to configure the project in STM32CubeMX, and use up-to-date HAL code, and not the deprecated Standard Peripheral Library.&lt;br /&gt;
&lt;br /&gt;
The GNU ARM Eclipse plugin is great, but doesn&#039;t create projects with up-to-date code. So we need to modify the manually created GNU ARM Eclipse project. - I used a custom STM32F072C8 board, and all steps below assum this hardware. The steps would be slightly different for other hardware.&lt;br /&gt;
&lt;br /&gt;
([http://www.carminenoviello.com/en/2015/06/04/stm32-applications-eclipse-gcc-stcube This tutorial] was helping here...)&lt;br /&gt;
&lt;br /&gt;
* First create a new &#039;C Project&#039; in your Eclipse workspace.&lt;br /&gt;
* In Wizard slide &#039;&#039;C Project&#039;&#039;: Choose Executable &amp;gt; &#039;&#039;Hello World ARM Cortex-M C/C++ Project&#039;&#039; and give it a name (e.g. testSTM32_00). This will generate a generic ARM project instead of an STM32Fxxx one. - Then hit &#039;&#039;Next&#039;&#039;.&lt;br /&gt;
* In Wizard slide &#039;&#039;Target processor settings&#039;&#039;: Configure the target processor: For the STM32F072C8: Change the defaults to Flash size (kB): 64, RAM size (kB): 16, Use system calls: Freestanding (no POSIX system calls), Trace output: None (no trace output). - Then hit &#039;&#039;Next&#039;&#039;.&lt;br /&gt;
* In Wizard slide &#039;&#039;Folders&#039;&#039;: Change Vendor CMSIS name to stm32f0xx. - Then hit next.&lt;br /&gt;
* In Wizard slide &#039;&#039;Select Configurations&#039;&#039;: Leave as is. - Then hit &#039;&#039;Next&#039;&#039;.&lt;br /&gt;
* In Wizard slide &#039;&#039;Cross GNU ARM Toolchain&#039;&#039;: Select &#039;&#039;GNU Tools for ARM Embedded Processors (arm-none-eabi-gcc)&#039;&#039; and either choose the global, system wide toolchain (probably in /usr/bin) or enter the path to your custom one. - Then hit &#039;&#039;Finish&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
This will create a generic ARM project, which should build without errors (hit Ctrl+B). &lt;br /&gt;
&lt;br /&gt;
Next, we need to add the vendor specific HAL code by ST generated with STM32CubeMX and/or downloaded in a more specific firmware package (STM32CubeF0, STM32CubeF4 etc.).&lt;br /&gt;
&lt;br /&gt;
...&lt;br /&gt;
So, after configuring a generic Eclipse project, we&#039;re ready to modify it.&lt;br /&gt;
&lt;br /&gt;
* Configure and export an EWARM project in [http://www.st.com/web/en/catalog/tools/PF259242 STM32CubeMX] (with default settings).&lt;br /&gt;
&lt;br /&gt;
* Extract the [http://www.st.com/web/en/catalog/tools/PF260612 STM32CubeF0] archive. ([http://www.st.com/web/en/catalog/tools/PF260820 STM32CubeF1], [http://www.st.com/web/en/catalog/tools/PF260266 STM32CubeF2], [http://www.st.com/web/en/catalog/tools/PF260613 STMCubeF3], [http://www.st.com/web/en/catalog/tools/PF259243 STMCubeF4]).&lt;br /&gt;
&lt;br /&gt;
As a starting point, here&#039;s a bash script, that modifies the previously created Eclipse project:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
#!/usr/bin/env bash&lt;br /&gt;
&lt;br /&gt;
set -e&lt;br /&gt;
&lt;br /&gt;
#echo &amp;quot;Press CTRL+C to proceed.&amp;quot;&lt;br /&gt;
#trap &amp;quot;pkill -f &#039;sleep 1h&#039;&amp;quot; INT&lt;br /&gt;
#trap &amp;quot;set +x ; sleep 1h ; set -x&amp;quot; DEBUG&lt;br /&gt;
&lt;br /&gt;
# MODIFY THIS!&lt;br /&gt;
ECLIPSE_PROJECT=/run/media/rel/prc/code/workspace_testSTM32_01/testSTM32_00&lt;br /&gt;
STM32CUBEF0=/home/rel/src/STM32Cube_FW_F0_V1.4.0&lt;br /&gt;
STM32CUBEMX=/home/rel/Desktop/test_stm32cubemx_ewarm&lt;br /&gt;
&lt;br /&gt;
echo --------------------------------------------------------------------------------&lt;br /&gt;
echo Eclipse Project Initializer for STM32F072 Dev&lt;br /&gt;
echo --------------------------------------------------------------------------------&lt;br /&gt;
&lt;br /&gt;
echo&lt;br /&gt;
echo The script is using the following paths:&lt;br /&gt;
echo&lt;br /&gt;
echo Eclipse Project:&lt;br /&gt;
echo $ECLIPSE_PROJECT&lt;br /&gt;
echo&lt;br /&gt;
echo STM32Cube:&lt;br /&gt;
echo $STM32CUBEF0&lt;br /&gt;
echo&lt;br /&gt;
echo STM32CubeMX:&lt;br /&gt;
echo $STM32CUBEMX&lt;br /&gt;
&lt;br /&gt;
echo&lt;br /&gt;
echo -n &amp;quot;Do you want to proceed? [ENTER]&amp;quot;&lt;br /&gt;
read&lt;br /&gt;
&lt;br /&gt;
echo&lt;br /&gt;
echo Deleting files from eclipse project:&lt;br /&gt;
rm -fv $ECLIPSE_PROJECT/src/main.c&lt;br /&gt;
rm -fv $ECLIPSE_PROJECT/src/Timer.c&lt;br /&gt;
rm -fv $ECLIPSE_PROJECT/include/Timer.h&lt;br /&gt;
&lt;br /&gt;
rm -fv $ECLIPSE_PROJECT/system/include/cmsis/stm32f0xx.h&lt;br /&gt;
rm -fv $ECLIPSE_PROJECT/system/include/cmsis/system_stm32f0xx.h&lt;br /&gt;
&lt;br /&gt;
rm -fv $ECLIPSE_PROJECT/system/src/cmsis/system_stm32f0xx.c&lt;br /&gt;
rm -fv $ECLIPSE_PROJECT/system/src/cmsis/vectors_stm32f0xx.c&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
echo&lt;br /&gt;
echo Copying: ST HAL:&lt;br /&gt;
cp -rfv $STM32CUBEF0/Drivers/STM32F0xx_HAL_Driver/Src/* \&lt;br /&gt;
$ECLIPSE_PROJECT/system/src/stm32f0xx&lt;br /&gt;
&lt;br /&gt;
cp -rfv $STM32CUBEF0/Drivers/STM32F0xx_HAL_Driver/Inc/* \&lt;br /&gt;
$ECLIPSE_PROJECT/system/include/stm32f0xx&lt;br /&gt;
&lt;br /&gt;
cp -rfv $STM32CUBEF0/Drivers/CMSIS/Device/ST/STM32F0xx/Include/* \&lt;br /&gt;
$ECLIPSE_PROJECT/system/include/cmsis&lt;br /&gt;
&lt;br /&gt;
cp -fv $STM32CUBEF0/Drivers/CMSIS/Device/ST/STM32F0xx/Source/Templates/gcc/startup_stm32f072xb.s \&lt;br /&gt;
$ECLIPSE_PROJECT/system/src/cmsis/startup_stm32f072xb.S&lt;br /&gt;
&lt;br /&gt;
cp -fv $STM32CUBEF0/Drivers/CMSIS/Device/ST/STM32F0xx/Source/Templates/system_stm32f0xx.c \&lt;br /&gt;
$ECLIPSE_PROJECT/system/src/cmsis&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
# echo Copying: example project from STM32CubeF0:&lt;br /&gt;
#cp $STM32CUBEF0/Projects/STM32F072B-Discovery/Examples/GPIO/GPIO_IOToggle/Inc/* \&lt;br /&gt;
#$ECLIPSE_PROJECT/include&lt;br /&gt;
&lt;br /&gt;
#cp $STM32CUBEF0/Projects/STM32F072B-Discovery/Examples/GPIO/GPIO_IOToggle/Src/main.c \&lt;br /&gt;
#$ECLIPSE_PROJECT/src&lt;br /&gt;
&lt;br /&gt;
#cp $STM32CUBEF0/Projects/STM32F072B-Discovery/Examples/GPIO/GPIO_IOToggle/Src/stm32f0xx_it.c \&lt;br /&gt;
#$ECLIPSE_PROJECT/src&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
echo&lt;br /&gt;
echo Copying: example project from STM32CubeMX:&lt;br /&gt;
cp $STM32CUBEMX/Src/* $ECLIPSE_PROJECT/src&lt;br /&gt;
cp $STM32CUBEMX/Inc/* $ECLIPSE_PROJECT/include&lt;br /&gt;
&lt;br /&gt;
echo&lt;br /&gt;
echo Modifiying/fixing the memory map:&lt;br /&gt;
echo $ECLIPSE_PROJECT/ldscripts/mem.ld&lt;br /&gt;
sed -i &#039;s/FLASH (rx) : ORIGIN = 0x00000000/FLASH (rx) : ORIGIN = 0x08000000/g&#039; $ECLIPSE_PROJECT/ldscripts/mem.ld&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
echo&lt;br /&gt;
echo SUCCESS&lt;br /&gt;
echo&lt;br /&gt;
&lt;br /&gt;
echo&lt;br /&gt;
echo Now, exclude the following file from the Eclipse project manually:&lt;br /&gt;
ls $ECLIPSE_PROJECT/system/src/stm32f0xx/stm32f0xx_hal_msp_template.c&lt;br /&gt;
&lt;br /&gt;
echo&lt;br /&gt;
echo And add the following preprocessor constants to the C/C++ compiler settings in Eclipse:&lt;br /&gt;
echo USE_HAL_DRIVER&lt;br /&gt;
echo STM32F072xB&lt;br /&gt;
&lt;br /&gt;
echo&lt;br /&gt;
echo &amp;quot;And add the following config options to the GDB OpenOCD Debugging settings (in Run Configurations):&amp;quot;&lt;br /&gt;
echo &amp;quot;-f interface/stlink-v2.cfg -f target/stm32f0x.cfg&amp;quot;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This script needs to be modified according to your needs! (Currently is working for the STM32F072C8, and contains fixed paths! - Note that there minor inconsistencies in some of these ST projects. For example, all the provided STM32F072xB* files by ST work for both types of chips -- STM32F072x8 and STM32F072xB.)&lt;br /&gt;
&lt;br /&gt;
Like described in the script above, some minor manual changes need to be made in Eclipse after running the script.&lt;br /&gt;
&lt;br /&gt;
This should now be a good basis to start a new STM32 project.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Note that the GNU ARM Eclipse plugin always generates a Makefile for every project configuration (Debug / Release). It can be found in &amp;lt;project_folder&amp;gt;/Debug pr &amp;lt;project_folder&amp;gt;/Release respectively.&lt;br /&gt;
&lt;br /&gt;
==== Semihosting ====&lt;br /&gt;
&lt;br /&gt;
http://infocenter.arm.com/help/index.jsp?topic=/com.arm.doc.dui0471c/Bgbjjgij.html:&lt;br /&gt;
&amp;lt;blockquote&amp;gt;&lt;br /&gt;
What is semihosting?&lt;br /&gt;
&lt;br /&gt;
Semihosting is a mechanism that enables code running on an ARM target to communicate and use the Input/Output facilities on a host computer that is running a debugger.&lt;br /&gt;
&lt;br /&gt;
Examples of these facilities include keyboard input, screen output, and disk I/O.&lt;br /&gt;
&amp;lt;/blockquote&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The GNU ARM Eclipse plugin comes with a really bare-bone implementation of some semihosting print functions that can be used to print logs to the console right in Eclipse (over GDB, without using any additional serial/UART connection whatsoever).&lt;br /&gt;
&lt;br /&gt;
Since I&#039;d always create a project without Semihosting enabled in the GNU ARM Eclipse wizard, you can still easily enable it later on:&lt;br /&gt;
&lt;br /&gt;
The easiest way I&#039;ve found so far, is by defining those Preprocessor constants in the C/C++ Project settings (Projects &amp;gt; Properties &amp;gt; C/C++ Build &amp;gt; Settings &amp;gt; Cross ARM GNU C/C++ Compiler &amp;gt; Preprocessor):&lt;br /&gt;
* TRACE&lt;br /&gt;
* OS_USE_TRACE_SEMIHOSTING_STDOUT&lt;br /&gt;
&lt;br /&gt;
And then, by using the following function calls in your code to log stuff to the Eclipse console right away:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
trace_initialize(); // in fact not required&lt;br /&gt;
// (...)&lt;br /&gt;
static int i = 0;&lt;br /&gt;
trace_puts( &amp;quot;hello&amp;quot; );&lt;br /&gt;
trace_printf( &amp;quot;nr %d\n&amp;quot;, i++ );&lt;br /&gt;
HAL_Delay( 1000 );  &lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
These functions were implemented by the author of GNU ARM Eclipse [https://github.com/ilg-ul Liviu Ionescu], and can be looked up in these files:&lt;br /&gt;
* &amp;lt;eclipse_project&amp;gt;/system/include/arm/semihosting.h&lt;br /&gt;
* &amp;lt;eclipse_project&amp;gt;/system/include/diag/Trace.h&lt;br /&gt;
* &amp;lt;eclipse_project&amp;gt;/system/src/diag/Trace.c&lt;br /&gt;
* &amp;lt;eclipse_project&amp;gt;/system/src/diag/trace_impl.c&lt;br /&gt;
&lt;br /&gt;
An interesting comment in &#039;&#039;trace_impl.c:133&#039;&#039; says:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
// Semihosting is the other output channel that can be used for the trace&lt;br /&gt;
// messages. It comes in two flavours: STDOUT and DEBUG. The STDOUT channel&lt;br /&gt;
// is the equivalent of the stdout in POSIX and in most cases it is forwarded&lt;br /&gt;
// to the GDB server stdout stream. The debug channel is a separate&lt;br /&gt;
// channel. STDOUT is buffered, so nothing is displayed until a \n;&lt;br /&gt;
// DEBUG is not buffered, but can be slow.&lt;br /&gt;
//&lt;br /&gt;
// Choosing between semihosting stdout and debug depends on the capabilities&lt;br /&gt;
// of your GDB server, and also on specific needs. It is recommended to test&lt;br /&gt;
// DEBUG first, and if too slow, try STDOUT.&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Note that semihosting needs to be enabled in your Eclipse run configuration (it is by default), in the Startup tab &amp;gt; Enable ARM semihosting. This will tell GDB to use semihosting. Without enabling, calls to those trace_* functions will throw some kind of exception... and make the processor halt. I couldn&#039;t find out much yet about how this feature really works, somehow it uses a special BKPT instruction...&lt;br /&gt;
&lt;br /&gt;
Semihosting (OS_USE_TRACE_SEMIHOSTING_STDOUT) can also be used in &amp;quot;Release&amp;quot; builds, since the semihosted calls don&#039;t rely on debug symbols.&lt;br /&gt;
&lt;br /&gt;
=== IDE: Code::Blocks ===&lt;br /&gt;
&lt;br /&gt;
My favorite cross-platform IDE for C/C++ is Code::Blocks. - And luckily, it also works well for ARM development! After twiddling around with those confusing Eclipse settings, I&#039;ve almost forgot to try out and setup Code::Blocks.&lt;br /&gt;
&lt;br /&gt;
The steps required are bit unintuitive, but building and debugging projects with full auto-complete and indexer support works now.&lt;br /&gt;
&lt;br /&gt;
The advantages over using Eclipse:&lt;br /&gt;
* Faster GUI.&lt;br /&gt;
* Works with STM32CubeMX generated code.&lt;br /&gt;
* Uses just a plain/manually editable Makefile to build the project.&lt;br /&gt;
* Familiar C/C++ settings and more *transparent* project handling -&amp;gt; Edit + debug. Nothing more. Everything can be done by hand on a console too. No mysterious hidden helpers...&lt;br /&gt;
&lt;br /&gt;
I&#039;m still evaluating this workflow... But to get things up and running, you can do this:&lt;br /&gt;
&lt;br /&gt;
(Assuming you already have a working Makefile based project, e.g. [http://wiki.sgmk-ssam.ch/wiki/STM32_dev#STM32CubeMX_to_Makefile created with STM32CubeMX, like described above]).&lt;br /&gt;
&lt;br /&gt;
* Open Code::Blocks and create an &#039;&#039;&#039;empty&#039;&#039;&#039; project (&#039;&#039;File &amp;gt; New &amp;gt; Project &amp;gt; Empty project&#039;&#039;).&lt;br /&gt;
* Give it a name in the Wizard, and choose the &#039;&#039;GNU GCC Compiler for ARM&#039;&#039;, and save it. &lt;br /&gt;
* Copy all content of the Makefile project over to Code::Blocks project folder.&lt;br /&gt;
* Import all required source files into the Code::Blocks workspace (right click -&amp;gt; &#039;&#039;Add files recursively...&#039;&#039;). &lt;br /&gt;
* Check &#039;&#039;Project &amp;gt; Properties &amp;gt; Project settings &amp;gt; Makefile: This is a custom Makefile&#039;&#039;.&lt;br /&gt;
* Adjust the build settings in &#039;&#039;Project &amp;gt; Build options &amp;gt; &amp;quot;Make commands&amp;quot;&#039;&#039;. - This might either require you to change the Makefile (i.e. add Debug/Release targets), or the commands. - For simplicity&#039;s sake, just ignore those $make, $makefile variables and overwrite them with your actual commands (i.e.&#039;&#039;$make -f $makefile $target&#039;&#039; -&amp;gt; &#039;&#039;make all&#039;&#039;).&lt;br /&gt;
* &#039;&#039;Build&#039;&#039; the project and check in the &#039;&#039;Build log&#039;&#039; if there where any errors/warnings.&lt;br /&gt;
&lt;br /&gt;
So, if this is working now, try to edit a source file and see if those really useful auto-complete and jump to declaration/implementation features are working. - One caveat of using an external Makefile is that the IDE doesn&#039;t know the current settings. So, for example, #defines are not available, and syntax highlighting will not update automatically... So it might be worth it add settings manually at some point.&lt;br /&gt;
&lt;br /&gt;
Now, to get the flashing and debugging working, try this:&lt;br /&gt;
&lt;br /&gt;
* Go to the &#039;&#039;Settings &amp;gt; Debugger&#039;&#039; Settings.&lt;br /&gt;
* Add a new GDB debugger setting (hit &#039;&#039;Create Config&#039;&#039; and call it &#039;&#039;ARM OpenOCD&#039;&#039; for example).&lt;br /&gt;
* Change the &#039;&#039;Executable path&#039;&#039; according to your toolchains location, and check &#039;Do *not* run the debugee&#039;.&lt;br /&gt;
* Go to &#039;&#039;Projects &amp;gt; Properties &amp;gt; Debugger&#039;&#039;.&lt;br /&gt;
** Change the &amp;lt;Project&amp;gt; &#039;&#039;Remote connection&#039;&#039; settings to IP: 127.0.0.1 / Port: 3333.&lt;br /&gt;
** Go to the &amp;lt;Project&amp;gt; &#039;&#039;Additional GDB commands&#039;&#039; tab. And enter those commands into the &#039;&#039;After connection&#039;&#039; box (change filename!):&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
monitor halt&lt;br /&gt;
load ./build/test.elf&lt;br /&gt;
file ./build/test.elf&lt;br /&gt;
monitor sleep 1000&lt;br /&gt;
monitor reset&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
To not run the program automatically, remove the last two commands. Then you need to &#039;&#039;Start / Continue&#039;&#039; the program twice, but you&#039;ll catch the first breakpoint you&#039;ve set!&lt;br /&gt;
* Choose &#039;&#039;Debug &amp;gt; Active Debuggers &amp;gt; GDB/CDB Debugger: ARM OpenOCD&#039;&#039;.&lt;br /&gt;
* Start OpenOCD in a terminal. (Described above).&lt;br /&gt;
* Start debugging by pressing the red arrow (Run / continue) in the debugging toolbar.&lt;br /&gt;
&lt;br /&gt;
The steps are the same as the ones in [http://www.hackvandedam.nl/blog/?p=707 this tutorial &#039;&#039;&#039;with screenshots&#039;&#039;&#039;].&lt;br /&gt;
&lt;br /&gt;
=== stlink ===&lt;br /&gt;
&lt;br /&gt;
[https://github.com/texane/stlink stlink] is a command line tool for programming, inspecting and debugging the STM32 microcontrollers. It also used internally by OpenOCD (I think). - It comes with several small programs (st-flash, st-info, st-term, st-util) that can come in handy while working with the STM32 micros.&lt;br /&gt;
&lt;br /&gt;
There&#039;s a tutorial:&lt;br /&gt;
https://github.com/texane/stlink/blob/master/doc/tutorial/tutorial.pdf&lt;br /&gt;
&lt;br /&gt;
Some useful things I&#039;ve discovered:&lt;br /&gt;
&lt;br /&gt;
Just run st-util can Ctrl-C again to see all relevant uC properties:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
$ st-util&lt;br /&gt;
2016-01-29T13:06:25 INFO src/stlink-common.c: Loading device parameters....&lt;br /&gt;
2016-01-29T13:06:25 INFO src/stlink-common.c: Device connected is: F07x device, id 0x20016448&lt;br /&gt;
2016-01-29T13:06:25 INFO src/stlink-common.c: SRAM size: 0x4000 bytes (16 KiB), Flash: 0x10000 bytes (64 KiB) in pages of 2048 bytes&lt;br /&gt;
2016-01-29T13:06:25 INFO gdbserver/gdb-server.c: Chip ID is 00000448, Core ID is  0bb11477.&lt;br /&gt;
2016-01-29T13:06:25 INFO gdbserver/gdb-server.c: Target voltage is 3554 mV.&lt;br /&gt;
2016-01-29T13:06:25 INFO gdbserver/gdb-server.c: Listening at *:4242...&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Or with st-info:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
$ st-info &lt;br /&gt;
st-info --flash&lt;br /&gt;
st-info --sram&lt;br /&gt;
st-info --descr&lt;br /&gt;
st-info --pagesize&lt;br /&gt;
st-info --chipid&lt;br /&gt;
$ st-info --flash&lt;br /&gt;
0x10000&lt;br /&gt;
$ st-info --sram&lt;br /&gt;
0x4000&lt;br /&gt;
$ st-info --descr&lt;br /&gt;
F07x device&lt;br /&gt;
$ st-info --pagesize&lt;br /&gt;
0x800&lt;br /&gt;
$ st-info --chipid&lt;br /&gt;
0x0448&lt;br /&gt;
&lt;br /&gt;
$ echo `st-info --sram | xargs -I@ printf &amp;quot;%d/1024\n&amp;quot; @ | bc`kB RAM&lt;br /&gt;
16kB RAM&lt;br /&gt;
$ echo `st-info --flash | xargs -I@ printf &amp;quot;%d/1024\n&amp;quot; @ | bc`kB FLASH&lt;br /&gt;
64kB FLASH&lt;br /&gt;
&lt;br /&gt;
$ for a in sram flash pagesize; do echo `st-info --$a | xargs -I@ printf &amp;quot;%d/1024\n&amp;quot; @ | bc`kb $a; done&lt;br /&gt;
16kb sram&lt;br /&gt;
64kb flash&lt;br /&gt;
2kb pagesize&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Or simply:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
$ st-info --probe&lt;br /&gt;
Found 1 stlink programmers&lt;br /&gt;
 serial: 303030303030303030303031&lt;br /&gt;
openocd: &amp;quot;\x30\x30\x30\x30\x30\x30\x30\x30\x30\x30\x30\x31&amp;quot;&lt;br /&gt;
  flash: 131072 (pagesize: 256)&lt;br /&gt;
   sram: 16384&lt;br /&gt;
 chipid: 0x0416&lt;br /&gt;
  descr: L1 Med-density device&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Links ===&lt;br /&gt;
&lt;br /&gt;
==== Tools ====&lt;br /&gt;
* [https://gnuarmeclipse.github.io/ GNU ARM Eclipse]: [https://gnuarmeclipse.github.io/eclipse/workspace/preferences/ workspace_preferences], [http://gnuarmeclipse.github.io/toolchain/path/ toolchain_path], [http://gnuarmeclipse.github.io/eclipse/project/portability/ project_portability]&lt;br /&gt;
&lt;br /&gt;
==== Tutorials ====&lt;br /&gt;
* Great introduction: [http://www.triplespark.net/elec/pdev/arm/stm32.html Programming STM32 F2, F4 ARMs under Linux: A Tutorial from Scratch]&lt;br /&gt;
* STM32Cube to GNU ARM Eclipse tips: http://www.carminenoviello.com/en/2015/06/04/stm32-applications-eclipse-gcc-stcube/&lt;br /&gt;
* Micro Python on STM32F4-Discovery: http://gpio.kaltpost.de/?p=2082&lt;br /&gt;
* Logs: https://hackaday.io/project/4277/logs?page=2&lt;br /&gt;
* Code::Blocks tutorial: http://www.hackvandedam.nl/blog/?p=707&lt;br /&gt;
* Eclipse tutorial: http://www.carminenoviello.com/en/2015/06/04/stm32-applications-eclipse-gcc-stcube&lt;br /&gt;
* http://sigalrm.blogspot.ch/2013/12/using-ccm-memory-on-stm32.html&lt;br /&gt;
* http://stm32f4-discovery.com/2014/08/stm32f4-external-interrupts-tutorial/&lt;br /&gt;
* ...&lt;br /&gt;
&lt;br /&gt;
==== Projects / Demos / Code ====&lt;br /&gt;
* MrBlueXav&#039;s Synths: https://github.com/MrBlueXav&lt;br /&gt;
* cliffle&#039;s VGA stuff: https://github.com/cbiffle/m4vgalib-demos, http://cliffle.com/article/2015/06/05/introducing-glitch/&lt;br /&gt;
* ESPruino code: https://github.com/espruino/Espruino -&amp;gt; STM32F401CDU6&lt;br /&gt;
* STM32F4 Audio Codec Board: http://ebrombaugh.studionebula.com/synth/stm32f4_codec/&lt;br /&gt;
* ESPRUINO: http://www.espruino.com/ReferenceSTM32F4DISCOVERY&lt;br /&gt;
* micropython: https://github.com/micropython/micropython&lt;br /&gt;
* STM32F4 DIY: http://mikrocontroller.bplaced.net/wordpress/?page_id=1482&lt;br /&gt;
* STM32F4 overclocking: http://sigalrm.blogspot.ch/2014/01/overclocking-stm32f4.html&lt;br /&gt;
* thermal camera: http://www.theresistornetwork.com/2014/11/flir-lepton-thermal-imaging-sensor.html&lt;br /&gt;
* STM32F7: http://hackaday.com/2015/06/26/new-part-day-stm32f7-an-arm-cortex-m7/&lt;br /&gt;
* Karsten Schmidt: http://workshop.thi.ng/ [https://soundcloud.com/forthcharlie soundcloud] https://github.com/thi-ng/ws-ldn-4 https://github.com/thi-ng/ws-ldn-3 http://asm.thi.ng/&lt;br /&gt;
* Peridrummmm Demo: http://www.pouet.net/prod.php?which=59095 with sources: http://aka-san.halcy.de/revision2012/peridiummmm-src.zip&lt;br /&gt;
* Andy&#039;s Workshop: http://andybrown.me.uk/&lt;br /&gt;
* axoloti: http://axoloti.com/&lt;br /&gt;
&lt;br /&gt;
==== Libraries ====&lt;br /&gt;
* libopencm3 http://libopencm3.org/wiki/Main_Page&lt;br /&gt;
* list of libs: http://mikrocontroller.bplaced.net/wordpress/?page_id=2736&lt;br /&gt;
&lt;br /&gt;
==== OS ====&lt;br /&gt;
* FreeRTOS: http://www.freertos.org/index.html&lt;br /&gt;
* Embedded Linux on STM32: https://github.com/EmcraftSystems&lt;br /&gt;
* ChibiOS: http://www.chibios.org/dokuwiki/&lt;br /&gt;
* Zephyr Project: http://zephyrproject.org/&lt;br /&gt;
&lt;br /&gt;
==== General ====&lt;br /&gt;
* ARM Related Books: http://www.arm.com/support/resources/arm-books/&lt;br /&gt;
* STM32 Overview http://www.st.com/web/en/catalog/mmc/FM141/SC1169?sc=stm32&lt;br /&gt;
* mbed https://en.wikipedia.org/wiki/Mbed&lt;br /&gt;
* CMSIS: http://www.keil.com/pack/doc/cmsis/Core/html/index.html&lt;br /&gt;
&lt;br /&gt;
== Hardware ==&lt;br /&gt;
&lt;br /&gt;
All about hardware and hardware tools for STM32 dev. Chips, programmers etc.&lt;br /&gt;
&lt;br /&gt;
=== ST-Link V2 Programmer ===&lt;br /&gt;
&lt;br /&gt;
There are two popular ST-Link V2 Progammers on the market. They have a different pinout but work both well like described above.&lt;br /&gt;
&lt;br /&gt;
[[File:ST-LinkV2_pinout_01.jpg]]&lt;br /&gt;
&lt;br /&gt;
Alternatively, STM32Discovery/[http://jeelabs.org/book/1547a/index.html Nucleo boards too can be used as SWD programmers].&lt;br /&gt;
&lt;br /&gt;
Luckily, only 4 pins have to be used to program and debug the target!&lt;br /&gt;
To find out more about this protocol, have a look into [http://www.arm.com/products/system-ip/debug-trace/coresight-soc-components/serial-wire-debug.php Serial Debug Wire (SWD)] as an alternative to JTAG.&lt;br /&gt;
&lt;br /&gt;
Connect to following pins of the programmer to the corresponding pins on the PCB:&lt;br /&gt;
&lt;br /&gt;
* V3V&lt;br /&gt;
* GND&lt;br /&gt;
* SWCLK&lt;br /&gt;
* SWDIO&lt;br /&gt;
&lt;br /&gt;
-&amp;gt; NRST can be important too on some STM32 chips!&lt;br /&gt;
&lt;br /&gt;
Remember: These are &#039;&#039;&#039;not&#039;&#039;&#039; the [http://www.st.com/web/catalog/tools/FM146/CL1984/SC724/SS1677/PF251168 official ST-Link V2 Programmers], sold by ST.&lt;br /&gt;
&lt;br /&gt;
== Projects ==&lt;br /&gt;
&lt;br /&gt;
STM32 based projects.&lt;br /&gt;
&lt;br /&gt;
=== STM32basic ===&lt;br /&gt;
&lt;br /&gt;
STM32basic is a test board to see how STM32 chips can be used in DIY circuits.&lt;br /&gt;
&lt;br /&gt;
==== STM32basic rev0.01 ====&lt;br /&gt;
&lt;br /&gt;
An initial list of tests:&lt;br /&gt;
&lt;br /&gt;
* JTAG: See how we can program the thing. Do we need all JTAG pins? Or only the SWD pins? What about reset? - Do the cheapo Chinese STLink V2 programmer really work?&lt;br /&gt;
* Basic I/O: LED and push button.&lt;br /&gt;
* U(S)ART: Check whether it&#039;s possible to hook up an FTDI to send/receive characters to/from the STM32basic?&lt;br /&gt;
* BOOT0/1: What about those boot modes?&lt;br /&gt;
* Power Usage : 3V3 Regulator: ..&lt;br /&gt;
&lt;br /&gt;
[[File:STM32basic_pcb1b.jpg]]&lt;br /&gt;
&lt;br /&gt;
Board at OSH Park:&amp;lt;br /&amp;gt;&lt;br /&gt;
https://oshpark.com/shared_projects/kCD7Yr0A&lt;br /&gt;
&lt;br /&gt;
[[File:Stm32basic1.jpg]]&lt;br /&gt;
&lt;br /&gt;
So far, the tests have been working ok.&lt;br /&gt;
&lt;br /&gt;
* STLink V2 programmers seem to work fine, and only require 2 pins + VCC/GND! SWDIO and SWCLK, that&#039;s it! For programming and on-chip debugging.&lt;br /&gt;
* I/O works as well. External interrupts can be configured.&lt;br /&gt;
* UART works, but I have not yet tested it with a proper code. It was working with some echo snippet I&#039;ve found somewhere.&lt;br /&gt;
* Power usage is low. ~15 mA at 3.3 V.&lt;br /&gt;
* BOOT0 jumper has to be set (connected to ground) in order to run code... - Other boot modes have not been tested yet. More tests are needed there... What are the other available boot modes, what about those built-in boot loaders?&lt;br /&gt;
&lt;br /&gt;
However, the board has several flaws:&lt;br /&gt;
* 1.27 mm pin-pitch headers cannot be arranged like that (GPIOs). They need to be further apart to make sockets/headers fit.&lt;br /&gt;
* 3V3 LDO doesn&#039;t make much sense like this. Add add a buck/boost converter. Also remove 5V label.&lt;br /&gt;
* This BOOT0 jumper isn&#039;t nice like this...&lt;br /&gt;
* Remove unnecessary JTAG pins. SWD only.&lt;br /&gt;
* Remove unnecessary USART pins.&lt;br /&gt;
* Add crystal.&lt;br /&gt;
* Add USB plug.&lt;br /&gt;
&lt;br /&gt;
Probably, this will not be remade, since it was enough for a test. I&#039;d like to make a very basic USB touch device next.&lt;br /&gt;
&lt;br /&gt;
=== todo ===&lt;br /&gt;
&lt;br /&gt;
* I2C peripherals&lt;br /&gt;
* I2S peripherals&lt;br /&gt;
* SPI peripherals&lt;br /&gt;
* touch&lt;br /&gt;
* usb&lt;br /&gt;
* external memory (sram, flash, eeprom...) -&amp;gt; RTOS / Linux / ChibiOS? (similar to this http://hforsten.com/making-embedded-linux-computer.html)?&lt;br /&gt;
.....&lt;/div&gt;</summary>
		<author><name>0rel</name></author>
	</entry>
	<entry>
		<id>https://wiki.sgmk-ssam.ch/index.php?title=User:0rel&amp;diff=9503</id>
		<title>User:0rel</title>
		<link rel="alternate" type="text/html" href="https://wiki.sgmk-ssam.ch/index.php?title=User:0rel&amp;diff=9503"/>
		<updated>2021-04-14T18:00:56Z</updated>

		<summary type="html">&lt;p&gt;0rel: Blanked the page&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>0rel</name></author>
	</entry>
	<entry>
		<id>https://wiki.sgmk-ssam.ch/index.php?title=Cappaddy&amp;diff=9502</id>
		<title>Cappaddy</title>
		<link rel="alternate" type="text/html" href="https://wiki.sgmk-ssam.ch/index.php?title=Cappaddy&amp;diff=9502"/>
		<updated>2021-04-14T18:00:28Z</updated>

		<summary type="html">&lt;p&gt;0rel: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= Overview =&lt;br /&gt;
&lt;br /&gt;
cappaddy is a portable audio sample player with capacitive touch controls.&lt;br /&gt;
&lt;br /&gt;
A work-in-progress prototype to try out different things with capacitive touch interfaces and learn more about ARM dev, STM32&#039;s peripherals (SPI, TIMER, DAC, DMA, TSC...) and some nice new parts like SPI flash, a new mono audio amp and a 3.3V voltage regulator/boost-converter, ideal for normal AAA cells.&lt;br /&gt;
&lt;br /&gt;
[[File:cappaddy_rev0.03_caseV4_DSCN1111.jpg]]&lt;br /&gt;
&lt;br /&gt;
= Hardware (Electronics) =&lt;br /&gt;
&lt;br /&gt;
== General Notes ==&lt;br /&gt;
&lt;br /&gt;
Key parts:&lt;br /&gt;
&lt;br /&gt;
* Microcontroller: [http://www.st.com/web/catalog/mmc/FM141/SC1169/SS1574/LN1823/PF259609?s_searchtype=partnumber STM32F072C8]&lt;br /&gt;
* SPI Flash: [http://www.micron.com/~/media/Documents/Products/Data%20Sheet/NOR%20Flash/Serial%20NOR/N25Q/n25q_128mb_3v_65nm.pdf Micron Serial NOR Flash Memory 128Mb - N25Q128A13EF740E-ND]&lt;br /&gt;
* Amp: [http://www.ti.com/product/tpa2006d1 TI TPA2006D1 1.45-W MONO Filter-free Class-D Audio Power Amplifier with 1.8-V]&lt;br /&gt;
* Voltage Converter: [http://ams.com/eng/Products/Power-Management/DC-DC-Buck-Boost-Converters/AS1337 AS1337 Buck-Boost 200mA DC-DC step-up converter with buck mode]&lt;br /&gt;
&lt;br /&gt;
== Revision 0.03 ==&lt;br /&gt;
&lt;br /&gt;
=== Features ===&lt;br /&gt;
&lt;br /&gt;
* 13 touch channels (15 when UART is not used)&lt;br /&gt;
* Small 8 Ohm Speaker&lt;br /&gt;
* 16 MB SPI Flash&lt;br /&gt;
* Powered by 2x AAA batteries&lt;br /&gt;
* Debug LED&lt;br /&gt;
* 5 GPIOs&lt;br /&gt;
* SWD Connector&lt;br /&gt;
* UART Connector&lt;br /&gt;
* Optional I2C connector&lt;br /&gt;
* Optional USB connector&lt;br /&gt;
&lt;br /&gt;
=== Circuit ===&lt;br /&gt;
&lt;br /&gt;
[[File:cappaddy_rev0.03_schematics_2016-04-24.png]]&lt;br /&gt;
&lt;br /&gt;
=== BOM ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Reference			Value			Digikey			Count	Unit		SUM&lt;br /&gt;
&lt;br /&gt;
cappaddy:U1			STM32F072x8		STM32F072C8T6-ND	1	2.00 EUR	2.00 EUR (estimated)&lt;br /&gt;
&lt;br /&gt;
cappaddy:U2			N25Q128A13ESE40E	557-1562-ND		1	1.56 EUR	1.56 EUR&lt;br /&gt;
&lt;br /&gt;
cappaddy:U3			TPA2006D1		296-20783-1-ND 		1	0.97 EUR	0.97 EUR&lt;br /&gt;
&lt;br /&gt;
cappaddy:U4			AS1337			AS1337A-BTDTCT-ND	1	1.46 EUR	1.46 EUR&lt;br /&gt;
								&lt;br /&gt;
cappaddy:C13 C14 C17		1u			490-6423-1-ND 		3	0.09 EUR	0.27 EUR&lt;br /&gt;
cappaddy:C18			100pf			490-8180-1-ND 		1	0.09 EUR	0.09 EUR&lt;br /&gt;
cappaddy:C19			4u7			490-6407-1-ND		1	0.12 EUR	0.12 EUR&lt;br /&gt;
							490-12606-1-ND		0	0.13 EUR	0.00 EUR&lt;br /&gt;
cappaddy:C3-C6 C15 C16		100n			490-10777-1-ND		6	0.09 EUR	0.54 EUR&lt;br /&gt;
cappaddy:C7-C12			1n			490-6349-1-ND		6	0.09 EUR	0.54 EUR&lt;br /&gt;
								&lt;br /&gt;
cappaddy:R1-R3 R20 R27 R28	10k			CR0402-FX-1002GLFCT-ND 	6	0.09 EUR	0.54 EUR&lt;br /&gt;
cappaddy:R4			470R			CR0402-FX-4700GLFCT-ND 	1	0.09 EUR	0.09 EUR&lt;br /&gt;
cappaddy:R5-R19			1k			CR0402-FX-1001GLFCT-ND	15	0.08 EUR	1.22 EUR&lt;br /&gt;
cappaddy:R21-R23		100R			CR0402-FX-1000GLFCT-ND	3	0.09 EUR	0.27 EUR&lt;br /&gt;
cappaddy:R24			560k			1276-4267-1-ND		1	0.09 EUR	0.09 EUR&lt;br /&gt;
cappaddy:R25			330k			1276-4244-1-ND		1	0.09 EUR	0.09 EUR&lt;br /&gt;
cappaddy:R26			1M			CR0402-FX-1004GLFCT-ND	1	0.09 EUR	0.09 EUR&lt;br /&gt;
								&lt;br /&gt;
cappaddy:L1			4u7			490-6642-1-ND		1	0.39 EUR	0.39 EUR&lt;br /&gt;
								&lt;br /&gt;
cappaddy:D1			LED			511-1651-1-ND		1	0.41 EUR	0.41 EUR&lt;br /&gt;
cappaddy:battery_case		BC2AAAL-ND		battery_case		1	0.92 EUR	0.92 EUR&lt;br /&gt;
&lt;br /&gt;
							speaker			1	1.50 EUR	1.50 EUR (estimated)&lt;br /&gt;
&lt;br /&gt;
													13.16 EUR&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Note: The prices of the microcontroller and the speaker were estimated, those parts were ordered on Aliexpress (Speaker: Asus Padfone 2 A68 replacement).&lt;br /&gt;
&lt;br /&gt;
Digikey BOM (MCU and speaker not included):&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
1,557-1562-ND,cappaddy:U2&lt;br /&gt;
1,296-20783-1-ND ,cappaddy:U3&lt;br /&gt;
1,AS1337A-BTDTCT-ND,cappaddy:U4&lt;br /&gt;
3,490-6423-1-ND ,cappaddy:C13 C14 C17&lt;br /&gt;
1,490-8180-1-ND ,cappaddy:C18&lt;br /&gt;
1,490-6407-1-ND,cappaddy:C19&lt;br /&gt;
6,490-10777-1-ND,cappaddy:C3-C6 C15 C16&lt;br /&gt;
6,490-6349-1-ND,cappaddy:C7-C12&lt;br /&gt;
6,CR0402-FX-1002GLFCT-ND ,cappaddy:R1-R3 R20 R27 R28&lt;br /&gt;
1,CR0402-FX-4700GLFCT-ND ,cappaddy:R4&lt;br /&gt;
15,CR0402-FX-1001GLFCT-ND,cappaddy:R5-R19&lt;br /&gt;
3,CR0402-FX-1000GLFCT-ND,cappaddy:R21-R23&lt;br /&gt;
1,1276-4267-1-ND,cappaddy:R24&lt;br /&gt;
1,1276-4244-1-ND,cappaddy:R25&lt;br /&gt;
1,CR0402-FX-1004GLFCT-ND,cappaddy:R26&lt;br /&gt;
1,490-6642-1-ND,cappaddy:L1&lt;br /&gt;
1,511-1651-1-ND,cappaddy:D1&lt;br /&gt;
1,BC2AAAL-ND,cappaddy:battery_case&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
To estimate the total price the PCB cost, casing, the touch pad material, optional power switch, 2 batteries, cables etc. need to be added (~20 Euros in total?).&lt;br /&gt;
&lt;br /&gt;
The price as well as the amount of assembly work could be lowered A LOT by placing everything on one two-sided PCB. The touch pads, the tiny speaker (with a small tube on it?), the (coin cell) battery (enough capacity?). That would save one a lot of trouble with assembling the thing. A simple case to cover the sensitive parts can still be made. Another benefit of placing the touch pads on the PCB and cover it with solder mask is reliability I guess. Using custom pads with cables gives quite inconsistent results.&lt;br /&gt;
&lt;br /&gt;
=== PCB ===&lt;br /&gt;
&lt;br /&gt;
Get it at: [https://oshpark.com/shared_projects/4FL60Jdl OSH Park]&lt;br /&gt;
&lt;br /&gt;
[[File:cappaddy_0.03m_render_00c.png]]&lt;br /&gt;
&lt;br /&gt;
[[File:cappaddy_rev0.03m_oshpark_00b.jpg]]&lt;br /&gt;
&lt;br /&gt;
[[File:cappaddy_rev0.03_pcb_soldered.jpg]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Errata / Known Bugs ===&lt;br /&gt;
&lt;br /&gt;
* flash footprint wrong! -&amp;gt; can still be soldered by bending legs. -&amp;gt; or order the right QFN part next time...&lt;br /&gt;
* R23: audio amp ~SD pin: 100R -&amp;gt; 100K&lt;br /&gt;
&lt;br /&gt;
* audio amp: input caps -&amp;gt; 3.3 nF&lt;br /&gt;
* audio amp: decoupling cap -&amp;gt; 1uF&lt;br /&gt;
* audio amp: input resistor -&amp;gt; 1MOhm (- 100k) -&amp;gt; 200k is not bad!&lt;br /&gt;
&lt;br /&gt;
* spi / flash: pullup on chip select line and pull down on clock like in datasheet? (100kOhm)&lt;br /&gt;
&lt;br /&gt;
* uart connector further apart from swd connector&lt;br /&gt;
* uart connector wider: for pin headers, not cables&lt;br /&gt;
* consider pin placement inside case! - where do the physical cables connecto to what? easy assembling!!!&lt;br /&gt;
&lt;br /&gt;
* proper mounting holes&lt;br /&gt;
&lt;br /&gt;
= Hardware (Enclosure) =&lt;br /&gt;
&lt;br /&gt;
The case here just serves as a enclosure for the prototype. It is not really playable with touch pads like that.&lt;br /&gt;
&lt;br /&gt;
[https://cad.onshape.com/documents/71d91d006a1dab285cabf8eb OnShape project]&lt;br /&gt;
&lt;br /&gt;
[[File:cappaddy_rev0.03_caseV4_DSCN1043_600.jpg]]&lt;br /&gt;
&lt;br /&gt;
= Software =&lt;br /&gt;
&lt;br /&gt;
Currently used/evaluated tools and sources to get the board up and running:&lt;br /&gt;
&lt;br /&gt;
* Free tools for ARM development (gcc-none-eabi toolchain, OpenOCD)&lt;br /&gt;
* STM32CubeMX and sample code by ST&lt;br /&gt;
* Code::Blocks as an IDE&lt;br /&gt;
* Python with PySerial and matplotlib for scripting&lt;br /&gt;
* SoX&lt;br /&gt;
&lt;br /&gt;
More notes are collected [[STM32_dev|here]]...&lt;br /&gt;
&lt;br /&gt;
== Firmware ==&lt;br /&gt;
&lt;br /&gt;
In the current test, every touch pad (13 in total) plays a sample stored in SPI flash. Reads it out, writes it to one of the two DMA buffers in RAM, and then the hardware moves the data (currently 8-bit samples at roughly 22 kHz -&amp;gt; trial and error tuning of TIM6) via DMA (double buffered) to the DAC and converts it there to an analog voltage.&lt;br /&gt;
&lt;br /&gt;
(The code is a mess and has to be cleaned up. - I somehow like to go back to messy C coding, after spending lots of time with high level object oriented stuff, spending way too much time with plumbing and syntax cosmetics, making sure things are reusable and work everywhere. - Firmware can be messy I guess. Nobody cares when it works on the actual device. And there&#039;s only that specific hardware after all, so things will behave very deterministically. - However, that attitude will only work when things are tested out. It should be cleaned up, because I&#039;m sure things will be tricky when I come back that project later... - Also, it makes sense to split things into files, use proper formatting, naming etc. Put things into functions... I&#039;ve already hit the RAM limit of that tiny device by just putting in too many arrays into the spaghetti mess, causing the stack to overflow.. --- SO beware: this is only a proof of concept test, nothing more.&lt;br /&gt;
&lt;br /&gt;
A word on STM docs and tools. Overall this STM32Cube tool is really useful generating the necessary initialization code and drivers (HAL) to work with. On the downside of that, I couldn&#039;t find any proper documentation on all the HAL functions, beside the comments in the source files and all the scattered ST example projects. That makes things quite annoying to work with. I actually really prefer to use those HAL functions instead of twiddling bits in all the registers myself. However, without proper documentation things feel more like a puzzle game in a cryptic world without a map.&lt;br /&gt;
)&lt;br /&gt;
&lt;br /&gt;
[[File:Cappaddy_rev0.03_caseV4_DSCN1096.jpg]]&lt;br /&gt;
&lt;br /&gt;
== Tool: Serial Monitor ==&lt;br /&gt;
&lt;br /&gt;
After using alway Processing to display serial data, I&#039;ve discovered a nice python library to draw all kinds of plots and visualize data, called [http://matplotlib.org/ matplotlib]. It proved to be useful to display very basic serial debug data in realtime, like the 13 TSC channel values here:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
$ plot_serial.py&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:cappaddy_rev0.03_matplotlib_00a.jpg]]&lt;br /&gt;
&lt;br /&gt;
== Tool: Flash Downloader ==&lt;br /&gt;
&lt;br /&gt;
In order to get data (audio samples) into the SPI flash on the board, the microcontroller has to play the middleman between the host PC and the flash. Things would be much easier with a standard SD card, but it was a fun exercise to get this working... The idea was, to make the microcontroller receive the data over UART, and send it down to the flash over SPI.&lt;br /&gt;
&lt;br /&gt;
Again, Python is also a nice helper here to send out the sample data and talk to the hardware, using [https://pyserial.readthedocs.org/en/latest/ PySerial].&lt;br /&gt;
&lt;br /&gt;
First, the samples have to be converted to raw 8-bit mono 22&#039;050 Hz using [http://sox.sourceforge.net/ SoX] (later 12-bit samples should be used...), [[Cappaddy#Tool:_Sample_Converter|see below]]. Then the Python script takes the raw samples, and transmits the bytes in chunks of a certain size to the microcontroller, that is in flash programming mode. To keep the process error free, a CRC check on the received data and a verification of all written data to the flash is made. - First all that took quite a bit of time, and writing the full 16 MB of flash would have taken hours... But switching to the right flash programming commands (write flash pages (of 256 bytes) instead of single bytes for example), raising the serial baud rate to max 115200 and some other refinements took the programming time of a couple of kilobytes down to a reasonable point of a couple of seconds/minutes. - NOR flash memory has to be erased before it can be written (subsectors of 4K), and it is generally much slower to write to it, than to read from it. Since this has to be done only once to get the samples into the device it isn&#039;t really a problem. Reading from the flash afterwards goes surprisingly fast and is easier to do, as I had to find out...&lt;br /&gt;
&lt;br /&gt;
All wav header data is stripped off the files before sending them out. Filename/identifier (8 characters), some info on the sample data (sample rate/depth) and most importantly the flash offset address is written to the first sector of the flash in table, in order to find the data later for playing it back...&lt;br /&gt;
&lt;br /&gt;
(...)&lt;br /&gt;
&lt;br /&gt;
The script can be started in the folder where the raw sample files reside while the board is listening in flash programming mode like that:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
$ ./py_serial_send_wav.py -d /dev/ttyUSB0&lt;br /&gt;
&lt;br /&gt;
serial 2 spi flash programmer started...&lt;br /&gt;
in&amp;lt; CMD_numbytes_chunk?:256&lt;br /&gt;
chunk size set to 256&lt;br /&gt;
in&amp;lt; CMD_nextfile?&lt;br /&gt;
------------------------------------------------------------&lt;br /&gt;
current file (0): cartoon_0101.mp3_8bit_22050Hz_mono.raw&lt;br /&gt;
out&amp;gt; OK&lt;br /&gt;
in&amp;lt; ok&lt;br /&gt;
in&amp;lt; CMD_filename?&lt;br /&gt;
out&amp;gt; crtn0101&lt;br /&gt;
in&amp;lt; received filename: crtn0101&lt;br /&gt;
in&amp;lt; CMD_numbytes_total?&lt;br /&gt;
out&amp;gt; 0069C0 &lt;br /&gt;
in&amp;lt; number of bytes in file total: 0x0069C0&lt;br /&gt;
in&amp;lt; deleting flash subsector at 0x10000&lt;br /&gt;
in&amp;lt; flash subsector 1/7 deleted&lt;br /&gt;
in&amp;lt; deleting flash subsector at 0x11000&lt;br /&gt;
in&amp;lt; flash subsector 2/7 deleted&lt;br /&gt;
in&amp;lt; deleting flash subsector at 0x12000&lt;br /&gt;
in&amp;lt; flash subsector 3/7 deleted&lt;br /&gt;
in&amp;lt; deleting flash subsector at 0x13000&lt;br /&gt;
in&amp;lt; flash subsector 4/7 deleted&lt;br /&gt;
in&amp;lt; deleting flash subsector at 0x14000&lt;br /&gt;
in&amp;lt; flash subsector 5/7 deleted&lt;br /&gt;
in&amp;lt; deleting flash subsector at 0x15000&lt;br /&gt;
in&amp;lt; flash subsector 6/7 deleted&lt;br /&gt;
in&amp;lt; deleting flash subsector at 0x16000&lt;br /&gt;
in&amp;lt; flash subsector 7/7 deleted&lt;br /&gt;
in&amp;lt; CMD_bytespls?:256&lt;br /&gt;
[                                        ]&lt;br /&gt;
in&amp;lt; CMD_crc?&lt;br /&gt;
out_byte&amp;gt; 0xEC &lt;br /&gt;
in&amp;lt; CRC OK!&lt;br /&gt;
in&amp;lt; writing 256 bytes to flash at 0x10000&lt;br /&gt;
in&amp;lt; CMD_bytespls?:256&lt;br /&gt;
[                                        ]&lt;br /&gt;
in&amp;lt; CMD_crc?&lt;br /&gt;
out_byte&amp;gt; 0xA8 &lt;br /&gt;
in&amp;lt; CRC OK!&lt;br /&gt;
in&amp;lt; writing 256 bytes to flash at 0x10100&lt;br /&gt;
in&amp;lt; CMD_bytespls?:256&lt;br /&gt;
[.                                       ]&lt;br /&gt;
(...)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
in&amp;lt; CMD_crc?&lt;br /&gt;
out_byte&amp;gt; 0x89 &lt;br /&gt;
in&amp;lt; CRC OK!&lt;br /&gt;
in&amp;lt; writing 64 bytes to flash at 0x65900&lt;br /&gt;
in&amp;lt; CMD_complete?&lt;br /&gt;
out&amp;gt; OK&lt;br /&gt;
in&amp;lt; transfer complete&lt;br /&gt;
in&amp;lt; CMD_nextfile?&lt;br /&gt;
------------------------------------------------------------&lt;br /&gt;
out&amp;gt; NO&lt;br /&gt;
in&amp;lt; finish&lt;br /&gt;
in&amp;lt; found flash snd entries: 13&lt;br /&gt;
in&amp;lt; sound entry: 0&lt;br /&gt;
in&amp;lt; ----------------&lt;br /&gt;
in&amp;lt; index: 0&lt;br /&gt;
in&amp;lt; name: crtn0101&lt;br /&gt;
in&amp;lt; byte_count: 0x6a00 (26.5000 KB)&lt;br /&gt;
in&amp;lt; start_address: 0x10000&lt;br /&gt;
in&amp;lt; sample_rate: 1&lt;br /&gt;
in&amp;lt; sample_depth: 0&lt;br /&gt;
in&amp;lt; &lt;br /&gt;
in&amp;lt; sound entry: 1&lt;br /&gt;
in&amp;lt; ----------------&lt;br /&gt;
in&amp;lt; index: 1&lt;br /&gt;
in&amp;lt; name: crtn0104&lt;br /&gt;
in&amp;lt; byte_count: 0xe380 (56.8750 KB)&lt;br /&gt;
in&amp;lt; start_address: 0x17000&lt;br /&gt;
in&amp;lt; sample_rate: 1&lt;br /&gt;
in&amp;lt; sample_depth: 0&lt;br /&gt;
in&amp;lt; &lt;br /&gt;
in&amp;lt; sound entry: 2&lt;br /&gt;
in&amp;lt; ----------------&lt;br /&gt;
(...)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= Notes =&lt;br /&gt;
&lt;br /&gt;
== Remarks / Conclusions ==&lt;br /&gt;
&lt;br /&gt;
So far, all the used parts seem to work fine and I&#039;d use them again.&lt;br /&gt;
&lt;br /&gt;
There are still lots of issues that need to solved. For example, the SPI flash has some strange behavior when writing to it (write in progress flag keeps up). The STM32 TSC peripheral has not been tuned yet (very low res measurements), and the DAC playback sample rate was tuned by trial&#039;n&#039;error. There were some DMA underruns when switching samples fast... Some kind of debouncing/hystersis for the touch pads should be added, and the reading should be averaged to make play smoother... Volume control, dynamic fadeout, + other stuff.&lt;br /&gt;
&lt;br /&gt;
The project is probably on halt for a while. Basic facilities are working now...&lt;br /&gt;
&lt;br /&gt;
== TODO ==&lt;br /&gt;
&lt;br /&gt;
* 1 huge sample + offset test&lt;br /&gt;
* change playback rate (timer)&lt;br /&gt;
* REX style loop player&lt;br /&gt;
* loop samples + fadeout? loop points?&lt;br /&gt;
&lt;br /&gt;
* add button to change playback mode/preset etc.&lt;br /&gt;
* add leds for feedback?&lt;br /&gt;
* add pot / wheel for volume control&lt;br /&gt;
* add audio jack for line out?&lt;br /&gt;
* 1 pcb. 2 sided. touch pads and speaker and battery on it. CHEAP?&lt;br /&gt;
* sd card instead of SPI flash?&lt;br /&gt;
* resistive pads instead of capative?&lt;br /&gt;
* capacitive pads: easy to breakout -&amp;gt; makey makey style? clips?&lt;br /&gt;
&lt;br /&gt;
* sequenced play. record?&lt;br /&gt;
&lt;br /&gt;
* case / touch pads: make completely new concept.&lt;br /&gt;
* case: make wire hole bigger.&lt;br /&gt;
* case: rubber material?&lt;br /&gt;
&lt;br /&gt;
* increase TSC resolution, tune it!&lt;br /&gt;
* make 12bit version&lt;br /&gt;
* add hysteresis for better play.&lt;br /&gt;
* make play smooth. no stutters.&lt;br /&gt;
* 1 time calibration?&lt;/div&gt;</summary>
		<author><name>0rel</name></author>
	</entry>
	<entry>
		<id>https://wiki.sgmk-ssam.ch/index.php?title=Rawcoco&amp;diff=9501</id>
		<title>Rawcoco</title>
		<link rel="alternate" type="text/html" href="https://wiki.sgmk-ssam.ch/index.php?title=Rawcoco&amp;diff=9501"/>
		<updated>2021-04-14T17:55:19Z</updated>

		<summary type="html">&lt;p&gt;0rel: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= Overview =&lt;br /&gt;
&lt;br /&gt;
A capacitive touch sensing USB device.&lt;br /&gt;
&lt;br /&gt;
A 32-bit version/descendant of the [http://hackteria.org/projects/cocomake7/ Cocomake7].&lt;br /&gt;
&lt;br /&gt;
A work in progress prototype to learn more about ARM dev, STM32 peripherals and compare results with the AVR and teensy based versions.&lt;br /&gt;
&lt;br /&gt;
The goal is to make a versatile, affordable and playful interface device, that can be used as a creative basis for interactive (non-usb) playthings, DIY projects and electronics/interaction/game dev workshops.&lt;br /&gt;
&lt;br /&gt;
= Hardware (Electronics) =&lt;br /&gt;
&lt;br /&gt;
== General Notes ==&lt;br /&gt;
&lt;br /&gt;
Microcontroller:&lt;br /&gt;
* [http://www.st.com/web/en/catalog/mmc/FM141/SC1169/SS1574/LN1823/PF259617?s_searchtype=keyword STM32F042F6P6]&lt;br /&gt;
* Crystal-less USB with integrated USB (fullspeed) PHY&lt;br /&gt;
* Capacitive touch sensing peripheral&lt;br /&gt;
* Cost: ~$2 on Aliexpress (Chips Store)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Revision 0.03(/0.04) ==&lt;br /&gt;
&lt;br /&gt;
A test PCB with 6 touch pads lined up in a row. Easy to breakout, by cutting the PCB traces...&lt;br /&gt;
&lt;br /&gt;
No USB (ESD) protection, no line termination resistors (D+/-), no filtering, optimized for simplicity, size and cost.&lt;br /&gt;
&lt;br /&gt;
=== Features ===&lt;br /&gt;
* 6 touchpads&lt;br /&gt;
* micro USB port&lt;br /&gt;
* debug LED&lt;br /&gt;
* I2C / SWD connector&lt;br /&gt;
&lt;br /&gt;
=== Circuit ===&lt;br /&gt;
&lt;br /&gt;
[[File:Rawcoco_rev0.04_schematics_2016-03-27.png]]&lt;br /&gt;
&lt;br /&gt;
=== BOM ===&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Reference	Value		Digikey				Comment		Count	Unit Cost	SUM&lt;br /&gt;
&lt;br /&gt;
rawcoco:U1	STM32F042F6Px	STM32F042F6P6-ND		not available	1	1.48 EUR	1.48 EUR&lt;br /&gt;
rawcoco:U2	TLV70033DDCR	296-27937-1-ND					1	0.48 EUR	0.48 EUR&lt;br /&gt;
							&lt;br /&gt;
rawcoco:C1	100n		490-10777-1-ND					1	0.09 EUR	0.09 EUR&lt;br /&gt;
rawcoco:C8 C9	1u		490-6423-1-ND 					2	0.09 EUR	0.18 EUR&lt;br /&gt;
rawcoco:C10 C11	1n		490-6349-1-ND					2	0.09 EUR	0.18 EUR&lt;br /&gt;
							&lt;br /&gt;
rawcoco:D1	LED		511-1651-1-ND					1	0.41 EUR	0.41 EUR&lt;br /&gt;
							&lt;br /&gt;
rawcoco:R1	470R		CR0402-FX-4700GLFCT-ND 		470 Ohm		1	0.09 EUR	0.09 EUR&lt;br /&gt;
rawcoco:R7-R12	1k		R0402-FX-1001GLFCT-ND				6	0.09 EUR	0.54 EUR&lt;br /&gt;
							&lt;br /&gt;
rawcoco:CON1	1	1	WM17141CT-ND					1	0.91 EUR	0.91 EUR&lt;br /&gt;
							&lt;br /&gt;
rawcoco:K1 K2	CONN_3								2	0.00 EUR	0.00 EUR&lt;br /&gt;
rawcoco:P1 P2	CONN_4								2	0.00 EUR	0.00 EUR&lt;br /&gt;
rawcoco:P4-P6	CONN_1								3	0.00 EUR	0.00 EUR&lt;br /&gt;
&lt;br /&gt;
								SUM		22			4.36 €&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
REMARK: That price is the actual price on DigiKey for all the parts on the PCB. It is obvious, that 41 cents for an LED is way too much, so that the price can probably be lowered to about 3 Euros. The MCU is certainly the most expensive part...&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Digikey BOM (MCU not included):&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
1,296-27937-1-ND,rawcoco:U2&lt;br /&gt;
1,490-10777-1-ND,rawcoco:C1&lt;br /&gt;
2,490-6423-1-ND ,rawcoco:C8 C9&lt;br /&gt;
2,490-6349-1-ND,rawcoco:C10 C11&lt;br /&gt;
1,511-1651-1-ND,rawcoco:D1&lt;br /&gt;
1,CR0402-FX-4700GLFCT-ND ,rawcoco:R1&lt;br /&gt;
6,CR0402-FX-1001GLFCT-ND,rawcoco:R7-R12&lt;br /&gt;
1,WM17141CT-ND,rawcoco:CON1&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:rawcoco_rev0.01_DSCN0453b.JPG]]&lt;br /&gt;
&lt;br /&gt;
=== PCB ===&lt;br /&gt;
Get it at: [https://oshpark.com/shared_projects/szPUMDND OSHPark]&lt;br /&gt;
&lt;br /&gt;
[[File:rawcoco_rev0.03_8db25feb4bdb9d79a32d1499c6479c02.png]]&lt;br /&gt;
&lt;br /&gt;
[[File:rawcoco_rev0.03_7d0b0ff9e7c1d2c46295176494bc5194.png]]&lt;br /&gt;
&lt;br /&gt;
[[File:rawcoco_rev0.03_5b5ea8a04a42be6a5e3fb8afb65494fe.png]]&lt;br /&gt;
&lt;br /&gt;
[[File:rawcoco_rev0.03_A7e1a0047420d7dc076a6a2175629a03.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Pinouts ===&lt;br /&gt;
&lt;br /&gt;
SWD Pinout (topview, USB plug on the left):&lt;br /&gt;
* VDD&lt;br /&gt;
* SWCLK&lt;br /&gt;
* VSS&lt;br /&gt;
* SWDIO&lt;br /&gt;
[[File:rawcoco_swd_pinout.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Touchpad (TSC) order (topview, USB plug on the left):&lt;br /&gt;
* G1_IO4&lt;br /&gt;
* G1_IO3&lt;br /&gt;
* G1_IO2&lt;br /&gt;
* G2_IO4&lt;br /&gt;
* G2_IO3&lt;br /&gt;
* G2_IO2&lt;br /&gt;
[[File:rawcoco_rev0.01_tsc_pinout.png]]&lt;br /&gt;
&lt;br /&gt;
=== Errata / Known Bugs ===&lt;br /&gt;
* tie PB8 to ground -&amp;gt; BOOT0&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
= Hardware (Enclosure) =&lt;br /&gt;
&lt;br /&gt;
[[File:Rawcoco_case1_onshape.jpg]]&lt;br /&gt;
&lt;br /&gt;
[https://cad.onshape.com/documents/56ef409ce4b02f6312a8a3e0/w/f64d206a80b0b0b6cfab6400/e/649c52126c99f548e3084220 OnShape project]&lt;br /&gt;
&lt;br /&gt;
= Software =&lt;br /&gt;
&lt;br /&gt;
Currently used/evaluated tools and sources to get the board up and running:&lt;br /&gt;
&lt;br /&gt;
* Free tools for ARM development (gcc-none-eabi toolchain, OpenOCD)&lt;br /&gt;
* STM32CubeMX and sample code by ST&lt;br /&gt;
* Code::Blocks as an IDE&lt;br /&gt;
&lt;br /&gt;
More notes are collected [[STM32_dev|here]]...&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== USB HID Device ==&lt;br /&gt;
&lt;br /&gt;
Status: Mouse, Keyboard, Gamepad HID devices are working.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The generated code from STM32CubeMX was helpful. Basically only the HID report descriptors had to be modified in order to get keyboard and gamepad recognized by the OS.&lt;br /&gt;
&lt;br /&gt;
This tutorial was also quite insightful: http://eleccelerator.com/tutorial-about-usb-hid-report-descriptors/&lt;br /&gt;
&lt;br /&gt;
The official doc USB HID as well: http://www.usb.org/developers/hidpage/HID1_11.pdf&lt;br /&gt;
&lt;br /&gt;
The HID Descriptor Tool there comes with good examples and a validator plus exporter (header file...): http://www.usb.org/developers/hidpage/&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Keyboard Test ===&lt;br /&gt;
&lt;br /&gt;
This is the current test setup to send out keyboard keys from A-F. All six keys can be pressed at once... Funny, that the Keyboard HID descriptor can store six keys at max...&lt;br /&gt;
&lt;br /&gt;
Current problem: The sensitivity of the keys and fine tuning of the TSC peripheral needs to be investigated more...&lt;br /&gt;
&lt;br /&gt;
[[File:rawcoco_rev0.03_tsc_test_pads.jpg]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== USB MIDI ==&lt;br /&gt;
&lt;br /&gt;
Not working (yet). USB MIDI devices are more complicated to implement (USB Audio Device Class, [http://www.usb.org/developers/docs/devclass_docs/midi10.pdf MIDIstreaming])...&lt;br /&gt;
&lt;br /&gt;
== USB Serial (CDC) ==&lt;br /&gt;
&lt;br /&gt;
Characters can be sent!&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
= Notes =&lt;br /&gt;
&lt;br /&gt;
== Remarks / Conclusions ==&lt;br /&gt;
&lt;br /&gt;
The STM32&#039;s Touch Sensing Controller (TSC) peripheral can be handled without too much effort, and gives stable and fast measurements.&lt;br /&gt;
A good explanation of the principles behind that charge transfer acquisition technique can be found in [http://www.st.com/st-web-ui/static/active/en/resource/training/technical/product_training/STM32L4_Peripheral_Touchsense.pdf that presentation]... Nicely explained. It can acquire multiple channels at the same time (not tested yet), and can be configured to run independently of the main program using interrupts. Also, pin mapping and code generation in STM32CubeMX is very useful. It should also be possible make a &amp;quot;device independent&amp;quot; library that can be used on different STM32s, that have a TSC built in...&lt;br /&gt;
&lt;br /&gt;
[[File:STM32_tsc_doc0.jpg]]&lt;br /&gt;
&lt;br /&gt;
== TODOs ==&lt;br /&gt;
&lt;br /&gt;
* USB MIDI (maybe)&lt;br /&gt;
* Test multiplexing with 4051 to increase the number of touch channels.&lt;br /&gt;
* Read more about tuning the clock settings and various parameters to tune the TSC.&lt;br /&gt;
* Clean up code, throw unnessary things out. Make library...&lt;br /&gt;
* Combine USB HID and Virtual Serial Port (CDC), and try to write a boot loader that reprograms the flash over USB serial.&lt;br /&gt;
* Demos.&lt;br /&gt;
&lt;br /&gt;
= Info =&lt;br /&gt;
&lt;br /&gt;
== Links ==&lt;br /&gt;
&lt;br /&gt;
Various links...&lt;br /&gt;
&lt;br /&gt;
* http://www.usb.org/developers/&lt;br /&gt;
* http://www.usb.org/developers/hidpage/&lt;br /&gt;
* http://eleccelerator.com/tutorial-about-usb-hid-report-descriptors/&lt;br /&gt;
 &lt;br /&gt;
* http://www.pjrc.com/teensy/usb_keyboard.html&lt;br /&gt;
&lt;br /&gt;
* https://github.com/axoloti/axoloti/blob/master/firmware/usbh_conf.c&lt;br /&gt;
* https://github.com/axoloti/axoloti/blob/master/firmware/midi_usb.c&lt;br /&gt;
&lt;br /&gt;
* https://github.com/thi-ng/ws-ldn-4/blob/master/libsrc/stm_usbh/Class/CDC/Src/usbh_cdc.c&lt;br /&gt;
&lt;br /&gt;
* https://github.com/guitarfriiik/stm32_usb_midi&lt;br /&gt;
&lt;br /&gt;
* https://github.com/MaJerle/stm32f429/blob/master/00-STM32F429_LIBRARIES/tm_stm32f4_usb_hid_device.c&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* https://github.com/pellepl/arcadehid/tree/master/src/usb&lt;br /&gt;
&lt;br /&gt;
* http://eleccelerator.com/tutorial-about-usb-hid-report-descriptors/&lt;br /&gt;
* https://github.com/MaJerle/stm32fxxx_hal_libraries/tree/master/00-STM32_LIBRARIES&lt;br /&gt;
* http://stm32f4-discovery.com/2014/09/library-34-stm32f4-usb-hid-device/&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* http://electronics.stackexchange.com/questions/45635/usb-midi-interface-with-stm32f4-discovery&lt;br /&gt;
* https://github.com/sebseb7/stm32-midi-demo&lt;br /&gt;
* http://www.ucapps.de/mbhp_core_stm32.html&lt;br /&gt;
&lt;br /&gt;
* http://svnmios.midibox.org/filedetails.php?repname=svn.mios32&amp;amp;path=%2Ftrunk%2Fmios32%2FSTM32F10x%2Fmios32_usb_midi.c&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* https://github.com/MaJerle/stm32f429/blob/master/00-STM32F429_LIBRARIES/usb_hid_device/usbd_hid_core.c&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* https://www.circuitsathome.com/mcu/usb/visualizing-hid-device-reports-and-report-descriptors&lt;br /&gt;
&lt;br /&gt;
* http://eleccelerator.com/tutorial-about-usb-hid-report-descriptors/&lt;br /&gt;
* http://www.usb.org/developers/hidpage/&lt;br /&gt;
&lt;br /&gt;
* http://hamaluik.com/posts/making-a-custom-teensy3-hid-joystick/&lt;br /&gt;
&lt;br /&gt;
* http://codeandlife.com/2012/06/18/usb-hid-keyboard-with-v-usb/&lt;br /&gt;
&lt;br /&gt;
* http://www.st.com/st-web-ui/static/active/en/resource/training/technical/product_training/STM32L4_Peripheral_Touchsense.pdf&lt;/div&gt;</summary>
		<author><name>0rel</name></author>
	</entry>
	<entry>
		<id>https://wiki.sgmk-ssam.ch/index.php?title=PAMAMP&amp;diff=9500</id>
		<title>PAMAMP</title>
		<link rel="alternate" type="text/html" href="https://wiki.sgmk-ssam.ch/index.php?title=PAMAMP&amp;diff=9500"/>
		<updated>2021-04-14T17:53:10Z</updated>

		<summary type="html">&lt;p&gt;0rel: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;=== pamamp ===&lt;br /&gt;
&lt;br /&gt;
The [http://www.diodes.com/_files/datasheets/PAM8403.pdf PAM8403] is great little class-D stereo amplifier (3 W). Compared to the classic [http://www.ti.com/lit/ds/symlink/lm386.pdf LM386] it is much more efficient to use in a battery powered portable project, since it is class-D.&lt;br /&gt;
&lt;br /&gt;
You can find very cheap, ready-to-use boards on Ebay or AliExpress, with or without a volume pot. Or design your own with the temporary KiCAD design below, and integrate it into your own projects...&lt;br /&gt;
&lt;br /&gt;
There are also other variants of this amplifier IC:&lt;br /&gt;
* [http://www.diodes.com/_files/datasheets/PAM8302A.pdf PAM8302A (mono, 2.5 W, QFN package available)]&lt;br /&gt;
* [http://www.diodes.com/_files/datasheets/PAM8404.pdf PAM8404 (stereo, 3W, QFN package available)]&lt;br /&gt;
* [http://www.diodes.com/_files/datasheets/PAM8620.pdf PAM8620 (stereo, more power (15 W))]&lt;br /&gt;
&lt;br /&gt;
== PAM 8302 or 8302A ? ==&lt;br /&gt;
&lt;br /&gt;
Let&#039;s make a DIY-CAD version of this.... dusjagr is prototyping&lt;br /&gt;
&lt;br /&gt;
Adafruit has the 8302A: https://www.adafruit.com/product/2130&lt;br /&gt;
&lt;br /&gt;
dusjagr has around 100 SO-8 versions of the PAM 8302.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:pamamp_rev0.02_pic_00a.png|600px]] [[File:pamamp_rev0.02_pic_01a.png|600px]]&lt;br /&gt;
&lt;br /&gt;
[[File:pamamp_rev0.02_schematics_00a.png]]&lt;/div&gt;</summary>
		<author><name>0rel</name></author>
	</entry>
	<entry>
		<id>https://wiki.sgmk-ssam.ch/index.php?title=Electron_Festival_2011&amp;diff=9499</id>
		<title>Electron Festival 2011</title>
		<link rel="alternate" type="text/html" href="https://wiki.sgmk-ssam.ch/index.php?title=Electron_Festival_2011&amp;diff=9499"/>
		<updated>2021-04-14T13:55:00Z</updated>

		<summary type="html">&lt;p&gt;0rel: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[Category:makeaway]]&lt;br /&gt;
[[Category:Workshops]]&lt;br /&gt;
[[File:Website-Headers-3-en.png|640px|http://www.electronfestival.ch/2011/en]]&lt;br /&gt;
[[File:Pmina.jpg|240px]]&lt;br /&gt;
= electron festival geneva =&lt;br /&gt;
&lt;br /&gt;
SGMK -Société suisse des Arts mecatroniques&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
DIY MAKEAWAY @ Bâtiment d&#039;art contemporain (Bac)&lt;br /&gt;
&lt;br /&gt;
Opening &amp;amp; preparing /&lt;br /&gt;
Wednesday 20 april&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Swiss Mechatronic Art Society – DIY makeaway /&lt;br /&gt;
&lt;br /&gt;
Thursday 21 april 16h00 - 21h00&lt;br /&gt;
&lt;br /&gt;
Friday 22 april 16h00 - 21h00 &lt;br /&gt;
&lt;br /&gt;
Saturday 23 april 14h00 - 21h00&lt;br /&gt;
&lt;br /&gt;
Sunday 24 april 11h00 - 21h00&lt;br /&gt;
&lt;br /&gt;
= workshop = &lt;br /&gt;
* [http://new.mechatronicart.ch/index.php?id=134 micro_noise] / handout in [http://wiki.sgmk-ssam.ch/images/9/9e/A4_MicroNoise.pdf EN-A4]; [http://wiki.sgmk-ssam.ch/images/e/ec/A3_micronoise.pdf EN-A3] / [http://www.mechatronicart.ch/diymakeaway/wp-content/uploads/2008/07/breadboard_micronoise_big.png circuit on breadboard] / [http://www.mechatronicart.ch/diymakeaway/wp-content/uploads/2008/10/maske_new-scaled_mirrored_6x_160x100.png etching graph]&lt;br /&gt;
* [http://new.mechatronicart.ch/index.php?id=135 Light Seeker] / handout in [http://wiki.sgmk-ssam.ch/images/c/c8/LightSeeker2011.pdf EN-A4]; [http://wiki.sgmk-ssam.ch/images/4/47/A3_LightSeeker.pdf EN-A3]&lt;br /&gt;
* I&#039;M NUDE  (Ionchamber for Monitoring NUclear DEsasters ) [http://wiki.sgmk-ssam.ch/images/1/14/A4_I_am_nude.pdf EN-A4]; [http://wiki.sgmk-ssam.ch/images/9/97/A3_I_am_nude.pdf EN-A3]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
under the competent guidance of the electro-tinkerers of the Swiss Mechatronic Art Society (SGMK) one can solder an electronic toy or instrument such as a mini-robot or noise-synthesizer around 45 minutes.&lt;br /&gt;
&lt;br /&gt;
The SGMK is one of the most important groups on the current Swiss DIY scene. Until now, their activities where mostly in the German-speaking part of Switzerland (and in many countries abroad). The Electron festival will be a good occasion for them to connect. &lt;br /&gt;
&lt;br /&gt;
* http://www.electronfestival.ch/2011/en/dates.html?ditto_gd_documents=340&lt;br /&gt;
&lt;br /&gt;
== location == &lt;br /&gt;
* Venue address : BAC - Bâtiment d&#039;art contemporain, Rue des Bains 28, 1205 Genève&lt;br /&gt;
 &lt;br /&gt;
* google maps: [http://maps.google.com/maps?f=q&amp;amp;source=s_q&amp;amp;hl=en&amp;amp;geocode=&amp;amp;q=B%C3%A2timent+d%27art+contemporain,+GENEVA&amp;amp;aq=&amp;amp;sll=37.0625,-95.677068&amp;amp;sspn=48.77566,114.169922&amp;amp;ie=UTF8&amp;amp;hq=B%C3%A2timent+d%27art+contemporain,&amp;amp;hnear=Geneva,+Gen%C3%A8ve,+Canton+of+Geneva,+Switzerland&amp;amp;t=h&amp;amp;z=16&amp;amp;iwloc=A&amp;amp;cid=2717002044073977934 Bâtiment d&#039;art contemporain]&lt;br /&gt;
&lt;br /&gt;
{{#widget:GoogleMaps&lt;br /&gt;
|key=ABQIAAAAlPm43KFQwtkRrWYtQdVTphSRNxm4qhmcBlD3iKkEiWOO73bkTBQ01pa1G4IuDXbR7MXXesalyHMJ9A&lt;br /&gt;
|width=600&lt;br /&gt;
|height=400&lt;br /&gt;
|lat=46.198661&lt;br /&gt;
|lng=6.138223&lt;br /&gt;
|centermarker=yes&lt;br /&gt;
|maptypecontrol=yes&lt;br /&gt;
|largemapcontrol=yes&lt;br /&gt;
|overviewmapcontrol=no&lt;br /&gt;
|scalecontrol=yes&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Accomodation == &lt;br /&gt;
{|&lt;br /&gt;
|&lt;br /&gt;
{{#widget:GoogleMaps&lt;br /&gt;
|key=ABQIAAAAlPm43KFQwtkRrWYtQdVTphSRNxm4qhmcBlD3iKkEiWOO73bkTBQ01pa1G4IuDXbR7MXXesalyHMJ9A&lt;br /&gt;
|width=600&lt;br /&gt;
|height=400&lt;br /&gt;
|lat=46.186964&lt;br /&gt;
|lng=6.122204&lt;br /&gt;
|centermarker=yes&lt;br /&gt;
|maptypecontrol=yes&lt;br /&gt;
|largemapcontrol=no&lt;br /&gt;
|overviewmapcontrol=no&lt;br /&gt;
|scalecontrol=yes&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
||&lt;br /&gt;
&#039;&#039;&#039;Informations pratiques&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Ouverture&#039;&#039;&#039;&lt;br /&gt;
Du mardi au dimanche de 14h à 18h et sur rendez-vous&lt;br /&gt;
Nocturne le jeudi jusqu&#039;à 20h&lt;br /&gt;
Visites guidées pour les groupes sur demande&lt;br /&gt;
Entrée libre&lt;br /&gt;
&lt;br /&gt;
Buvette pendant les expositions le jeudi de 18h à 20h et le dimanche de 14h à 18h&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Adresse&#039;&#039;&#039;&lt;br /&gt;
Villa Bernasconi&lt;br /&gt;
Route du Grand-Lancy 8&lt;br /&gt;
1212 Grand-Lancy&lt;br /&gt;
+41(0)22 794 73 03&lt;br /&gt;
info@villabernasconi.ch&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Accès&#039;&#039;&#039;&lt;br /&gt;
Trams 15 arrêt Mairie de Lancy&lt;br /&gt;
Tram 17 arrêt Pont-Rouge&lt;br /&gt;
Train depuis la gare Cornavin arrêt Pont-Rouge&lt;br /&gt;
Parking de l&#039;Etoile&lt;br /&gt;
Télécharger le plan d&#039;accès&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Service culturel de la Ville de Lancy&#039;&#039;&#039;&lt;br /&gt;
www.lancy.ch&lt;br /&gt;
Françoise Mamie et Hélène Mariéthoz, responsables&lt;br /&gt;
Déléguées à la culture&lt;br /&gt;
Route du Grand-Lancy 41&lt;br /&gt;
1212 Grand-Lancy&lt;br /&gt;
+41(0)22 706 15 33 ou 34&lt;br /&gt;
f.mamie@lancy.ch&lt;br /&gt;
h.mariethoz@lancy.ch&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Equipe à la Villa Bernasconi&#039;&#039;&#039;&lt;br /&gt;
Marie Roduit, assistante +41(0)22 794 73 03 m.roduit@lancy.ch&lt;br /&gt;
Antoine Maret, régisseur +41(0)22 794 73 57&lt;br /&gt;
&lt;br /&gt;
[[File:Villabernasconi.jpg|180px]]&lt;br /&gt;
|&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== people ==&lt;br /&gt;
we have the following people helping:&lt;br /&gt;
* Tobias Hoffmann (DE/CH)&lt;br /&gt;
* Uwe Schüler &amp;amp; Jördis Drawe (DE)&lt;br /&gt;
* Monika Pocrnjić (SI)&lt;br /&gt;
* Ranga Adrian (CA/CH), speaks fluent french&lt;br /&gt;
* Pei-Wen Liu (TW/CH)&lt;br /&gt;
* Michael Ulber (CH), speaks o.k. french&lt;br /&gt;
&lt;br /&gt;
== attendance list ==&lt;br /&gt;
&lt;br /&gt;
please attend  @ 3 workshops at least&lt;br /&gt;
{| style=&amp;quot;background-color:#ffffee;&amp;quot; cellpadding=&amp;quot;4&amp;quot; cellspacing=&amp;quot;0&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|             || ^Thu 16-21h || ^Fr.16-21h|| ^Sa.14-17:30h|| ^Sa.17:30-21h || ^Su.11-17:30h || ^Su.17:30-21h  &lt;br /&gt;
|-&lt;br /&gt;
|  Tobias     ||     x       ||     x     ||              ||       x     ||      x        ||       x       &lt;br /&gt;
|-&lt;br /&gt;
|  Pei        ||     x       ||     x     ||              ||       x     ||             ||    x       &lt;br /&gt;
|-&lt;br /&gt;
|  Uwe        ||     x       ||      x    ||       x      ||             ||      x       ||                 &lt;br /&gt;
|-&lt;br /&gt;
|  Jördis     ||     x       ||      x    ||       x      ||             ||      x       ||              &lt;br /&gt;
|-&lt;br /&gt;
|  Monica     ||      x      ||      x    ||              ||        x    ||              ||   x           &lt;br /&gt;
|-&lt;br /&gt;
|  Adrian     ||             ||           ||              ||             ||              ||              &lt;br /&gt;
|-&lt;br /&gt;
|  Aurelio    ||             ||      x    ||      x       ||             ||             ||      x       &lt;br /&gt;
|-&lt;br /&gt;
|  Michael    ||             ||      x    ||      x       ||             ||              ||              &lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== TODO ==&lt;br /&gt;
* check &amp;amp; prepare material&lt;br /&gt;
* inform helpers &lt;br /&gt;
* outline schedule &lt;br /&gt;
* prepare handouts&lt;br /&gt;
&lt;br /&gt;
== Photo Documentation ==&lt;br /&gt;
&lt;br /&gt;
* 20/21 Apr diymakeaway @ http://is.gd/jHJFsV&lt;br /&gt;
* 22 Apr diymakeaway @ http://is.gd/ecIjvc&lt;br /&gt;
* 23 Apr diymakeaway @ http://is.gd/s9Nnqq&lt;br /&gt;
* 24 Apr diymakeaway @ http://is.gd/VhUEtX&lt;br /&gt;
* photo by Uwe @ http://is.gd/zMZqba&lt;br /&gt;
* photo by electron festival @ http://www.flickr.com/photos/electron-festival&lt;br /&gt;
&lt;br /&gt;
[http://editingwritingservices.org/article.php article writing service]&lt;/div&gt;</summary>
		<author><name>0rel</name></author>
	</entry>
	<entry>
		<id>https://wiki.sgmk-ssam.ch/index.php?title=STM32_dev&amp;diff=6615</id>
		<title>STM32 dev</title>
		<link rel="alternate" type="text/html" href="https://wiki.sgmk-ssam.ch/index.php?title=STM32_dev&amp;diff=6615"/>
		<updated>2016-11-27T18:27:13Z</updated>

		<summary type="html">&lt;p&gt;0rel: /* OS */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Overview ==&lt;br /&gt;
&lt;br /&gt;
Notes on STM32 microcontrollers and on how to get them working in DIY projects.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;/// this is a work in progress draft ///&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
== Software ==&lt;br /&gt;
&lt;br /&gt;
All about software tools for STM32 dev. Development environments, compilers, debuggers, IDEs etc.&lt;br /&gt;
&lt;br /&gt;
=== ARM toolchains ===&lt;br /&gt;
&lt;br /&gt;
==== gcc-arm-embedded Toolchain ====&lt;br /&gt;
&lt;br /&gt;
Install the GCC arm-none-eabi toolchain for your OS. On Arch Linux this can be done with the package manager:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
$ sudo pacman -S arm-none-eabi-gcc arm-none-eabi-gdb arm-none-eabi-binutils arm-none-eabi-newlib&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Alternatively, it can be built from scratch, to have all tools and their sources in one place.&lt;br /&gt;
&lt;br /&gt;
* Download the sources here: https://launchpad.net/gcc-arm-embedded/+download&lt;br /&gt;
* Install the &#039;&#039;common tools and libraries&#039;&#039; like described in the [https://launchpadlibrarian.net/231136652/How-to-build-toolchain.pdf documentation].&lt;br /&gt;
* Build the toolchain. - On my system, the following steps were required:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
$ cp gcc-arm-none-eabi-5_2-2015q4-20151219-src.tar.bz2 ~/toolchain&lt;br /&gt;
$ cd ~/toolchain&lt;br /&gt;
$ tar -xjf gcc-arm-none-eabi-5_2-2015q4-20151219-src.tar.bz2&lt;br /&gt;
$ cd ./gcc-arm-none-eabi-5_2-2015q4-20151219/src&lt;br /&gt;
$ find -name &#039;*.tar.*&#039; | xargs -I% tar -xf %&lt;br /&gt;
$ cd ..&lt;br /&gt;
$ ./build-prerequisites.sh --skip_steps=mingw32&lt;br /&gt;
$ ./build-toolchain.sh --skip_steps=mingw32,manual&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
Note that those &#039;&#039;skip_steps&#039;&#039; options were required in my case.&lt;br /&gt;
&lt;br /&gt;
==== Linaro Toolchain ====&lt;br /&gt;
&lt;br /&gt;
The [https://en.wikipedia.org/wiki/Linaro Linaro] toolchain seems to be famous as well.&lt;br /&gt;
&lt;br /&gt;
Install it with your package manager if available, or build it yourself:&amp;lt;br /&amp;gt;&lt;br /&gt;
https://wiki.linaro.org/WorkingGroups/ToolChain&amp;lt;br /&amp;gt;&lt;br /&gt;
https://wiki.linaro.org/WorkingGroups/ToolChain/FAQ&lt;br /&gt;
&lt;br /&gt;
==== devkitpro devkitARM toolchain ====&lt;br /&gt;
&lt;br /&gt;
Another gcc variant: http://devkitpro.org/&lt;br /&gt;
&lt;br /&gt;
Used in the homebrew scene for game consoles like the GP32, Nintendo (3)DS and GBA. It can [http://www.pouet.net/prod.php?which=59095 apparently] also be used for the STM32s as well! And generates probably more optimized binaries?&lt;br /&gt;
&lt;br /&gt;
(On Arch it can be installed from the AUR: https://aur.archlinux.org/packages/devkitarm-bin/ . But beware, the compiler, link, binutils have all the same name as the ones from the official GCC arm-none-eabi toolchain. So it&#039;s probably better to install it manually.)&lt;br /&gt;
&lt;br /&gt;
=== STM32CubeMX on Linux ===&lt;br /&gt;
&lt;br /&gt;
STM32CubeMX is a code generator for STM32 micros that can come in handy when you start a new project. It generates all the necessary init and HAL code, library and custom pin mux code for your specific MCU.&lt;br /&gt;
&lt;br /&gt;
Unfortunately, it comes as a Windows EXE and ST doesn&#039;t mention that it actually is a Java application. Luckily it can be installed on Linux by hand (thanks to 5V Joe&#039;s great note [http://fivevolt.blogspot.ch/2014/07/installing-stm32cubemx-on-linux.html there]):&lt;br /&gt;
&lt;br /&gt;
* Download [http://www.st.com/web/catalog/tools/FM147/CL1794/SC961/SS1743/PF259242?icmp=stm32cubemx_pron_prcube_feb2014&amp;amp;sc=stm32cube-pr STM32CubeMX].&lt;br /&gt;
* Install the application (tested in January 2016):&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
$ unzip SetupSTM32CubeMX-4.12.0.exe -d stm32cube&lt;br /&gt;
$ cd stm32cube&lt;br /&gt;
$ java -cp . com.izforge.izpack.installer.bootstrap.Installer&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
* Run:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
$ cd &amp;lt;install_dir&amp;gt;&lt;br /&gt;
$ unzip STM32CubeMX.exe&lt;br /&gt;
$ java -cp . com.st.microxplorer.maingui.STM32CubeMX&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== STM32CubeMX to Makefile ===&lt;br /&gt;
&lt;br /&gt;
For whatever reason, STM32CubeMX does not export plain GCC/Makefiles along with the initialization code. But instead, it supports an unpopular IDE called [http://www.st.com/web/catalog/tools/FM147/CL1794/SC961/SS1533/PF261797 SW4STM32], which is also based on free GNU tools. So after installing STM32CubeMX, these are the steps to get the GCC/Makefile project running:&lt;br /&gt;
&lt;br /&gt;
* Get this nice Python script by [http://www.ba0sh1.com/ Baoshi] to generate the Makefile for an exported SW4STM32 project:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
$ git clone https://github.com/baoshi/CubeMX2Makefile&lt;br /&gt;
$ cd CubeMX2Makefile&lt;br /&gt;
$ python2 CubeMX2Makefile.py &amp;lt;your_sw4stm32_prject_dir&amp;gt;&lt;br /&gt;
$ cd &amp;lt;your_sw4stm32_prject_dir&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* Fix a tiny bug in the generated Makefile (tested in January 2016). More can be read [http://www.ba0sh1.com/stm32cubemx-gcc-makefile/ here].&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
$ grep __weak Makefile &lt;br /&gt;
C_DEFS = -D__weak=&amp;quot;__attribute__\(\(weak\)\)&amp;quot; -D__packed=&amp;quot;__attribute__\(\(__packed__\)\)&amp;quot; -DUSE_HAL_DRIVER -DSTM32F072xB&lt;br /&gt;
$ sed -i &#039;s/\\(\\(weak\\)\\)/((weak))/g&#039; Makefile &lt;br /&gt;
$ sed -i &#039;s/\\(\\(packed\\)\\)/((packed))/g&#039; Makefile &lt;br /&gt;
$ grep __weak Makefile &lt;br /&gt;
C_DEFS = -D__weak=&amp;quot;__attribute__((weak))&amp;quot; -D__packed=&amp;quot;__attribute__\(\(__packed__\)\)&amp;quot; -DUSE_HAL_DRIVER -DSTM32F072xB&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* Then build the binary:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
$ make&lt;br /&gt;
(...)&lt;br /&gt;
arm-none-eabi-size build/STM32F072RBT6.elf&lt;br /&gt;
   text	   data	    bss	    dec	    hex	filename&lt;br /&gt;
   4568	     12	   1572	   6152	   1808	build/STM32F072RBT6.elf&lt;br /&gt;
arm-none-eabi-objcopy -O ihex build/STM32F072RBT6.elf build/STM32F072RBT6.hex&lt;br /&gt;
arm-none-eabi-objcopy -O binary -S build/STM32F072RBT6.elf build/STM32F072RBT6.bin	&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Flash ===&lt;br /&gt;
&lt;br /&gt;
Install OpenOCD and STLINK. On Arch Linux:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
sudo pacman -S stlink openocd&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now [http://openocd.org/ OpenOCD] and (arm-none-eabi-)gdb can be used to program and debug the MCU. All discovery boards also come with an ST-LINK/V2 programmer right built in speaking over USB to the host and over JTAG/[http://www.arm.com/products/system-ip/debug-trace/coresight-soc-components/serial-wire-debug.php SWD] to the target (note: only two pins are actually required for SWD debugging/flashing (SWDIO/SWCLK), but that for later (see also [[#Hardware]])). STM32 Discovery Boards should show up in the lsusb list like that:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
$ lsusb&lt;br /&gt;
(...)&lt;br /&gt;
Bus 003 Device 006: ID 0483:3748 STMicroelectronics ST-LINK/V2&lt;br /&gt;
(...)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
OpenOCD can now act as a &amp;quot;middleman&amp;quot; between the ST-LINK programmer and the user. As a server on the host, to which you can connect with telnet and GDB.&lt;br /&gt;
&lt;br /&gt;
To configure OpenOCD, put a configuration file called opencd.cfg into the project folder and start OpenOCD. While working on the project, let it run there in the foreground to see all the logs...&lt;br /&gt;
&lt;br /&gt;
For the [http://www.st.com/st-web-ui/static/active/jp/resource/technical/document/user_manual/DM00099401.pdf STM32 F072 Discovery] board this should work, for example:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
$ cd &amp;lt;project_directory&amp;gt;&lt;br /&gt;
$ echo &amp;quot;source [find board/stm32f0discovery.cfg]&amp;quot; &amp;gt; openocd.cfg&lt;br /&gt;
$ openocd&lt;br /&gt;
Open On-Chip Debugger 0.9.0 (2015-05-19-13:50)&lt;br /&gt;
Licensed under GNU GPL v2&lt;br /&gt;
For bug reports, read&lt;br /&gt;
	http://openocd.org/doc/doxygen/bugs.html&lt;br /&gt;
Info : The selected transport took over low-level target control. The results might differ compared to plain JTAG/SWD&lt;br /&gt;
adapter speed: 1000 kHz&lt;br /&gt;
adapter_nsrst_delay: 100&lt;br /&gt;
none separate&lt;br /&gt;
srst_only separate srst_nogate srst_open_drain connect_deassert_srst&lt;br /&gt;
Info : Unable to match requested speed 1000 kHz, using 950 kHz&lt;br /&gt;
Info : Unable to match requested speed 1000 kHz, using 950 kHz&lt;br /&gt;
Info : clock speed 950 kHz&lt;br /&gt;
Info : STLINK v2 JTAG v17 API v2 SWIM v0 VID 0x0483 PID 0x3748&lt;br /&gt;
Info : using stlink api v2&lt;br /&gt;
Info : Target voltage: 2.896454&lt;br /&gt;
Info : stm32f0x.cpu: hardware has 4 breakpoints, 2 watchpoints&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
(Don&#039;t worry about those warnings about the wrong clock speed for now...)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
In order to program the flash, connect to OpenOCD via telnet in another terminal:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
$ telnet 127.0.0.1 4444&lt;br /&gt;
Trying 127.0.0.1...&lt;br /&gt;
Connected to 127.0.0.1.&lt;br /&gt;
Escape character is &#039;^]&#039;.&lt;br /&gt;
Open On-Chip Debugger&lt;br /&gt;
&amp;gt; &lt;br /&gt;
&amp;gt; reset halt&lt;br /&gt;
target state: halted&lt;br /&gt;
target halted due to debug-request, current mode: Thread &lt;br /&gt;
xPSR: 0xc1000000 pc: 0x080014d0 msp: 0x20004000&lt;br /&gt;
&amp;gt; flash probe 0&lt;br /&gt;
device id = 0x20016448&lt;br /&gt;
flash size = 128kbytes&lt;br /&gt;
flash &#039;stm32f1x&#039; found at 0x08000000&lt;br /&gt;
&amp;gt; flash write_image erase build/STM32F072RBT6.elf&lt;br /&gt;
auto erase enabled&lt;br /&gt;
target state: halted&lt;br /&gt;
target halted due to breakpoint, current mode: Thread &lt;br /&gt;
xPSR: 0x61000000 pc: 0x2000003a msp: 0x20004000&lt;br /&gt;
wrote 6144 bytes from file build/STM32F072RBT6.elf in 0.503961s (11.906 KiB/s)&lt;br /&gt;
&amp;gt; reset run&lt;br /&gt;
&amp;gt; exit&lt;br /&gt;
Connection closed by foreign host.&lt;br /&gt;
$&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This should write the binary to the flash memory and start the program.&lt;br /&gt;
Of course, all those steps can be automated further and integrated into an IDE, but that&#039;s for later...&lt;br /&gt;
&lt;br /&gt;
To program the STM32F0Discovery board for example, this can be used to just flash the chip:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
$ openocd -f board/stm32f0discovery.cfg -c &amp;quot;program build/STM32F072RBT6.elf verify reset exit&amp;quot; &lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
To program a custom board for example with the STM32F0x chip, a command like this can be used:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
$ openocd -f interface/stlink-v2.cfg -f target/stm32f0x.cfg -c &amp;quot;program testSTM32F072_interrupt_test0.elf verify reset exit&amp;quot;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
To make things more convenient, add a new target &#039;&#039;flash&#039;&#039; to the Makefile with this command, and you can simply run &#039;&#039;make flash&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The exported main.c from STM32CubeMX was only slightly modified to let the user LEDs flash and react to the user pushbutton:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
******************************************************************************&lt;br /&gt;
* main.c *&lt;br /&gt;
******************************************************************************&lt;br /&gt;
&lt;br /&gt;
#include &amp;quot;stm32f0xx_hal.h&amp;quot;&lt;br /&gt;
&lt;br /&gt;
void SystemClock_Config(void);&lt;br /&gt;
static void MX_GPIO_Init(void);&lt;br /&gt;
&lt;br /&gt;
int main(void)&lt;br /&gt;
{&lt;br /&gt;
  /* Reset of all peripherals, Initializes the Flash interface and the Systick. */&lt;br /&gt;
  HAL_Init();&lt;br /&gt;
&lt;br /&gt;
  /* Configure the system clock */&lt;br /&gt;
  SystemClock_Config();&lt;br /&gt;
&lt;br /&gt;
  /* Initialize all configured peripherals */&lt;br /&gt;
  MX_GPIO_Init();&lt;br /&gt;
&lt;br /&gt;
  while (1)&lt;br /&gt;
  {&lt;br /&gt;
    uint32_t delay;&lt;br /&gt;
    if( HAL_GPIO_ReadPin( GPIOA, GPIO_PIN_0 ) == GPIO_PIN_SET )&lt;br /&gt;
      delay = 50;&lt;br /&gt;
    else&lt;br /&gt;
      delay = 250;&lt;br /&gt;
&lt;br /&gt;
    HAL_GPIO_TogglePin( GPIOC, GPIO_PIN_9 );&lt;br /&gt;
    HAL_Delay( delay );&lt;br /&gt;
    HAL_GPIO_TogglePin( GPIOC, GPIO_PIN_8 );&lt;br /&gt;
    HAL_Delay( delay );&lt;br /&gt;
    HAL_GPIO_TogglePin( GPIOC, GPIO_PIN_7 );&lt;br /&gt;
    HAL_Delay( delay );&lt;br /&gt;
    HAL_GPIO_TogglePin( GPIOC, GPIO_PIN_6 );&lt;br /&gt;
    HAL_Delay( delay );&lt;br /&gt;
&lt;br /&gt;
  }&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
/** System Clock Configuration&lt;br /&gt;
*/&lt;br /&gt;
void SystemClock_Config(void)&lt;br /&gt;
{&lt;br /&gt;
&lt;br /&gt;
  RCC_OscInitTypeDef RCC_OscInitStruct;&lt;br /&gt;
  RCC_ClkInitTypeDef RCC_ClkInitStruct;&lt;br /&gt;
&lt;br /&gt;
  RCC_OscInitStruct.OscillatorType = RCC_OSCILLATORTYPE_HSI;&lt;br /&gt;
  RCC_OscInitStruct.HSIState = RCC_HSI_ON;&lt;br /&gt;
  RCC_OscInitStruct.HSICalibrationValue = 16;&lt;br /&gt;
  RCC_OscInitStruct.PLL.PLLState = RCC_PLL_NONE;&lt;br /&gt;
  HAL_RCC_OscConfig(&amp;amp;RCC_OscInitStruct);&lt;br /&gt;
&lt;br /&gt;
  RCC_ClkInitStruct.ClockType = RCC_CLOCKTYPE_SYSCLK;&lt;br /&gt;
  RCC_ClkInitStruct.SYSCLKSource = RCC_SYSCLKSOURCE_HSI;&lt;br /&gt;
  RCC_ClkInitStruct.AHBCLKDivider = RCC_SYSCLK_DIV1;&lt;br /&gt;
  RCC_ClkInitStruct.APB1CLKDivider = RCC_HCLK_DIV1;&lt;br /&gt;
  HAL_RCC_ClockConfig(&amp;amp;RCC_ClkInitStruct, FLASH_LATENCY_0);&lt;br /&gt;
&lt;br /&gt;
  HAL_SYSTICK_Config(HAL_RCC_GetHCLKFreq()/1000);&lt;br /&gt;
&lt;br /&gt;
  HAL_SYSTICK_CLKSourceConfig(SYSTICK_CLKSOURCE_HCLK);&lt;br /&gt;
&lt;br /&gt;
  /* SysTick_IRQn interrupt configuration */&lt;br /&gt;
  HAL_NVIC_SetPriority(SysTick_IRQn, 0, 0);&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
/** Configure pins as&lt;br /&gt;
        * Analog&lt;br /&gt;
        * Input&lt;br /&gt;
        * Output&lt;br /&gt;
        * EVENT_OUT&lt;br /&gt;
        * EXTI&lt;br /&gt;
*/&lt;br /&gt;
void MX_GPIO_Init(void)&lt;br /&gt;
{&lt;br /&gt;
&lt;br /&gt;
  GPIO_InitTypeDef GPIO_InitStruct;&lt;br /&gt;
&lt;br /&gt;
  /* GPIO Ports Clock Enable */&lt;br /&gt;
  __GPIOA_CLK_ENABLE();&lt;br /&gt;
  __GPIOC_CLK_ENABLE();&lt;br /&gt;
&lt;br /&gt;
  /*Configure GPIO pin : PA0 */&lt;br /&gt;
  GPIO_InitStruct.Pin = GPIO_PIN_0;&lt;br /&gt;
  GPIO_InitStruct.Mode = GPIO_MODE_INPUT;&lt;br /&gt;
  GPIO_InitStruct.Pull = GPIO_NOPULL;&lt;br /&gt;
  HAL_GPIO_Init(GPIOA, &amp;amp;GPIO_InitStruct);&lt;br /&gt;
&lt;br /&gt;
  /*Configure GPIO pins : PC6 PC7 PC8 PC9 */&lt;br /&gt;
  GPIO_InitStruct.Pin = GPIO_PIN_6|GPIO_PIN_7|GPIO_PIN_8|GPIO_PIN_9;&lt;br /&gt;
  GPIO_InitStruct.Mode = GPIO_MODE_OUTPUT_PP;&lt;br /&gt;
  GPIO_InitStruct.Pull = GPIO_NOPULL;&lt;br /&gt;
  GPIO_InitStruct.Speed = GPIO_SPEED_LOW;&lt;br /&gt;
  HAL_GPIO_Init(GPIOC, &amp;amp;GPIO_InitStruct);&lt;br /&gt;
&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
(&lt;br /&gt;
Note that pins -- among various other things -- can be customized in the CubeMX editor. Reexporting code to an existing project is straight forward, and can be done easily while the old Makefile keeps valid for minor changes... - However, STM32CubeMX looks still quite unfinished to me. It&#039;s a nice concept, but where are all the ST libraries, for example for the [http://www.st.com/web/en/catalog/tools/FM147/CL1794/SC961/SS1743/LN1734/PF258658# touch functionality]? It still needs to be downloaded separately... and it comes in a bloody EXE file as well! *arghs*&lt;br /&gt;
&lt;br /&gt;
Unfortunately, things seem to be a bit confusing. If you&#039;re using a STM32F0, then probably need to take a look into the [http://www.st.com/web/catalog/tools/FM147/CL1794/SC961/SS1743/LN1897/PF260612?icmp=pf260612_pron_nb_jun2014&amp;amp;sc=stm32cubef0-pr STM32CubeF0] software bundle, which contains a more up-to-date TouchSensing Library... Hm.&lt;br /&gt;
&lt;br /&gt;
Also, note that most of the provided code by ST is only documented in the source files themselves... And there are at least two vastly differing versions of the basic functions out there, what makes copy/pasting/sharing a bit difficult. I even don&#039;t know if they continue working on this code base, or if they switch over to [https://www.mbed.com/en/ mbed]. That seems to be the focus of those newer [http://www.st.com/web/catalog/tools/FM116/SC959/SS1532/LN1847?sc=stm32nucleo Nucleo] evaluation boards.&lt;br /&gt;
)&lt;br /&gt;
&lt;br /&gt;
=== Debugging: GDB ===&lt;br /&gt;
&lt;br /&gt;
GDB can be used to debug the code right on the hardware. While OpenOCD is running, you can connect to the target like this and step through the program:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
$ arm-none-eabi-gdb -tui build/STM32F072RBT6.elf&lt;br /&gt;
(...)&lt;br /&gt;
Reading symbols from build/STM32F072RBT6.elf...done.&lt;br /&gt;
&lt;br /&gt;
(gdb) target remote :3333&lt;br /&gt;
Remote debugging using :3333&lt;br /&gt;
Python Exception &amp;lt;type &#039;exceptions.NameError&#039;&amp;gt; Installation error: gdb.execute_u&lt;br /&gt;
nwinders function is missing:&lt;br /&gt;
HAL_GetTick () at Drivers/STM32F0xx_HAL_Driver/Src/stm32f0xx_hal.c:298&lt;br /&gt;
&lt;br /&gt;
(gdb) c&lt;br /&gt;
Continuing.&lt;br /&gt;
&lt;br /&gt;
Program received signal SIGINT, Interrupt.&lt;br /&gt;
0x080002f6 in HAL_Delay (Python Exception &amp;lt;type &#039;exceptions.NameError&#039;&amp;gt; Installa&lt;br /&gt;
tion error: gdb.execute_unwinders function is missing:&lt;br /&gt;
Delay=250)&lt;br /&gt;
    at Drivers/STM32F0xx_HAL_Driver/Src/stm32f0xx_hal.c:317&lt;br /&gt;
&lt;br /&gt;
(gdb) break main.c:91&lt;br /&gt;
Breakpoint 1 at 0x8001392: file Src/main.c, line 91.&lt;br /&gt;
&lt;br /&gt;
(gdb) c&lt;br /&gt;
Continuing.&lt;br /&gt;
Note: automatically using hardware breakpoints for read-only addresses.&lt;br /&gt;
Python Exception &amp;lt;type &#039;exceptions.NameError&#039;&amp;gt; Installation error: gdb.execute_u&lt;br /&gt;
nwinders function is missing:&lt;br /&gt;
&lt;br /&gt;
Breakpoint 1, main () at Src/main.c:91&lt;br /&gt;
&lt;br /&gt;
(...)&lt;br /&gt;
(gdb) detach&lt;br /&gt;
(qdb) quit&lt;br /&gt;
$&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
(Note: the -tui option is really great to inspect the code... see [http://ftp.gnu.org/old-gnu/Manuals/gdb-5.1.1/html_chapter/gdb_19.html GDB Text User Interface])&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== IDE: Eclipse SW4STM32 ===&lt;br /&gt;
&lt;br /&gt;
GOOD NEWS: This officially supported Eclipse variant should work out of the box with STM32CubeMX generated project. You simply need to register on that site, and you&#039;ll get a software package that should work:&lt;br /&gt;
&lt;br /&gt;
[http://www.st.com/content/st_com/en/products/development-tools/software-development-tools/stm32-software-development-tools/stm32-ides/sw4stm32.html SW4STM32 - System Workbench for STM32: free IDE on Windows, Linux and OS X ]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
(Side note: I don&#039;t know how well it works when you have another Eclipse installed on your system... currently testing this out.)&lt;br /&gt;
&lt;br /&gt;
=== IDE: Eclipse with GNU ARM Eclipse plugin ===&lt;br /&gt;
&lt;br /&gt;
To use Eclipse as an IDE for the STM32s, just install Eclipse and a the GNU ARM Eclipse Plugin.&lt;br /&gt;
&lt;br /&gt;
* Eclipse IDE for C/C++ (CDT). This can be installed manually or with your package manager.&lt;br /&gt;
* Eclipse Plugin: [https://gnuarmeclipse.github.io/ GNU ARM Eclipse]. - This can be done in the Eclipse Marketplace (under &#039;&#039;Help &amp;gt; Eclipse Marketplace&#039;&#039; (use the default options)).&lt;br /&gt;
* Create a new Eclipse project with the GNU ARM Eclipse (Choose STM32Fxxx C/C++ Project in the Wizard)&lt;br /&gt;
&lt;br /&gt;
With some minor adjustments in the settings (OpenOCD), the basic Blinky example that comes with the plugin should work out of the box, with a STLink v2 programmer. Code completion etc. works fine too.&lt;br /&gt;
&lt;br /&gt;
(/todo: show every step)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
But there&#039;s quite annoying problem with this workflow!:&lt;br /&gt;
&lt;br /&gt;
http://www.carminenoviello.com/en/2015/06/04/stm32-applications-eclipse-gcc-stcube/:&lt;br /&gt;
&amp;lt;blockquote&amp;gt;&lt;br /&gt;
Unfortunately, the plug-in author has updated just the template for STM32-F4 family to the more recently STM32Cube-F4 HAL framework from ST (which still supports only commercial IDE.....), leaving the other templates still based on the old Standard Peripheral Library, which is no longer supported by ST and STM32CubeMX tool used in my tutorial. This causes my instructions to be wrong for processor families different from STM32-F4. &lt;br /&gt;
&amp;lt;/blockquote&amp;gt;&lt;br /&gt;
&lt;br /&gt;
So, several manual setup steps will be required to get started with your own STM32 project. To goal is to configure the project in STM32CubeMX, and use up-to-date HAL code, and not the deprecated Standard Peripheral Library.&lt;br /&gt;
&lt;br /&gt;
The GNU ARM Eclipse plugin is great, but doesn&#039;t create projects with up-to-date code. So we need to modify the manually created GNU ARM Eclipse project. - I used a custom STM32F072C8 board, and all steps below assum this hardware. The steps would be slightly different for other hardware.&lt;br /&gt;
&lt;br /&gt;
([http://www.carminenoviello.com/en/2015/06/04/stm32-applications-eclipse-gcc-stcube This tutorial] was helping here...)&lt;br /&gt;
&lt;br /&gt;
* First create a new &#039;C Project&#039; in your Eclipse workspace.&lt;br /&gt;
* In Wizard slide &#039;&#039;C Project&#039;&#039;: Choose Executable &amp;gt; &#039;&#039;Hello World ARM Cortex-M C/C++ Project&#039;&#039; and give it a name (e.g. testSTM32_00). This will generate a generic ARM project instead of an STM32Fxxx one. - Then hit &#039;&#039;Next&#039;&#039;.&lt;br /&gt;
* In Wizard slide &#039;&#039;Target processor settings&#039;&#039;: Configure the target processor: For the STM32F072C8: Change the defaults to Flash size (kB): 64, RAM size (kB): 16, Use system calls: Freestanding (no POSIX system calls), Trace output: None (no trace output). - Then hit &#039;&#039;Next&#039;&#039;.&lt;br /&gt;
* In Wizard slide &#039;&#039;Folders&#039;&#039;: Change Vendor CMSIS name to stm32f0xx. - Then hit next.&lt;br /&gt;
* In Wizard slide &#039;&#039;Select Configurations&#039;&#039;: Leave as is. - Then hit &#039;&#039;Next&#039;&#039;.&lt;br /&gt;
* In Wizard slide &#039;&#039;Cross GNU ARM Toolchain&#039;&#039;: Select &#039;&#039;GNU Tools for ARM Embedded Processors (arm-none-eabi-gcc)&#039;&#039; and either choose the global, system wide toolchain (probably in /usr/bin) or enter the path to your custom one. - Then hit &#039;&#039;Finish&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
This will create a generic ARM project, which should build without errors (hit Ctrl+B). &lt;br /&gt;
&lt;br /&gt;
Next, we need to add the vendor specific HAL code by ST generated with STM32CubeMX and/or downloaded in a more specific firmware package (STM32CubeF0, STM32CubeF4 etc.).&lt;br /&gt;
&lt;br /&gt;
...&lt;br /&gt;
So, after configuring a generic Eclipse project, we&#039;re ready to modify it.&lt;br /&gt;
&lt;br /&gt;
* Configure and export an EWARM project in [http://www.st.com/web/en/catalog/tools/PF259242 STM32CubeMX] (with default settings).&lt;br /&gt;
&lt;br /&gt;
* Extract the [http://www.st.com/web/en/catalog/tools/PF260612 STM32CubeF0] archive. ([http://www.st.com/web/en/catalog/tools/PF260820 STM32CubeF1], [http://www.st.com/web/en/catalog/tools/PF260266 STM32CubeF2], [http://www.st.com/web/en/catalog/tools/PF260613 STMCubeF3], [http://www.st.com/web/en/catalog/tools/PF259243 STMCubeF4]).&lt;br /&gt;
&lt;br /&gt;
As a starting point, here&#039;s a bash script, that modifies the previously created Eclipse project:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
#!/usr/bin/env bash&lt;br /&gt;
&lt;br /&gt;
set -e&lt;br /&gt;
&lt;br /&gt;
#echo &amp;quot;Press CTRL+C to proceed.&amp;quot;&lt;br /&gt;
#trap &amp;quot;pkill -f &#039;sleep 1h&#039;&amp;quot; INT&lt;br /&gt;
#trap &amp;quot;set +x ; sleep 1h ; set -x&amp;quot; DEBUG&lt;br /&gt;
&lt;br /&gt;
# MODIFY THIS!&lt;br /&gt;
ECLIPSE_PROJECT=/run/media/rel/prc/code/workspace_testSTM32_01/testSTM32_00&lt;br /&gt;
STM32CUBEF0=/home/rel/src/STM32Cube_FW_F0_V1.4.0&lt;br /&gt;
STM32CUBEMX=/home/rel/Desktop/test_stm32cubemx_ewarm&lt;br /&gt;
&lt;br /&gt;
echo --------------------------------------------------------------------------------&lt;br /&gt;
echo Eclipse Project Initializer for STM32F072 Dev&lt;br /&gt;
echo --------------------------------------------------------------------------------&lt;br /&gt;
&lt;br /&gt;
echo&lt;br /&gt;
echo The script is using the following paths:&lt;br /&gt;
echo&lt;br /&gt;
echo Eclipse Project:&lt;br /&gt;
echo $ECLIPSE_PROJECT&lt;br /&gt;
echo&lt;br /&gt;
echo STM32Cube:&lt;br /&gt;
echo $STM32CUBEF0&lt;br /&gt;
echo&lt;br /&gt;
echo STM32CubeMX:&lt;br /&gt;
echo $STM32CUBEMX&lt;br /&gt;
&lt;br /&gt;
echo&lt;br /&gt;
echo -n &amp;quot;Do you want to proceed? [ENTER]&amp;quot;&lt;br /&gt;
read&lt;br /&gt;
&lt;br /&gt;
echo&lt;br /&gt;
echo Deleting files from eclipse project:&lt;br /&gt;
rm -fv $ECLIPSE_PROJECT/src/main.c&lt;br /&gt;
rm -fv $ECLIPSE_PROJECT/src/Timer.c&lt;br /&gt;
rm -fv $ECLIPSE_PROJECT/include/Timer.h&lt;br /&gt;
&lt;br /&gt;
rm -fv $ECLIPSE_PROJECT/system/include/cmsis/stm32f0xx.h&lt;br /&gt;
rm -fv $ECLIPSE_PROJECT/system/include/cmsis/system_stm32f0xx.h&lt;br /&gt;
&lt;br /&gt;
rm -fv $ECLIPSE_PROJECT/system/src/cmsis/system_stm32f0xx.c&lt;br /&gt;
rm -fv $ECLIPSE_PROJECT/system/src/cmsis/vectors_stm32f0xx.c&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
echo&lt;br /&gt;
echo Copying: ST HAL:&lt;br /&gt;
cp -rfv $STM32CUBEF0/Drivers/STM32F0xx_HAL_Driver/Src/* \&lt;br /&gt;
$ECLIPSE_PROJECT/system/src/stm32f0xx&lt;br /&gt;
&lt;br /&gt;
cp -rfv $STM32CUBEF0/Drivers/STM32F0xx_HAL_Driver/Inc/* \&lt;br /&gt;
$ECLIPSE_PROJECT/system/include/stm32f0xx&lt;br /&gt;
&lt;br /&gt;
cp -rfv $STM32CUBEF0/Drivers/CMSIS/Device/ST/STM32F0xx/Include/* \&lt;br /&gt;
$ECLIPSE_PROJECT/system/include/cmsis&lt;br /&gt;
&lt;br /&gt;
cp -fv $STM32CUBEF0/Drivers/CMSIS/Device/ST/STM32F0xx/Source/Templates/gcc/startup_stm32f072xb.s \&lt;br /&gt;
$ECLIPSE_PROJECT/system/src/cmsis/startup_stm32f072xb.S&lt;br /&gt;
&lt;br /&gt;
cp -fv $STM32CUBEF0/Drivers/CMSIS/Device/ST/STM32F0xx/Source/Templates/system_stm32f0xx.c \&lt;br /&gt;
$ECLIPSE_PROJECT/system/src/cmsis&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
# echo Copying: example project from STM32CubeF0:&lt;br /&gt;
#cp $STM32CUBEF0/Projects/STM32F072B-Discovery/Examples/GPIO/GPIO_IOToggle/Inc/* \&lt;br /&gt;
#$ECLIPSE_PROJECT/include&lt;br /&gt;
&lt;br /&gt;
#cp $STM32CUBEF0/Projects/STM32F072B-Discovery/Examples/GPIO/GPIO_IOToggle/Src/main.c \&lt;br /&gt;
#$ECLIPSE_PROJECT/src&lt;br /&gt;
&lt;br /&gt;
#cp $STM32CUBEF0/Projects/STM32F072B-Discovery/Examples/GPIO/GPIO_IOToggle/Src/stm32f0xx_it.c \&lt;br /&gt;
#$ECLIPSE_PROJECT/src&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
echo&lt;br /&gt;
echo Copying: example project from STM32CubeMX:&lt;br /&gt;
cp $STM32CUBEMX/Src/* $ECLIPSE_PROJECT/src&lt;br /&gt;
cp $STM32CUBEMX/Inc/* $ECLIPSE_PROJECT/include&lt;br /&gt;
&lt;br /&gt;
echo&lt;br /&gt;
echo Modifiying/fixing the memory map:&lt;br /&gt;
echo $ECLIPSE_PROJECT/ldscripts/mem.ld&lt;br /&gt;
sed -i &#039;s/FLASH (rx) : ORIGIN = 0x00000000/FLASH (rx) : ORIGIN = 0x08000000/g&#039; $ECLIPSE_PROJECT/ldscripts/mem.ld&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
echo&lt;br /&gt;
echo SUCCESS&lt;br /&gt;
echo&lt;br /&gt;
&lt;br /&gt;
echo&lt;br /&gt;
echo Now, exclude the following file from the Eclipse project manually:&lt;br /&gt;
ls $ECLIPSE_PROJECT/system/src/stm32f0xx/stm32f0xx_hal_msp_template.c&lt;br /&gt;
&lt;br /&gt;
echo&lt;br /&gt;
echo And add the following preprocessor constants to the C/C++ compiler settings in Eclipse:&lt;br /&gt;
echo USE_HAL_DRIVER&lt;br /&gt;
echo STM32F072xB&lt;br /&gt;
&lt;br /&gt;
echo&lt;br /&gt;
echo &amp;quot;And add the following config options to the GDB OpenOCD Debugging settings (in Run Configurations):&amp;quot;&lt;br /&gt;
echo &amp;quot;-f interface/stlink-v2.cfg -f target/stm32f0x.cfg&amp;quot;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This script needs to be modified according to your needs! (Currently is working for the STM32F072C8, and contains fixed paths! - Note that there minor inconsistencies in some of these ST projects. For example, all the provided STM32F072xB* files by ST work for both types of chips -- STM32F072x8 and STM32F072xB.)&lt;br /&gt;
&lt;br /&gt;
Like described in the script above, some minor manual changes need to be made in Eclipse after running the script.&lt;br /&gt;
&lt;br /&gt;
This should now be a good basis to start a new STM32 project.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Note that the GNU ARM Eclipse plugin always generates a Makefile for every project configuration (Debug / Release). It can be found in &amp;lt;project_folder&amp;gt;/Debug pr &amp;lt;project_folder&amp;gt;/Release respectively.&lt;br /&gt;
&lt;br /&gt;
==== Semihosting ====&lt;br /&gt;
&lt;br /&gt;
http://infocenter.arm.com/help/index.jsp?topic=/com.arm.doc.dui0471c/Bgbjjgij.html:&lt;br /&gt;
&amp;lt;blockquote&amp;gt;&lt;br /&gt;
What is semihosting?&lt;br /&gt;
&lt;br /&gt;
Semihosting is a mechanism that enables code running on an ARM target to communicate and use the Input/Output facilities on a host computer that is running a debugger.&lt;br /&gt;
&lt;br /&gt;
Examples of these facilities include keyboard input, screen output, and disk I/O.&lt;br /&gt;
&amp;lt;/blockquote&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The GNU ARM Eclipse plugin comes with a really bare-bone implementation of some semihosting print functions that can be used to print logs to the console right in Eclipse (over GDB, without using any additional serial/UART connection whatsoever).&lt;br /&gt;
&lt;br /&gt;
Since I&#039;d always create a project without Semihosting enabled in the GNU ARM Eclipse wizard, you can still easily enable it later on:&lt;br /&gt;
&lt;br /&gt;
The easiest way I&#039;ve found so far, is by defining those Preprocessor constants in the C/C++ Project settings (Projects &amp;gt; Properties &amp;gt; C/C++ Build &amp;gt; Settings &amp;gt; Cross ARM GNU C/C++ Compiler &amp;gt; Preprocessor):&lt;br /&gt;
* TRACE&lt;br /&gt;
* OS_USE_TRACE_SEMIHOSTING_STDOUT&lt;br /&gt;
&lt;br /&gt;
And then, by using the following function calls in your code to log stuff to the Eclipse console right away:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
trace_initialize(); // in fact not required&lt;br /&gt;
// (...)&lt;br /&gt;
static int i = 0;&lt;br /&gt;
trace_puts( &amp;quot;hello&amp;quot; );&lt;br /&gt;
trace_printf( &amp;quot;nr %d\n&amp;quot;, i++ );&lt;br /&gt;
HAL_Delay( 1000 );  &lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
These functions were implemented by the author of GNU ARM Eclipse [https://github.com/ilg-ul Liviu Ionescu], and can be looked up in these files:&lt;br /&gt;
* &amp;lt;eclipse_project&amp;gt;/system/include/arm/semihosting.h&lt;br /&gt;
* &amp;lt;eclipse_project&amp;gt;/system/include/diag/Trace.h&lt;br /&gt;
* &amp;lt;eclipse_project&amp;gt;/system/src/diag/Trace.c&lt;br /&gt;
* &amp;lt;eclipse_project&amp;gt;/system/src/diag/trace_impl.c&lt;br /&gt;
&lt;br /&gt;
An interesting comment in &#039;&#039;trace_impl.c:133&#039;&#039; says:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
// Semihosting is the other output channel that can be used for the trace&lt;br /&gt;
// messages. It comes in two flavours: STDOUT and DEBUG. The STDOUT channel&lt;br /&gt;
// is the equivalent of the stdout in POSIX and in most cases it is forwarded&lt;br /&gt;
// to the GDB server stdout stream. The debug channel is a separate&lt;br /&gt;
// channel. STDOUT is buffered, so nothing is displayed until a \n;&lt;br /&gt;
// DEBUG is not buffered, but can be slow.&lt;br /&gt;
//&lt;br /&gt;
// Choosing between semihosting stdout and debug depends on the capabilities&lt;br /&gt;
// of your GDB server, and also on specific needs. It is recommended to test&lt;br /&gt;
// DEBUG first, and if too slow, try STDOUT.&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Note that semihosting needs to be enabled in your Eclipse run configuration (it is by default), in the Startup tab &amp;gt; Enable ARM semihosting. This will tell GDB to use semihosting. Without enabling, calls to those trace_* functions will throw some kind of exception... and make the processor halt. I couldn&#039;t find out much yet about how this feature really works, somehow it uses a special BKPT instruction...&lt;br /&gt;
&lt;br /&gt;
Semihosting (OS_USE_TRACE_SEMIHOSTING_STDOUT) can also be used in &amp;quot;Release&amp;quot; builds, since the semihosted calls don&#039;t rely on debug symbols.&lt;br /&gt;
&lt;br /&gt;
=== IDE: Code::Blocks ===&lt;br /&gt;
&lt;br /&gt;
My favorite cross-platform IDE for C/C++ is Code::Blocks. - And luckily, it also works well for ARM development! After twiddling around with those confusing Eclipse settings, I&#039;ve almost forgot to try out and setup Code::Blocks.&lt;br /&gt;
&lt;br /&gt;
The steps required are bit unintuitive, but building and debugging projects with full auto-complete and indexer support works now.&lt;br /&gt;
&lt;br /&gt;
The advantages over using Eclipse:&lt;br /&gt;
* Faster GUI.&lt;br /&gt;
* Works with STM32CubeMX generated code.&lt;br /&gt;
* Uses just a plain/manually editable Makefile to build the project.&lt;br /&gt;
* Familiar C/C++ settings and more *transparent* project handling -&amp;gt; Edit + debug. Nothing more. Everything can be done by hand on a console too. No mysterious hidden helpers...&lt;br /&gt;
&lt;br /&gt;
I&#039;m still evaluating this workflow... But to get things up and running, you can do this:&lt;br /&gt;
&lt;br /&gt;
(Assuming you already have a working Makefile based project, e.g. [http://wiki.sgmk-ssam.ch/wiki/STM32_dev#STM32CubeMX_to_Makefile created with STM32CubeMX, like described above]).&lt;br /&gt;
&lt;br /&gt;
* Open Code::Blocks and create an &#039;&#039;&#039;empty&#039;&#039;&#039; project (&#039;&#039;File &amp;gt; New &amp;gt; Project &amp;gt; Empty project&#039;&#039;).&lt;br /&gt;
* Give it a name in the Wizard, and choose the &#039;&#039;GNU GCC Compiler for ARM&#039;&#039;, and save it. &lt;br /&gt;
* Copy all content of the Makefile project over to Code::Blocks project folder.&lt;br /&gt;
* Import all required source files into the Code::Blocks workspace (right click -&amp;gt; &#039;&#039;Add files recursively...&#039;&#039;). &lt;br /&gt;
* Check &#039;&#039;Project &amp;gt; Properties &amp;gt; Project settings &amp;gt; Makefile: This is a custom Makefile&#039;&#039;.&lt;br /&gt;
* Adjust the build settings in &#039;&#039;Project &amp;gt; Build options &amp;gt; &amp;quot;Make commands&amp;quot;&#039;&#039;. - This might either require you to change the Makefile (i.e. add Debug/Release targets), or the commands. - For simplicity&#039;s sake, just ignore those $make, $makefile variables and overwrite them with your actual commands (i.e.&#039;&#039;$make -f $makefile $target&#039;&#039; -&amp;gt; &#039;&#039;make all&#039;&#039;).&lt;br /&gt;
* &#039;&#039;Build&#039;&#039; the project and check in the &#039;&#039;Build log&#039;&#039; if there where any errors/warnings.&lt;br /&gt;
&lt;br /&gt;
So, if this is working now, try to edit a source file and see if those really useful auto-complete and jump to declaration/implementation features are working. - One caveat of using an external Makefile is that the IDE doesn&#039;t know the current settings. So, for example, #defines are not available, and syntax highlighting will not update automatically... So it might be worth it add settings manually at some point.&lt;br /&gt;
&lt;br /&gt;
Now, to get the flashing and debugging working, try this:&lt;br /&gt;
&lt;br /&gt;
* Go to the &#039;&#039;Settings &amp;gt; Debugger&#039;&#039; Settings.&lt;br /&gt;
* Add a new GDB debugger setting (hit &#039;&#039;Create Config&#039;&#039; and call it &#039;&#039;ARM OpenOCD&#039;&#039; for example).&lt;br /&gt;
* Change the &#039;&#039;Executable path&#039;&#039; according to your toolchains location, and check &#039;Do *not* run the debugee&#039;.&lt;br /&gt;
* Go to &#039;&#039;Projects &amp;gt; Properties &amp;gt; Debugger&#039;&#039;.&lt;br /&gt;
** Change the &amp;lt;Project&amp;gt; &#039;&#039;Remote connection&#039;&#039; settings to IP: 127.0.0.1 / Port: 3333.&lt;br /&gt;
** Go to the &amp;lt;Project&amp;gt; &#039;&#039;Additional GDB commands&#039;&#039; tab. And enter those commands into the &#039;&#039;After connection&#039;&#039; box (change filename!):&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
monitor halt&lt;br /&gt;
load ./build/test.elf&lt;br /&gt;
file ./build/test.elf&lt;br /&gt;
monitor sleep 1000&lt;br /&gt;
monitor reset&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
To not run the program automatically, remove the last two commands. Then you need to &#039;&#039;Start / Continue&#039;&#039; the program twice, but you&#039;ll catch the first breakpoint you&#039;ve set!&lt;br /&gt;
* Choose &#039;&#039;Debug &amp;gt; Active Debuggers &amp;gt; GDB/CDB Debugger: ARM OpenOCD&#039;&#039;.&lt;br /&gt;
* Start OpenOCD in a terminal. (Described above).&lt;br /&gt;
* Start debugging by pressing the red arrow (Run / continue) in the debugging toolbar.&lt;br /&gt;
&lt;br /&gt;
The steps are the same as the ones in [http://www.hackvandedam.nl/blog/?p=707 this tutorial &#039;&#039;&#039;with screenshots&#039;&#039;&#039;].&lt;br /&gt;
&lt;br /&gt;
=== stlink ===&lt;br /&gt;
&lt;br /&gt;
[https://github.com/texane/stlink stlink] is a command line tool for programming, inspecting and debugging the STM32 microcontrollers. It also used internally by OpenOCD (I think). - It comes with several small programs (st-flash, st-info, st-term, st-util) that can come in handy while working with the STM32 micros.&lt;br /&gt;
&lt;br /&gt;
There&#039;s a tutorial:&lt;br /&gt;
https://github.com/texane/stlink/blob/master/doc/tutorial/tutorial.pdf&lt;br /&gt;
&lt;br /&gt;
Some useful things I&#039;ve discovered:&lt;br /&gt;
&lt;br /&gt;
Just run st-util can Ctrl-C again to see all relevant uC properties:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
$ st-util&lt;br /&gt;
2016-01-29T13:06:25 INFO src/stlink-common.c: Loading device parameters....&lt;br /&gt;
2016-01-29T13:06:25 INFO src/stlink-common.c: Device connected is: F07x device, id 0x20016448&lt;br /&gt;
2016-01-29T13:06:25 INFO src/stlink-common.c: SRAM size: 0x4000 bytes (16 KiB), Flash: 0x10000 bytes (64 KiB) in pages of 2048 bytes&lt;br /&gt;
2016-01-29T13:06:25 INFO gdbserver/gdb-server.c: Chip ID is 00000448, Core ID is  0bb11477.&lt;br /&gt;
2016-01-29T13:06:25 INFO gdbserver/gdb-server.c: Target voltage is 3554 mV.&lt;br /&gt;
2016-01-29T13:06:25 INFO gdbserver/gdb-server.c: Listening at *:4242...&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Or with st-info:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
$ st-info &lt;br /&gt;
st-info --flash&lt;br /&gt;
st-info --sram&lt;br /&gt;
st-info --descr&lt;br /&gt;
st-info --pagesize&lt;br /&gt;
st-info --chipid&lt;br /&gt;
$ st-info --flash&lt;br /&gt;
0x10000&lt;br /&gt;
$ st-info --sram&lt;br /&gt;
0x4000&lt;br /&gt;
$ st-info --descr&lt;br /&gt;
F07x device&lt;br /&gt;
$ st-info --pagesize&lt;br /&gt;
0x800&lt;br /&gt;
$ st-info --chipid&lt;br /&gt;
0x0448&lt;br /&gt;
&lt;br /&gt;
$ echo `st-info --sram | xargs -I@ printf &amp;quot;%d/1024\n&amp;quot; @ | bc`kB RAM&lt;br /&gt;
16kB RAM&lt;br /&gt;
$ echo `st-info --flash | xargs -I@ printf &amp;quot;%d/1024\n&amp;quot; @ | bc`kB FLASH&lt;br /&gt;
64kB FLASH&lt;br /&gt;
&lt;br /&gt;
$ for a in sram flash pagesize; do echo `st-info --$a | xargs -I@ printf &amp;quot;%d/1024\n&amp;quot; @ | bc`kb $a; done&lt;br /&gt;
16kb sram&lt;br /&gt;
64kb flash&lt;br /&gt;
2kb pagesize&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Or simply:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
$ st-info --probe&lt;br /&gt;
Found 1 stlink programmers&lt;br /&gt;
 serial: 303030303030303030303031&lt;br /&gt;
openocd: &amp;quot;\x30\x30\x30\x30\x30\x30\x30\x30\x30\x30\x30\x31&amp;quot;&lt;br /&gt;
  flash: 131072 (pagesize: 256)&lt;br /&gt;
   sram: 16384&lt;br /&gt;
 chipid: 0x0416&lt;br /&gt;
  descr: L1 Med-density device&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Links ===&lt;br /&gt;
&lt;br /&gt;
==== Tools ====&lt;br /&gt;
* [https://gnuarmeclipse.github.io/ GNU ARM Eclipse]: [https://gnuarmeclipse.github.io/eclipse/workspace/preferences/ workspace_preferences], [http://gnuarmeclipse.github.io/toolchain/path/ toolchain_path], [http://gnuarmeclipse.github.io/eclipse/project/portability/ project_portability]&lt;br /&gt;
&lt;br /&gt;
==== Tutorials ====&lt;br /&gt;
* Great introduction: [http://www.triplespark.net/elec/pdev/arm/stm32.html Programming STM32 F2, F4 ARMs under Linux: A Tutorial from Scratch]&lt;br /&gt;
* STM32Cube to GNU ARM Eclipse tips: http://www.carminenoviello.com/en/2015/06/04/stm32-applications-eclipse-gcc-stcube/&lt;br /&gt;
* Micro Python on STM32F4-Discovery: http://gpio.kaltpost.de/?p=2082&lt;br /&gt;
* Logs: https://hackaday.io/project/4277/logs?page=2&lt;br /&gt;
* Code::Blocks tutorial: http://www.hackvandedam.nl/blog/?p=707&lt;br /&gt;
* Eclipse tutorial: http://www.carminenoviello.com/en/2015/06/04/stm32-applications-eclipse-gcc-stcube&lt;br /&gt;
* http://sigalrm.blogspot.ch/2013/12/using-ccm-memory-on-stm32.html&lt;br /&gt;
* http://stm32f4-discovery.com/2014/08/stm32f4-external-interrupts-tutorial/&lt;br /&gt;
* ...&lt;br /&gt;
&lt;br /&gt;
==== Projects / Demos / Code ====&lt;br /&gt;
* MrBlueXav&#039;s Synths: https://github.com/MrBlueXav&lt;br /&gt;
* cliffle&#039;s VGA stuff: https://github.com/cbiffle/m4vgalib-demos, http://cliffle.com/article/2015/06/05/introducing-glitch/&lt;br /&gt;
* ESPruino code: https://github.com/espruino/Espruino -&amp;gt; STM32F401CDU6&lt;br /&gt;
* STM32F4 Audio Codec Board: http://ebrombaugh.studionebula.com/synth/stm32f4_codec/&lt;br /&gt;
* ESPRUINO: http://www.espruino.com/ReferenceSTM32F4DISCOVERY&lt;br /&gt;
* micropython: https://github.com/micropython/micropython&lt;br /&gt;
* STM32F4 DIY: http://mikrocontroller.bplaced.net/wordpress/?page_id=1482&lt;br /&gt;
* STM32F4 overclocking: http://sigalrm.blogspot.ch/2014/01/overclocking-stm32f4.html&lt;br /&gt;
* thermal camera: http://www.theresistornetwork.com/2014/11/flir-lepton-thermal-imaging-sensor.html&lt;br /&gt;
* STM32F7: http://hackaday.com/2015/06/26/new-part-day-stm32f7-an-arm-cortex-m7/&lt;br /&gt;
* Karsten Schmidt: http://workshop.thi.ng/ [https://soundcloud.com/forthcharlie soundcloud] https://github.com/thi-ng/ws-ldn-4 https://github.com/thi-ng/ws-ldn-3 http://asm.thi.ng/&lt;br /&gt;
* Peridrummmm Demo: http://www.pouet.net/prod.php?which=59095 with sources: http://aka-san.halcy.de/revision2012/peridiummmm-src.zip&lt;br /&gt;
* Andy&#039;s Workshop: http://andybrown.me.uk/&lt;br /&gt;
* axoloti: http://axoloti.com/&lt;br /&gt;
&lt;br /&gt;
==== Libraries ====&lt;br /&gt;
* libopencm3 http://libopencm3.org/wiki/Main_Page&lt;br /&gt;
* list of libs: http://mikrocontroller.bplaced.net/wordpress/?page_id=2736&lt;br /&gt;
&lt;br /&gt;
==== OS ====&lt;br /&gt;
* FreeRTOS: http://www.freertos.org/index.html&lt;br /&gt;
* Embedded Linux on STM32: https://github.com/EmcraftSystems&lt;br /&gt;
* ChibiOS: http://www.chibios.org/dokuwiki/&lt;br /&gt;
* Zephyr Project: http://zephyrproject.org/&lt;br /&gt;
&lt;br /&gt;
==== General ====&lt;br /&gt;
* ARM Related Books: http://www.arm.com/support/resources/arm-books/&lt;br /&gt;
* STM32 Overview http://www.st.com/web/en/catalog/mmc/FM141/SC1169?sc=stm32&lt;br /&gt;
* mbed https://en.wikipedia.org/wiki/Mbed&lt;br /&gt;
* CMSIS: http://www.keil.com/pack/doc/cmsis/Core/html/index.html&lt;br /&gt;
&lt;br /&gt;
== Hardware ==&lt;br /&gt;
&lt;br /&gt;
All about hardware and hardware tools for STM32 dev. Chips, programmers etc.&lt;br /&gt;
&lt;br /&gt;
=== ST-Link V2 Programmer ===&lt;br /&gt;
&lt;br /&gt;
There are two popular ST-Link V2 Progammers on the market. They have a different pinout but work both well like described above.&lt;br /&gt;
&lt;br /&gt;
[[File:ST-LinkV2_pinout_01.jpg]]&lt;br /&gt;
&lt;br /&gt;
Alternatively, STM32Discovery/[http://jeelabs.org/book/1547a/index.html Nucleo boards too can be used as SWD programmers].&lt;br /&gt;
&lt;br /&gt;
Luckily, only 4 pins have to be used to program and debug the target!&lt;br /&gt;
To find out more about this protocol, have a look into [http://www.arm.com/products/system-ip/debug-trace/coresight-soc-components/serial-wire-debug.php Serial Debug Wire (SWD)] as an alternative to JTAG.&lt;br /&gt;
&lt;br /&gt;
Connect to following pins of the programmer to the corresponding pins on the PCB:&lt;br /&gt;
&lt;br /&gt;
* V3V&lt;br /&gt;
* GND&lt;br /&gt;
* SWCLK&lt;br /&gt;
* SWDIO&lt;br /&gt;
&lt;br /&gt;
-&amp;gt; NRST can be important too on some STM32 chips!&lt;br /&gt;
&lt;br /&gt;
Remember: These are &#039;&#039;&#039;not&#039;&#039;&#039; the [http://www.st.com/web/catalog/tools/FM146/CL1984/SC724/SS1677/PF251168 official ST-Link V2 Programmers], sold by ST.&lt;br /&gt;
&lt;br /&gt;
== Projects ==&lt;br /&gt;
&lt;br /&gt;
STM32 based projects.&lt;br /&gt;
&lt;br /&gt;
=== STM32basic ===&lt;br /&gt;
&lt;br /&gt;
STM32basic is a test board to see how STM32 chips can be used in DIY circuits.&lt;br /&gt;
&lt;br /&gt;
==== STM32basic rev0.01 ====&lt;br /&gt;
&lt;br /&gt;
An initial list of tests:&lt;br /&gt;
&lt;br /&gt;
* JTAG: See how we can program the thing. Do we need all JTAG pins? Or only the SWD pins? What about reset? - Do the cheapo Chinese STLink V2 programmer really work?&lt;br /&gt;
* Basic I/O: LED and push button.&lt;br /&gt;
* U(S)ART: Check whether it&#039;s possible to hook up an FTDI to send/receive characters to/from the STM32basic?&lt;br /&gt;
* BOOT0/1: What about those boot modes?&lt;br /&gt;
* Power Usage : 3V3 Regulator: ..&lt;br /&gt;
&lt;br /&gt;
[[File:STM32basic_pcb1b.jpg]]&lt;br /&gt;
&lt;br /&gt;
Board at OSH Park:&amp;lt;br /&amp;gt;&lt;br /&gt;
https://oshpark.com/shared_projects/kCD7Yr0A&lt;br /&gt;
&lt;br /&gt;
KiCad project and everything else:&amp;lt;br /&amp;gt;&lt;br /&gt;
Remark: this has been made in hurry and is just a test:&amp;lt;br /&amp;gt;&lt;br /&gt;
http://0rel.com/prj/STM32basic/STM32basic_rev0.01.zip&lt;br /&gt;
&lt;br /&gt;
[[File:Stm32basic1.jpg]]&lt;br /&gt;
&lt;br /&gt;
So far, the tests have been working ok.&lt;br /&gt;
&lt;br /&gt;
* STLink V2 programmers seem to work fine, and only require 2 pins + VCC/GND! SWDIO and SWCLK, that&#039;s it! For programming and on-chip debugging.&lt;br /&gt;
* I/O works as well. External interrupts can be configured.&lt;br /&gt;
* UART works, but I have not yet tested it with a proper code. It was working with some echo snippet I&#039;ve found somewhere.&lt;br /&gt;
* Power usage is low. ~15 mA at 3.3 V.&lt;br /&gt;
* BOOT0 jumper has to be set (connected to ground) in order to run code... - Other boot modes have not been tested yet. More tests are needed there... What are the other available boot modes, what about those built-in boot loaders?&lt;br /&gt;
&lt;br /&gt;
However, the board has several flaws:&lt;br /&gt;
* 1.27 mm pin-pitch headers cannot be arranged like that (GPIOs). They need to be further apart to make sockets/headers fit.&lt;br /&gt;
* 3V3 LDO doesn&#039;t make much sense like this. Add add a buck/boost converter. Also remove 5V label.&lt;br /&gt;
* This BOOT0 jumper isn&#039;t nice like this...&lt;br /&gt;
* Remove unnecessary JTAG pins. SWD only.&lt;br /&gt;
* Remove unnecessary USART pins.&lt;br /&gt;
* Add crystal.&lt;br /&gt;
* Add USB plug.&lt;br /&gt;
&lt;br /&gt;
Probably, this will not be remade, since it was enough for a test. I&#039;d like to make a very basic USB touch device next.&lt;br /&gt;
&lt;br /&gt;
==== STM32basic Eclipse project ====&lt;br /&gt;
&lt;br /&gt;
Test project to see if GPIOs with External interrupts and semi hosting works. Sloppy and not cleaned up yet...&amp;lt;br /&amp;gt;&lt;br /&gt;
http://0rel.com/prj/STM32basic/testSTM32F072_interrupt_test0.zip&lt;br /&gt;
&lt;br /&gt;
Note: Eclipse projects can be imported in an existing or new workspace with: &#039;&#039;File &amp;gt; Import &amp;gt; General &amp;gt; Existing Projects into Workspace&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
=== todo ===&lt;br /&gt;
&lt;br /&gt;
* I2C peripherals&lt;br /&gt;
* I2S peripherals&lt;br /&gt;
* SPI peripherals&lt;br /&gt;
* touch&lt;br /&gt;
* usb&lt;br /&gt;
* external memory (sram, flash, eeprom...) -&amp;gt; RTOS / Linux / ChibiOS? (similar to this http://hforsten.com/making-embedded-linux-computer.html)?&lt;br /&gt;
.....&lt;/div&gt;</summary>
		<author><name>0rel</name></author>
	</entry>
	<entry>
		<id>https://wiki.sgmk-ssam.ch/index.php?title=Projects&amp;diff=6601</id>
		<title>Projects</title>
		<link rel="alternate" type="text/html" href="https://wiki.sgmk-ssam.ch/index.php?title=Projects&amp;diff=6601"/>
		<updated>2016-11-14T16:41:50Z</updated>

		<summary type="html">&lt;p&gt;0rel: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== [[Motörheadz]] ==&lt;br /&gt;
&lt;br /&gt;
== [[BalanZBot]] ==&lt;br /&gt;
&lt;br /&gt;
== [[MicMacMC]] ==&lt;br /&gt;
&lt;br /&gt;
== [[IoT Clock]] ==&lt;br /&gt;
That blinky thing hanging over the door now.&lt;br /&gt;
&lt;br /&gt;
Teh control webapp.&lt;br /&gt;
https://iot-clock2.appspot.com/&lt;br /&gt;
&lt;br /&gt;
== [[Arduino Uno R3 as HID]] ==&lt;br /&gt;
Turning the Arduino UNO R3 into a HID is very easy. But the documentation on the web just sucks. Get the recipe here at SGMK.&lt;br /&gt;
&lt;br /&gt;
== [[Elektronisches Heimatwerk Luzern 28.2.-10.3.2013]] ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== [[Workshopology]] ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== [[WatchOut]] ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== [[Thermal IR-Camera]] ==&lt;br /&gt;
&lt;br /&gt;
[[File:ThermalCam_PD.png|320px]]&lt;br /&gt;
&lt;br /&gt;
== [[STM32 dev]] ==&lt;br /&gt;
[[File:Stm32pcb1d.jpg]]&lt;br /&gt;
&lt;br /&gt;
== [[SolarRC]] ==&lt;br /&gt;
&lt;br /&gt;
== [[SGMKmorseAttacks]] ==&lt;br /&gt;
&lt;br /&gt;
[[File:P1080620.JPG|320px]]&lt;br /&gt;
&lt;br /&gt;
== [[CyberDudelsack]] ==&lt;br /&gt;
&lt;br /&gt;
== [[SGMKtiny]] ==&lt;br /&gt;
&lt;br /&gt;
== [[SGMKduino]] ==&lt;br /&gt;
&lt;br /&gt;
[[File:SGMKduino_v3_web.png|320px]]&lt;br /&gt;
&lt;br /&gt;
== [[Gnusbuino]] ==&lt;br /&gt;
[[File:Gnusbuino_pcb.gif]]&lt;br /&gt;
&lt;br /&gt;
The Gnusbuino is an adaption of Michael Egger&#039;s gnusb that is (more or less) compatible with the Arduino environment.&lt;br /&gt;
It uses the V-USB virtual USB driver from obdev.at instead of a dedicated USB chip (FTDI on the Arduino) - is thus a lot easier and cheaper to build oneself - very few components, single sided PCB…&lt;br /&gt;
It has a bootloader and can programmed directly through USB. It can mimic many devices (like the USBasp AVR programmer or a standard USB-MIDI interface). &lt;br /&gt;
&lt;br /&gt;
Offspring:&lt;br /&gt;
*[[Midignusbuino]] - Arduino compatible USB-MIDI controller / interface&lt;br /&gt;
*[[Babygnusbuino]] - ridiculously small bare-bones Arduino&lt;br /&gt;
* [https://github.com/mirdej/gnusbuino/tree/gnusbuino88 Gnusbuino88] Atmega88 version&lt;br /&gt;
*[[Babygnusbuino-v2]] - more free pins on already ridiculously small bare-bones Arduino&lt;br /&gt;
* [[Babymidimultiplexgnusbuino]] - 8 channel MIDI controller&lt;br /&gt;
* [[8bit Mix Tape]] &lt;br /&gt;
[[File:Babygnusbuino.jpg|400px]]&lt;br /&gt;
&lt;br /&gt;
== [[Postduino]] and related Fantasies ==&lt;br /&gt;
&lt;br /&gt;
Discussions at the anyma research week 2014, after hours and hours of discussions, late night fights and yelling, nightmares and fantasies about what comes after the arduino.... cheap, simple, easy to make? or next level shit using arm-processors? more pins / less pins? fuck attiny85 forever? what about the 32u4 chip? or just buy the [http://arduino.cc/en/Main/arduinoBoardMicro arduino micro]? or should we just use the [[Gnusbuino]], as we always had? or what about that Atmega88 chip? or, or, or, or,...&lt;br /&gt;
&lt;br /&gt;
== [[8bit Mix Tape]] ==&lt;br /&gt;
[[File:8bit_mixedTapev02.jpg|left|400px]] {{#widget:Vimeo|id=58727965}}&lt;br /&gt;
&lt;br /&gt;
The 8bit MixTape is an arduino compatible sound gadget, based on the BabyGnusbuino ([http://www.anyma.ch/blogs/research/ anyma]) and [http://youtube.com/watch?v=GtQdIYUtAHg Viznut&#039;s &amp;quot;Algorithmic symphonies from one line of code&amp;quot;], put together by dusjagr, [http://lifepatch.org/ ucok] and iyok...&lt;br /&gt;
&lt;br /&gt;
New version, v0.2, nicely fits into a tape, with battery, USB programming interface, LEDs and a button to choose different codes.&lt;br /&gt;
&lt;br /&gt;
links:&lt;br /&gt;
http://youtube.com/watch?v=GtQdIYUtAHg&lt;br /&gt;
http://wurstcaptures.untergrund.net/music/&lt;br /&gt;
http://wiki.sgmk-ssam.ch/index.php/Babygnusbuino&lt;br /&gt;
&lt;br /&gt;
== [[DIY Micro Laser Cutter]] ==&lt;br /&gt;
&lt;br /&gt;
Step by Step Instruction for building your DIY Laser Cutter.&lt;br /&gt;
&lt;br /&gt;
== little cutie code snippets ==&lt;br /&gt;
* [[tone sweep arduino]] combine with a maotor driver or mosfet for speakers + maizena&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== [[20_pix display]] ==&lt;br /&gt;
&lt;br /&gt;
{{#widget:Vimeo|id=10895002}}&lt;br /&gt;
&lt;br /&gt;
[[Category:Projects]]&lt;br /&gt;
&lt;br /&gt;
== [[Vive la Resistance aka NanoSmano Sajica]] ==&lt;br /&gt;
&lt;br /&gt;
[[File:sajica_circuit.jpg|320px]]&lt;br /&gt;
&lt;br /&gt;
== [[Shruti Hacking  - Radel Nano Dx]] ==&lt;br /&gt;
Instruction on how to digitally hack the legendary Indian musical instruments by Radel. Radel Electronics Pvt. Ltd. is the pioneer in the field of electronic musical instruments for Indian music. &amp;lt;br&amp;gt;&lt;br /&gt;
[[File:shruti_hack.jpg|140px]]&lt;br /&gt;
&lt;br /&gt;
== [[microRing]] ==&lt;br /&gt;
&lt;br /&gt;
The Idea is to generate two squarewaves with two NAND-Gatters of a 4093 IC and use the other two NAND as an XOR stage. The two waveforms are then send as inputs to the XOR and we have a Ring Modulation. Best of it, it&#039;s all on just one 4093. The additional parts are also very easy.&lt;br /&gt;
&lt;br /&gt;
== [[microNAND]] ==&lt;br /&gt;
&lt;br /&gt;
This Circuit is the result of the first try to build the microRing described above. Due to some misonceptions, this circuit is not a ring modulator, but nevertheless sounds great. So i leave this stuff on.&lt;br /&gt;
&lt;br /&gt;
{{#widget:Vimeo|id=72336145}}&lt;br /&gt;
&lt;br /&gt;
== [[micronoise pro]] ==&lt;br /&gt;
&lt;br /&gt;
the micronoise pro is a further development of the original micronoise. it uses all 4 NAND gates of the 4093 chip.&lt;br /&gt;
&lt;br /&gt;
[[File:micronoise_pro.jpg|300px]]&lt;br /&gt;
&lt;br /&gt;
== [[8step sequencer]] ==&lt;br /&gt;
&lt;br /&gt;
some designs of simple 8step sequencers based on the 4022 chip&lt;br /&gt;
&lt;br /&gt;
[[File:Modula_seq_small.jpg|300px]]&lt;br /&gt;
&lt;br /&gt;
== [[SinkDriverArduinoShield]] ==&lt;br /&gt;
&lt;br /&gt;
[[File:ArduinoPOWERshield-1.jpg]]&lt;br /&gt;
&lt;br /&gt;
== [[CapSense (QTouchADC)]] ==&lt;br /&gt;
&lt;br /&gt;
== [[Fermento Mods]] ==&lt;br /&gt;
&lt;br /&gt;
== Masken ==&lt;br /&gt;
&lt;br /&gt;
=== micro_noise Collector&#039;s edition ===&lt;br /&gt;
&lt;br /&gt;
[[File:mask_engl.png|150px]][[File:mask_hindi.png|150px]]&lt;br /&gt;
&lt;br /&gt;
[[File:maske_collectors_12x.pdf]]&lt;br /&gt;
&lt;br /&gt;
=== BitBadge ===&lt;br /&gt;
&lt;br /&gt;
[[File:BitBadge_2014.pdf]]&lt;br /&gt;
&lt;br /&gt;
[[Category:Projects]]&lt;br /&gt;
&lt;br /&gt;
== Bits&amp;amp;Bytes ==&lt;br /&gt;
&lt;br /&gt;
[[processingDataDDisplay]]&lt;br /&gt;
&lt;br /&gt;
== [[EtchingBox]] ==&lt;br /&gt;
A mobile PCB etching station&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== [[Dual TBridge Percussion]] ==&lt;br /&gt;
&lt;br /&gt;
Dual Electronic Percussion based on the TBridge Circuit&lt;br /&gt;
&lt;br /&gt;
[[File:dualTbridge.JPG|300px]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== [[cappaddy]] ==&lt;br /&gt;
[[File:cappaddy_DSCN1111.JPG]]&lt;br /&gt;
&lt;br /&gt;
== [[rawcoco]] ==&lt;br /&gt;
[[File:rawcoco_DSCN0342.JPG]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== [[CocoTeens7 - Hit The Tune]] ==&lt;br /&gt;
[[File:CocoTeens7_HitTheTune_front.jpg|400px]]&lt;br /&gt;
&lt;br /&gt;
== [[Shenzhen Ready]] ==&lt;br /&gt;
[[File:IMG_20160518_102335.jpg|400px]]&lt;br /&gt;
&lt;br /&gt;
== [[Electronic Voodoo Doll Advanced]] ==&lt;br /&gt;
[[File:voodoo.jpg|400px]]&lt;br /&gt;
&lt;br /&gt;
== [[Simple Theremin]] ==&lt;br /&gt;
[[File:Simple_theremin_case.jpg|400px]]&lt;br /&gt;
&lt;br /&gt;
== [[LDR - Cell Phone Door Opener]] ==&lt;br /&gt;
[[File:DoorOpener.jpg|400px]]&lt;br /&gt;
&lt;br /&gt;
== [[simple soap]] ==&lt;br /&gt;
&lt;br /&gt;
== [[PAMAMP]] ==&lt;br /&gt;
[[File:Pamamp rev0.02 pic 00a.png|400px]]&lt;/div&gt;</summary>
		<author><name>0rel</name></author>
	</entry>
	<entry>
		<id>https://wiki.sgmk-ssam.ch/index.php?title=PAMAMP&amp;diff=6600</id>
		<title>PAMAMP</title>
		<link rel="alternate" type="text/html" href="https://wiki.sgmk-ssam.ch/index.php?title=PAMAMP&amp;diff=6600"/>
		<updated>2016-11-14T16:32:36Z</updated>

		<summary type="html">&lt;p&gt;0rel: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;=== pamamp ===&lt;br /&gt;
&lt;br /&gt;
The [http://www.diodes.com/_files/datasheets/PAM8403.pdf PAM8403] is great little class-D stereo amplifier (3 W). Compared to the classic [http://www.ti.com/lit/ds/symlink/lm386.pdf LM386] it is much more efficient to use in a battery powered portable project, since it is class-D.&lt;br /&gt;
&lt;br /&gt;
You can find very cheap, ready-to-use boards on Ebay or AliExpress, with or without a volume pot. Or design your own with the temporary KiCAD design below, and integrate it into your own projects...&lt;br /&gt;
&lt;br /&gt;
There are also other variants of this amplifier IC:&lt;br /&gt;
* [http://www.diodes.com/_files/datasheets/PAM8302A.pdf PAM8302A (mono, 2.5 W, QFN package available)]&lt;br /&gt;
* [http://www.diodes.com/_files/datasheets/PAM8404.pdf PAM8404 (stereo, 3W, QFN package available)]&lt;br /&gt;
* [http://www.diodes.com/_files/datasheets/PAM8620.pdf PAM8620 (stereo, more power (15 W))]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== KiCAD Project ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[http://0rel.com/prj/pamamp/pamamp_rev0.02_local.zip pamamp_rev0.02_local.zip]&lt;br /&gt;
&lt;br /&gt;
Hint: To open the project with the local 3d models, you can start KiCAD with run.sh in the project directory.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:pamamp_rev0.02_pic_00a.png|600px]] [[File:pamamp_rev0.02_pic_01a.png|600px]]&lt;br /&gt;
&lt;br /&gt;
[[File:pamamp_rev0.02_schematics_00a.png]]&lt;br /&gt;
&lt;br /&gt;
[http://0rel.com/prj/pamamp/pamamp_rev0.02.pdf schematics pdf]&lt;/div&gt;</summary>
		<author><name>0rel</name></author>
	</entry>
	<entry>
		<id>https://wiki.sgmk-ssam.ch/index.php?title=PAMAMP&amp;diff=6599</id>
		<title>PAMAMP</title>
		<link rel="alternate" type="text/html" href="https://wiki.sgmk-ssam.ch/index.php?title=PAMAMP&amp;diff=6599"/>
		<updated>2016-11-14T16:29:04Z</updated>

		<summary type="html">&lt;p&gt;0rel: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;=== pamamp ===&lt;br /&gt;
&lt;br /&gt;
The [http://www.diodes.com/_files/datasheets/PAM8403.pdf PAM8403] is great little class-D stereo amplifier (3 W). Compared to the classic [http://www.ti.com/lit/ds/symlink/lm386.pdf LM386] it is much more efficient to use in a battery powered portable project, since it is class-D.&lt;br /&gt;
&lt;br /&gt;
You can find very cheap, ready-to-use boards on Ebay or AliExpress, with or without a volume pot. Or design your own board with the temporary KiCad design below, and integrate it into your own projects...&lt;br /&gt;
&lt;br /&gt;
There are also other variants of this amplifier IC:&lt;br /&gt;
* [http://www.diodes.com/_files/datasheets/PAM8302A.pdf PAM8302A (mono, 2.5 W, QFN package available)]&lt;br /&gt;
* [http://www.diodes.com/_files/datasheets/PAM8404.pdf PAM8404 (stereo, 3W, QFN package available)]&lt;br /&gt;
* [http://www.diodes.com/_files/datasheets/PAM8620.pdf PAM8620 (stereo, more power (15 W))]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== KiCad Project ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[http://0rel.com/prj/pamamp/pamamp_rev0.02_local.zip pamamp_rev0.02_local.zip]&lt;br /&gt;
&lt;br /&gt;
[[File:pamamp_rev0.02_pic_00a.png|600px]] [[File:pamamp_rev0.02_pic_01a.png|600px]]&lt;br /&gt;
&lt;br /&gt;
[[File:pamamp_rev0.02_schematics_00a.png]]&lt;br /&gt;
&lt;br /&gt;
[http://0rel.com/prj/pamamp/pamamp_rev0.02.pdf pamamp_rev0.02.pdf]&lt;/div&gt;</summary>
		<author><name>0rel</name></author>
	</entry>
	<entry>
		<id>https://wiki.sgmk-ssam.ch/index.php?title=File:Pamamp_rev0.02_schematics_00a.png&amp;diff=6598</id>
		<title>File:Pamamp rev0.02 schematics 00a.png</title>
		<link rel="alternate" type="text/html" href="https://wiki.sgmk-ssam.ch/index.php?title=File:Pamamp_rev0.02_schematics_00a.png&amp;diff=6598"/>
		<updated>2016-11-14T16:26:42Z</updated>

		<summary type="html">&lt;p&gt;0rel: File uploaded with MsUpload&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;File uploaded with MsUpload&lt;/div&gt;</summary>
		<author><name>0rel</name></author>
	</entry>
	<entry>
		<id>https://wiki.sgmk-ssam.ch/index.php?title=File:Pamamp_rev0.02_pic_01a.png&amp;diff=6597</id>
		<title>File:Pamamp rev0.02 pic 01a.png</title>
		<link rel="alternate" type="text/html" href="https://wiki.sgmk-ssam.ch/index.php?title=File:Pamamp_rev0.02_pic_01a.png&amp;diff=6597"/>
		<updated>2016-11-14T16:26:40Z</updated>

		<summary type="html">&lt;p&gt;0rel: File uploaded with MsUpload&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;File uploaded with MsUpload&lt;/div&gt;</summary>
		<author><name>0rel</name></author>
	</entry>
	<entry>
		<id>https://wiki.sgmk-ssam.ch/index.php?title=File:Pamamp_rev0.02_pic_00a.png&amp;diff=6596</id>
		<title>File:Pamamp rev0.02 pic 00a.png</title>
		<link rel="alternate" type="text/html" href="https://wiki.sgmk-ssam.ch/index.php?title=File:Pamamp_rev0.02_pic_00a.png&amp;diff=6596"/>
		<updated>2016-11-14T16:26:38Z</updated>

		<summary type="html">&lt;p&gt;0rel: File uploaded with MsUpload&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;File uploaded with MsUpload&lt;/div&gt;</summary>
		<author><name>0rel</name></author>
	</entry>
	<entry>
		<id>https://wiki.sgmk-ssam.ch/index.php?title=PAMAMP&amp;diff=6595</id>
		<title>PAMAMP</title>
		<link rel="alternate" type="text/html" href="https://wiki.sgmk-ssam.ch/index.php?title=PAMAMP&amp;diff=6595"/>
		<updated>2016-11-14T16:23:31Z</updated>

		<summary type="html">&lt;p&gt;0rel: Created page with &amp;quot;    === pamamp ===  The [http://www.diodes.com/_files/datasheets/PAM8403.pdf PAM8403] is great little class-D stereo amplifier (3 W). Compared to the classic LM386 it is much...&amp;quot;&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== pamamp ===&lt;br /&gt;
&lt;br /&gt;
The [http://www.diodes.com/_files/datasheets/PAM8403.pdf PAM8403] is great little class-D stereo amplifier (3 W). Compared to the classic LM386 it is much more efficient to use in a battery powered portable device, since it is class-D.&lt;br /&gt;
&lt;br /&gt;
You can find very cheap, ready-to-use boards on Ebay or AliExpress, with or without a volume pot. Or design your own board with the temporary KiCad design below, and integrate it into your own projects...&lt;br /&gt;
&lt;br /&gt;
There are also other variants of this amplifier IC:&lt;br /&gt;
* [http://www.diodes.com/_files/datasheets/PAM8302A.pdf PAM8302A (mono, 2.5 W, QFN package available)]&lt;br /&gt;
* [http://www.diodes.com/_files/datasheets/PAM8404.pdf PAM8404 (stereo, 3W, QFN package available)]&lt;br /&gt;
* [http://www.diodes.com/_files/datasheets/PAM8620.pdf PAM8620 (stereo, more power (15 W))]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== KiCad Project ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[http://0rel.com/prj/pamamp/pamamp_rev0.02_local.zip pamamp_rev0.02_local.zip]&lt;br /&gt;
&lt;br /&gt;
[[File:DSCN2247_600.jpg|400px]]&lt;/div&gt;</summary>
		<author><name>0rel</name></author>
	</entry>
	<entry>
		<id>https://wiki.sgmk-ssam.ch/index.php?title=Simple_soap&amp;diff=6594</id>
		<title>Simple soap</title>
		<link rel="alternate" type="text/html" href="https://wiki.sgmk-ssam.ch/index.php?title=Simple_soap&amp;diff=6594"/>
		<updated>2016-10-31T22:33:49Z</updated>

		<summary type="html">&lt;p&gt;0rel: /* Simple Soap */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
=== Simple Soap ===&lt;br /&gt;
&lt;br /&gt;
Got some [https://en.wikipedia.org/wiki/Lye NaOH] lye-ing around? That&#039;s all you need to make a simple [https://en.wikipedia.org/wiki/Lye_soap lye soap] with some FAT!&lt;br /&gt;
&lt;br /&gt;
== Ingredients ==&lt;br /&gt;
&lt;br /&gt;
* 30 g Coconut Oil (76 °C)&lt;br /&gt;
* 50 g Palm Oil&lt;br /&gt;
* 10 g Olive Oil&lt;br /&gt;
* 10 g Sunflower Oil&lt;br /&gt;
&lt;br /&gt;
* 38 g Water&lt;br /&gt;
* 14.6 - 15.5 g NaOH (-&amp;gt; 15 g for about 3% super fat)&lt;br /&gt;
&lt;br /&gt;
== Instructions ==&lt;br /&gt;
&lt;br /&gt;
1) Combine oils and heat gently. Let cool to 38 °C.&lt;br /&gt;
&lt;br /&gt;
2) Combine solid lye and water, stir well. Set aside and allow to cool (38 °C).&lt;br /&gt;
&lt;br /&gt;
3) Combine lye solution and melted oils. Stir until the mixture traces.&lt;br /&gt;
&lt;br /&gt;
4) Pour raw soap into prepared molds. Let it in the mold for at least 24 hours.&lt;br /&gt;
&lt;br /&gt;
5) Remove the soap from the molds, slice it into bars and let it cure for 4-8 weeks.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Result ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:DSCN2247_600.jpg|400px]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Theory ==&lt;br /&gt;
&lt;br /&gt;
In chemistry, [https://en.wikipedia.org/wiki/Soap a soap is a &#039;&#039;&#039;salt of a fatty acid&#039;&#039;&#039;.]&lt;br /&gt;
&lt;br /&gt;
[[File:NaStearate.png]]&lt;/div&gt;</summary>
		<author><name>0rel</name></author>
	</entry>
	<entry>
		<id>https://wiki.sgmk-ssam.ch/index.php?title=Simple_soap&amp;diff=6593</id>
		<title>Simple soap</title>
		<link rel="alternate" type="text/html" href="https://wiki.sgmk-ssam.ch/index.php?title=Simple_soap&amp;diff=6593"/>
		<updated>2016-10-31T20:02:38Z</updated>

		<summary type="html">&lt;p&gt;0rel: /* Ingredients: */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
=== Simple Soap ===&lt;br /&gt;
&lt;br /&gt;
Got some [https://en.wikipedia.org/wiki/Lye NaOH] lye-ing around? Enough to make a simple [https://en.wikipedia.org/wiki/Lye_soap lye soap] with only household materials.&lt;br /&gt;
&lt;br /&gt;
== Ingredients ==&lt;br /&gt;
&lt;br /&gt;
* 30 g Coconut Oil (76 °C)&lt;br /&gt;
* 50 g Palm Oil&lt;br /&gt;
* 10 g Olive Oil&lt;br /&gt;
* 10 g Sunflower Oil&lt;br /&gt;
&lt;br /&gt;
* 38 g Water&lt;br /&gt;
* 14.6 - 15.5 g NaOH (-&amp;gt; 15 g for about 3% super fat)&lt;br /&gt;
&lt;br /&gt;
== Instructions ==&lt;br /&gt;
&lt;br /&gt;
1) Combine oils and heat gently. Let cool to 38 °C.&lt;br /&gt;
&lt;br /&gt;
2) Combine solid lye and water, stir well. Set aside and allow to cool (38 °C).&lt;br /&gt;
&lt;br /&gt;
3) Combine lye solution and melted oils. Stir until the mixture traces.&lt;br /&gt;
&lt;br /&gt;
4) Pour raw soap into prepared molds. Let it in the mold for at least 24 hours.&lt;br /&gt;
&lt;br /&gt;
5) Remove the soap from the molds, slice it into bars and let it cure for 4-8 weeks.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Result ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:DSCN2247_600.jpg|400px]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Theory ==&lt;br /&gt;
&lt;br /&gt;
In chemistry, [https://en.wikipedia.org/wiki/Soap a soap is a &#039;&#039;&#039;salt of a fatty acid&#039;&#039;&#039;.]&lt;br /&gt;
&lt;br /&gt;
[[File:NaStearate.png]]&lt;/div&gt;</summary>
		<author><name>0rel</name></author>
	</entry>
	<entry>
		<id>https://wiki.sgmk-ssam.ch/index.php?title=Simple_soap&amp;diff=6592</id>
		<title>Simple soap</title>
		<link rel="alternate" type="text/html" href="https://wiki.sgmk-ssam.ch/index.php?title=Simple_soap&amp;diff=6592"/>
		<updated>2016-10-31T19:54:51Z</updated>

		<summary type="html">&lt;p&gt;0rel: /* Simple Soap */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
=== Simple Soap ===&lt;br /&gt;
&lt;br /&gt;
Got some [https://en.wikipedia.org/wiki/Lye NaOH] lye-ing around? Enough to make a simple [https://en.wikipedia.org/wiki/Lye_soap lye soap] with only household materials.&lt;br /&gt;
&lt;br /&gt;
== Ingredients: ==&lt;br /&gt;
&lt;br /&gt;
* 30 g Coconut Oil (76 °C)&lt;br /&gt;
* 50 g Palm Oil&lt;br /&gt;
* 10 g Olive Oil&lt;br /&gt;
* 10 g Sunflower Oil&lt;br /&gt;
&lt;br /&gt;
* 38 g Water&lt;br /&gt;
* 14.6 - 15.5 g NaOH (-&amp;gt; 15 g for about 3% super fat)&lt;br /&gt;
&lt;br /&gt;
== Instructions ==&lt;br /&gt;
&lt;br /&gt;
1) Combine oils and heat gently. Let cool to 38 °C.&lt;br /&gt;
&lt;br /&gt;
2) Combine solid lye and water, stir well. Set aside and allow to cool (38 °C).&lt;br /&gt;
&lt;br /&gt;
3) Combine lye solution and melted oils. Stir until the mixture traces.&lt;br /&gt;
&lt;br /&gt;
4) Pour raw soap into prepared molds. Let it in the mold for at least 24 hours.&lt;br /&gt;
&lt;br /&gt;
5) Remove the soap from the molds, slice it into bars and let it cure for 4-8 weeks.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Result ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:DSCN2247_600.jpg|400px]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Theory ==&lt;br /&gt;
&lt;br /&gt;
In chemistry, [https://en.wikipedia.org/wiki/Soap a soap is a &#039;&#039;&#039;salt of a fatty acid&#039;&#039;&#039;.]&lt;br /&gt;
&lt;br /&gt;
[[File:NaStearate.png]]&lt;/div&gt;</summary>
		<author><name>0rel</name></author>
	</entry>
	<entry>
		<id>https://wiki.sgmk-ssam.ch/index.php?title=Projects&amp;diff=6591</id>
		<title>Projects</title>
		<link rel="alternate" type="text/html" href="https://wiki.sgmk-ssam.ch/index.php?title=Projects&amp;diff=6591"/>
		<updated>2016-10-31T19:53:25Z</updated>

		<summary type="html">&lt;p&gt;0rel: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== [[Motörheadz]] ==&lt;br /&gt;
&lt;br /&gt;
== [[BalanZBot]] ==&lt;br /&gt;
&lt;br /&gt;
== [[MicMacMC]] ==&lt;br /&gt;
&lt;br /&gt;
== [[IoT Clock]] ==&lt;br /&gt;
That blinky thing hanging over the door now.&lt;br /&gt;
&lt;br /&gt;
Teh control webapp.&lt;br /&gt;
https://iot-clock2.appspot.com/&lt;br /&gt;
&lt;br /&gt;
== [[Arduino Uno R3 as HID]] ==&lt;br /&gt;
Turning the Arduino UNO R3 into a HID is very easy. But the documentation on the web just sucks. Get the recipe here at SGMK.&lt;br /&gt;
&lt;br /&gt;
== [[Elektronisches Heimatwerk Luzern 28.2.-10.3.2013]] ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== [[Workshopology]] ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== [[WatchOut]] ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== [[Thermal IR-Camera]] ==&lt;br /&gt;
&lt;br /&gt;
[[File:ThermalCam_PD.png|320px]]&lt;br /&gt;
&lt;br /&gt;
== [[STM32 dev]] ==&lt;br /&gt;
[[File:Stm32pcb1d.jpg]]&lt;br /&gt;
&lt;br /&gt;
== [[SolarRC]] ==&lt;br /&gt;
&lt;br /&gt;
== [[SGMKmorseAttacks]] ==&lt;br /&gt;
&lt;br /&gt;
[[File:P1080620.JPG|320px]]&lt;br /&gt;
&lt;br /&gt;
== [[CyberDudelsack]] ==&lt;br /&gt;
&lt;br /&gt;
== [[SGMKtiny]] ==&lt;br /&gt;
&lt;br /&gt;
== [[SGMKduino]] ==&lt;br /&gt;
&lt;br /&gt;
[[File:SGMKduino_v3_web.png|320px]]&lt;br /&gt;
&lt;br /&gt;
== [[Gnusbuino]] ==&lt;br /&gt;
[[File:Gnusbuino_pcb.gif]]&lt;br /&gt;
&lt;br /&gt;
The Gnusbuino is an adaption of Michael Egger&#039;s gnusb that is (more or less) compatible with the Arduino environment.&lt;br /&gt;
It uses the V-USB virtual USB driver from obdev.at instead of a dedicated USB chip (FTDI on the Arduino) - is thus a lot easier and cheaper to build oneself - very few components, single sided PCB…&lt;br /&gt;
It has a bootloader and can programmed directly through USB. It can mimic many devices (like the USBasp AVR programmer or a standard USB-MIDI interface). &lt;br /&gt;
&lt;br /&gt;
Offspring:&lt;br /&gt;
*[[Midignusbuino]] - Arduino compatible USB-MIDI controller / interface&lt;br /&gt;
*[[Babygnusbuino]] - ridiculously small bare-bones Arduino&lt;br /&gt;
* [https://github.com/mirdej/gnusbuino/tree/gnusbuino88 Gnusbuino88] Atmega88 version&lt;br /&gt;
*[[Babygnusbuino-v2]] - more free pins on already ridiculously small bare-bones Arduino&lt;br /&gt;
* [[Babymidimultiplexgnusbuino]] - 8 channel MIDI controller&lt;br /&gt;
* [[8bit Mix Tape]] &lt;br /&gt;
[[File:Babygnusbuino.jpg|400px]]&lt;br /&gt;
&lt;br /&gt;
== [[Postduino]] and related Fantasies ==&lt;br /&gt;
&lt;br /&gt;
Discussions at the anyma research week 2014, after hours and hours of discussions, late night fights and yelling, nightmares and fantasies about what comes after the arduino.... cheap, simple, easy to make? or next level shit using arm-processors? more pins / less pins? fuck attiny85 forever? what about the 32u4 chip? or just buy the [http://arduino.cc/en/Main/arduinoBoardMicro arduino micro]? or should we just use the [[Gnusbuino]], as we always had? or what about that Atmega88 chip? or, or, or, or,...&lt;br /&gt;
&lt;br /&gt;
== [[8bit Mix Tape]] ==&lt;br /&gt;
[[File:8bit_mixedTapev02.jpg|left|400px]] {{#widget:Vimeo|id=58727965}}&lt;br /&gt;
&lt;br /&gt;
The 8bit MixTape is an arduino compatible sound gadget, based on the BabyGnusbuino ([http://www.anyma.ch/blogs/research/ anyma]) and [http://youtube.com/watch?v=GtQdIYUtAHg Viznut&#039;s &amp;quot;Algorithmic symphonies from one line of code&amp;quot;], put together by dusjagr, [http://lifepatch.org/ ucok] and iyok...&lt;br /&gt;
&lt;br /&gt;
New version, v0.2, nicely fits into a tape, with battery, USB programming interface, LEDs and a button to choose different codes.&lt;br /&gt;
&lt;br /&gt;
links:&lt;br /&gt;
http://youtube.com/watch?v=GtQdIYUtAHg&lt;br /&gt;
http://wurstcaptures.untergrund.net/music/&lt;br /&gt;
http://wiki.sgmk-ssam.ch/index.php/Babygnusbuino&lt;br /&gt;
&lt;br /&gt;
== [[DIY Micro Laser Cutter]] ==&lt;br /&gt;
&lt;br /&gt;
Step by Step Instruction for building your DIY Laser Cutter.&lt;br /&gt;
&lt;br /&gt;
== little cutie code snippets ==&lt;br /&gt;
* [[tone sweep arduino]] combine with a maotor driver or mosfet for speakers + maizena&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== [[20_pix display]] ==&lt;br /&gt;
&lt;br /&gt;
{{#widget:Vimeo|id=10895002}}&lt;br /&gt;
&lt;br /&gt;
[[Category:Projects]]&lt;br /&gt;
&lt;br /&gt;
== [[Vive la Resistance aka NanoSmano Sajica]] ==&lt;br /&gt;
&lt;br /&gt;
[[File:sajica_circuit.jpg|320px]]&lt;br /&gt;
&lt;br /&gt;
== [[Shruti Hacking  - Radel Nano Dx]] ==&lt;br /&gt;
Instruction on how to digitally hack the legendary Indian musical instruments by Radel. Radel Electronics Pvt. Ltd. is the pioneer in the field of electronic musical instruments for Indian music. &amp;lt;br&amp;gt;&lt;br /&gt;
[[File:shruti_hack.jpg|140px]]&lt;br /&gt;
&lt;br /&gt;
== [[microRing]] ==&lt;br /&gt;
&lt;br /&gt;
The Idea is to generate two squarewaves with two NAND-Gatters of a 4093 IC and use the other two NAND as an XOR stage. The two waveforms are then send as inputs to the XOR and we have a Ring Modulation. Best of it, it&#039;s all on just one 4093. The additional parts are also very easy.&lt;br /&gt;
&lt;br /&gt;
== [[microNAND]] ==&lt;br /&gt;
&lt;br /&gt;
This Circuit is the result of the first try to build the microRing described above. Due to some misonceptions, this circuit is not a ring modulator, but nevertheless sounds great. So i leave this stuff on.&lt;br /&gt;
&lt;br /&gt;
{{#widget:Vimeo|id=72336145}}&lt;br /&gt;
&lt;br /&gt;
== [[micronoise pro]] ==&lt;br /&gt;
&lt;br /&gt;
the micronoise pro is a further development of the original micronoise. it uses all 4 NAND gates of the 4093 chip.&lt;br /&gt;
&lt;br /&gt;
[[File:micronoise_pro.jpg|300px]]&lt;br /&gt;
&lt;br /&gt;
== [[8step sequencer]] ==&lt;br /&gt;
&lt;br /&gt;
some designs of simple 8step sequencers based on the 4022 chip&lt;br /&gt;
&lt;br /&gt;
[[File:Modula_seq_small.jpg|300px]]&lt;br /&gt;
&lt;br /&gt;
== [[SinkDriverArduinoShield]] ==&lt;br /&gt;
&lt;br /&gt;
[[File:ArduinoPOWERshield-1.jpg]]&lt;br /&gt;
&lt;br /&gt;
== [[CapSense (QTouchADC)]] ==&lt;br /&gt;
&lt;br /&gt;
== [[Fermento Mods]] ==&lt;br /&gt;
&lt;br /&gt;
== Masken ==&lt;br /&gt;
&lt;br /&gt;
=== micro_noise Collector&#039;s edition ===&lt;br /&gt;
&lt;br /&gt;
[[File:mask_engl.png|150px]][[File:mask_hindi.png|150px]]&lt;br /&gt;
&lt;br /&gt;
[[File:maske_collectors_12x.pdf]]&lt;br /&gt;
&lt;br /&gt;
=== BitBadge ===&lt;br /&gt;
&lt;br /&gt;
[[File:BitBadge_2014.pdf]]&lt;br /&gt;
&lt;br /&gt;
[[Category:Projects]]&lt;br /&gt;
&lt;br /&gt;
== Bits&amp;amp;Bytes ==&lt;br /&gt;
&lt;br /&gt;
[[processingDataDDisplay]]&lt;br /&gt;
&lt;br /&gt;
== [[EtchingBox]] ==&lt;br /&gt;
A mobile PCB etching station&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== [[Dual TBridge Percussion]] ==&lt;br /&gt;
&lt;br /&gt;
Dual Electronic Percussion based on the TBridge Circuit&lt;br /&gt;
&lt;br /&gt;
[[File:dualTbridge.JPG|300px]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== [[cappaddy]] ==&lt;br /&gt;
[[File:cappaddy_DSCN1111.JPG]]&lt;br /&gt;
&lt;br /&gt;
== [[rawcoco]] ==&lt;br /&gt;
[[File:rawcoco_DSCN0342.JPG]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== [[CocoTeens7 - Hit The Tune]] ==&lt;br /&gt;
[[File:CocoTeens7_HitTheTune_front.jpg|400px]]&lt;br /&gt;
&lt;br /&gt;
== [[Shenzhen Ready]] ==&lt;br /&gt;
[[File:IMG_20160518_102335.jpg|400px]]&lt;br /&gt;
&lt;br /&gt;
== [[Electronic Voodoo Doll Advanced]] ==&lt;br /&gt;
[[File:voodoo.jpg|400px]]&lt;br /&gt;
&lt;br /&gt;
== [[Simple Theremin]] ==&lt;br /&gt;
[[File:Simple_theremin_case.jpg|400px]]&lt;br /&gt;
&lt;br /&gt;
== [[LDR - Cell Phone Door Opener]] ==&lt;br /&gt;
[[File:DoorOpener.jpg|400px]]&lt;br /&gt;
&lt;br /&gt;
== [[simple soap]] ==&lt;/div&gt;</summary>
		<author><name>0rel</name></author>
	</entry>
	<entry>
		<id>https://wiki.sgmk-ssam.ch/index.php?title=Simple_soap&amp;diff=6590</id>
		<title>Simple soap</title>
		<link rel="alternate" type="text/html" href="https://wiki.sgmk-ssam.ch/index.php?title=Simple_soap&amp;diff=6590"/>
		<updated>2016-10-31T19:52:46Z</updated>

		<summary type="html">&lt;p&gt;0rel: diy, soap, chemistry&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
=== Simple Soap ===&lt;br /&gt;
&lt;br /&gt;
Got some [https://en.wikipedia.org/wiki/Lye NaOH] lye-ing around? Enough to make a simple [https://en.wikipedia.org/wiki/Lye_soap lye soap] with only house hold materials.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Ingredients: ==&lt;br /&gt;
&lt;br /&gt;
* 30 g Coconut Oil (76 °C)&lt;br /&gt;
* 50 g Palm Oil&lt;br /&gt;
* 10 g Olive Oil&lt;br /&gt;
* 10 g Sunflower Oil&lt;br /&gt;
&lt;br /&gt;
* 38 g Water&lt;br /&gt;
* 14.6 - 15.5 g NaOH (-&amp;gt; 15 g for about 3% super fat)&lt;br /&gt;
&lt;br /&gt;
== Instructions ==&lt;br /&gt;
&lt;br /&gt;
1) Combine oils and heat gently. Let cool to 38 °C.&lt;br /&gt;
&lt;br /&gt;
2) Combine solid lye and water, stir well. Set aside and allow to cool (38 °C).&lt;br /&gt;
&lt;br /&gt;
3) Combine lye solution and melted oils. Stir until the mixture traces.&lt;br /&gt;
&lt;br /&gt;
4) Pour raw soap into prepared molds. Let it in the mold for at least 24 hours.&lt;br /&gt;
&lt;br /&gt;
5) Remove the soap from the molds, slice it into bars and let it cure for 4-8 weeks.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Result ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:DSCN2247_600.jpg|400px]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Theory ==&lt;br /&gt;
&lt;br /&gt;
In chemistry, [https://en.wikipedia.org/wiki/Soap a soap is a &#039;&#039;&#039;salt of a fatty acid&#039;&#039;&#039;.]&lt;br /&gt;
&lt;br /&gt;
[[File:NaStearate.png]]&lt;/div&gt;</summary>
		<author><name>0rel</name></author>
	</entry>
	<entry>
		<id>https://wiki.sgmk-ssam.ch/index.php?title=Projects/simple_soap&amp;diff=6589</id>
		<title>Projects/simple soap</title>
		<link rel="alternate" type="text/html" href="https://wiki.sgmk-ssam.ch/index.php?title=Projects/simple_soap&amp;diff=6589"/>
		<updated>2016-10-31T19:52:20Z</updated>

		<summary type="html">&lt;p&gt;0rel: Blanked the page&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>0rel</name></author>
	</entry>
	<entry>
		<id>https://wiki.sgmk-ssam.ch/index.php?title=Projects/simple_soap&amp;diff=6588</id>
		<title>Projects/simple soap</title>
		<link rel="alternate" type="text/html" href="https://wiki.sgmk-ssam.ch/index.php?title=Projects/simple_soap&amp;diff=6588"/>
		<updated>2016-10-31T19:48:28Z</updated>

		<summary type="html">&lt;p&gt;0rel: /* Ingredients: */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
=== Simple Soap ===&lt;br /&gt;
&lt;br /&gt;
Got some [https://en.wikipedia.org/wiki/Lye NaOH] lye-ing around? Enough to make a simple [https://en.wikipedia.org/wiki/Lye_soap lye soap] with only house hold materials.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Ingredients: ==&lt;br /&gt;
&lt;br /&gt;
* 30 g Coconut Oil (76 °C)&lt;br /&gt;
* 50 g Palm Oil&lt;br /&gt;
* 10 g Olive Oil&lt;br /&gt;
* 10 g Sunflower Oil&lt;br /&gt;
&lt;br /&gt;
* 38 g Water&lt;br /&gt;
* 14.6 - 15.5 g NaOH (-&amp;gt; 15 g for about 3% super fat)&lt;br /&gt;
&lt;br /&gt;
== Instructions ==&lt;br /&gt;
&lt;br /&gt;
1) Combine oils and heat gently. Let cool to 38 °C.&lt;br /&gt;
&lt;br /&gt;
2) Combine solid lye and water, stir well. Set aside and allow to cool (38 °C).&lt;br /&gt;
&lt;br /&gt;
3) Combine lye solution and melted oils. Stir until the mixture traces.&lt;br /&gt;
&lt;br /&gt;
4) Pour raw soap into prepared molds. Let it in the mold for at least 24 hours.&lt;br /&gt;
&lt;br /&gt;
5) Remove the soap from the molds, slice it into bars and let it cure for 4-8 weeks.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Result ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:DSCN2247_600.jpg|400px]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Theory ==&lt;br /&gt;
&lt;br /&gt;
In chemistry, [https://en.wikipedia.org/wiki/Soap a soap is a &#039;&#039;&#039;salt of a fatty acid&#039;&#039;&#039;.]&lt;br /&gt;
&lt;br /&gt;
[[File:NaStearate.png]]&lt;/div&gt;</summary>
		<author><name>0rel</name></author>
	</entry>
	<entry>
		<id>https://wiki.sgmk-ssam.ch/index.php?title=Projects/simple_soap&amp;diff=6587</id>
		<title>Projects/simple soap</title>
		<link rel="alternate" type="text/html" href="https://wiki.sgmk-ssam.ch/index.php?title=Projects/simple_soap&amp;diff=6587"/>
		<updated>2016-10-31T19:47:30Z</updated>

		<summary type="html">&lt;p&gt;0rel: /* Ingredients: */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
=== Simple Soap ===&lt;br /&gt;
&lt;br /&gt;
Got some [https://en.wikipedia.org/wiki/Lye NaOH] lye-ing around? Enough to make a simple [https://en.wikipedia.org/wiki/Lye_soap lye soap] with only house hold materials.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Ingredients: ==&lt;br /&gt;
&lt;br /&gt;
* 30 g Coconut Oil (76 °C)&lt;br /&gt;
* 50 g Palm Oil&lt;br /&gt;
* 10 g Olive Oil&lt;br /&gt;
* 10 g Sunflower Oil&lt;br /&gt;
&lt;br /&gt;
* 38 g Water&lt;br /&gt;
* 14.6 g - 15.5 g NaOH -&amp;gt; (15 g for about 3% super fat)&lt;br /&gt;
&lt;br /&gt;
== Instructions ==&lt;br /&gt;
&lt;br /&gt;
1) Combine oils and heat gently. Let cool to 38 °C.&lt;br /&gt;
&lt;br /&gt;
2) Combine solid lye and water, stir well. Set aside and allow to cool (38 °C).&lt;br /&gt;
&lt;br /&gt;
3) Combine lye solution and melted oils. Stir until the mixture traces.&lt;br /&gt;
&lt;br /&gt;
4) Pour raw soap into prepared molds. Let it in the mold for at least 24 hours.&lt;br /&gt;
&lt;br /&gt;
5) Remove the soap from the molds, slice it into bars and let it cure for 4-8 weeks.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Result ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:DSCN2247_600.jpg|400px]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Theory ==&lt;br /&gt;
&lt;br /&gt;
In chemistry, [https://en.wikipedia.org/wiki/Soap a soap is a &#039;&#039;&#039;salt of a fatty acid&#039;&#039;&#039;.]&lt;br /&gt;
&lt;br /&gt;
[[File:NaStearate.png]]&lt;/div&gt;</summary>
		<author><name>0rel</name></author>
	</entry>
	<entry>
		<id>https://wiki.sgmk-ssam.ch/index.php?title=Projects/simple_soap&amp;diff=6586</id>
		<title>Projects/simple soap</title>
		<link rel="alternate" type="text/html" href="https://wiki.sgmk-ssam.ch/index.php?title=Projects/simple_soap&amp;diff=6586"/>
		<updated>2016-10-31T19:46:54Z</updated>

		<summary type="html">&lt;p&gt;0rel: /* Ingredients: */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
=== Simple Soap ===&lt;br /&gt;
&lt;br /&gt;
Got some [https://en.wikipedia.org/wiki/Lye NaOH] lye-ing around? Enough to make a simple [https://en.wikipedia.org/wiki/Lye_soap lye soap] with only house hold materials.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Ingredients: ==&lt;br /&gt;
&lt;br /&gt;
* 10 g Olive Oil&lt;br /&gt;
* 10 g Sunflower Oil&lt;br /&gt;
* 30 g Coconut Oil (76 °C)&lt;br /&gt;
* 50 g Palm Oil&lt;br /&gt;
&lt;br /&gt;
* 38 g Water&lt;br /&gt;
* 14.6 g - 15.5 g NaOH -&amp;gt; (15 g for about 3% super fat)&lt;br /&gt;
&lt;br /&gt;
== Instructions ==&lt;br /&gt;
&lt;br /&gt;
1) Combine oils and heat gently. Let cool to 38 °C.&lt;br /&gt;
&lt;br /&gt;
2) Combine solid lye and water, stir well. Set aside and allow to cool (38 °C).&lt;br /&gt;
&lt;br /&gt;
3) Combine lye solution and melted oils. Stir until the mixture traces.&lt;br /&gt;
&lt;br /&gt;
4) Pour raw soap into prepared molds. Let it in the mold for at least 24 hours.&lt;br /&gt;
&lt;br /&gt;
5) Remove the soap from the molds, slice it into bars and let it cure for 4-8 weeks.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Result ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:DSCN2247_600.jpg|400px]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Theory ==&lt;br /&gt;
&lt;br /&gt;
In chemistry, [https://en.wikipedia.org/wiki/Soap a soap is a &#039;&#039;&#039;salt of a fatty acid&#039;&#039;&#039;.]&lt;br /&gt;
&lt;br /&gt;
[[File:NaStearate.png]]&lt;/div&gt;</summary>
		<author><name>0rel</name></author>
	</entry>
	<entry>
		<id>https://wiki.sgmk-ssam.ch/index.php?title=Projects/simple_soap&amp;diff=6585</id>
		<title>Projects/simple soap</title>
		<link rel="alternate" type="text/html" href="https://wiki.sgmk-ssam.ch/index.php?title=Projects/simple_soap&amp;diff=6585"/>
		<updated>2016-10-31T19:46:03Z</updated>

		<summary type="html">&lt;p&gt;0rel: /* Theory */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
=== Simple Soap ===&lt;br /&gt;
&lt;br /&gt;
Got some [https://en.wikipedia.org/wiki/Lye NaOH] lye-ing around? Enough to make a simple [https://en.wikipedia.org/wiki/Lye_soap lye soap] with only house hold materials.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Ingredients: ==&lt;br /&gt;
&lt;br /&gt;
- 10 g Olive Oil&lt;br /&gt;
- 10 g Sunflower Oil&lt;br /&gt;
- 30 g Coconut Oil (76 °C)&lt;br /&gt;
- 50 g Palm Oil&lt;br /&gt;
&lt;br /&gt;
- 38 g Water&lt;br /&gt;
- 14.6 g - 15.5 g NaOH -&amp;gt; (15 g for about 3% super fat)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Instructions ==&lt;br /&gt;
&lt;br /&gt;
1) Combine oils and heat gently. Let cool to 38 °C.&lt;br /&gt;
&lt;br /&gt;
2) Combine solid lye and water, stir well. Set aside and allow to cool (38 °C).&lt;br /&gt;
&lt;br /&gt;
3) Combine lye solution and melted oils. Stir until the mixture traces.&lt;br /&gt;
&lt;br /&gt;
4) Pour raw soap into prepared molds. Let it in the mold for at least 24 hours.&lt;br /&gt;
&lt;br /&gt;
5) Remove the soap from the molds, slice it into bars and let it cure for 4-8 weeks.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Result ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:DSCN2247_600.jpg|400px]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Theory ==&lt;br /&gt;
&lt;br /&gt;
In chemistry, [https://en.wikipedia.org/wiki/Soap a soap is a &#039;&#039;&#039;salt of a fatty acid&#039;&#039;&#039;.]&lt;br /&gt;
&lt;br /&gt;
[[File:NaStearate.png]]&lt;/div&gt;</summary>
		<author><name>0rel</name></author>
	</entry>
	<entry>
		<id>https://wiki.sgmk-ssam.ch/index.php?title=Projects/simple_soap&amp;diff=6584</id>
		<title>Projects/simple soap</title>
		<link rel="alternate" type="text/html" href="https://wiki.sgmk-ssam.ch/index.php?title=Projects/simple_soap&amp;diff=6584"/>
		<updated>2016-10-31T19:45:30Z</updated>

		<summary type="html">&lt;p&gt;0rel: diy soap&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
=== Simple Soap ===&lt;br /&gt;
&lt;br /&gt;
Got some [https://en.wikipedia.org/wiki/Lye NaOH] lye-ing around? Enough to make a simple [https://en.wikipedia.org/wiki/Lye_soap lye soap] with only house hold materials.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Ingredients: ==&lt;br /&gt;
&lt;br /&gt;
- 10 g Olive Oil&lt;br /&gt;
- 10 g Sunflower Oil&lt;br /&gt;
- 30 g Coconut Oil (76 °C)&lt;br /&gt;
- 50 g Palm Oil&lt;br /&gt;
&lt;br /&gt;
- 38 g Water&lt;br /&gt;
- 14.6 g - 15.5 g NaOH -&amp;gt; (15 g for about 3% super fat)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Instructions ==&lt;br /&gt;
&lt;br /&gt;
1) Combine oils and heat gently. Let cool to 38 °C.&lt;br /&gt;
&lt;br /&gt;
2) Combine solid lye and water, stir well. Set aside and allow to cool (38 °C).&lt;br /&gt;
&lt;br /&gt;
3) Combine lye solution and melted oils. Stir until the mixture traces.&lt;br /&gt;
&lt;br /&gt;
4) Pour raw soap into prepared molds. Let it in the mold for at least 24 hours.&lt;br /&gt;
&lt;br /&gt;
5) Remove the soap from the molds, slice it into bars and let it cure for 4-8 weeks.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Result ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:DSCN2247_600.jpg|400px]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Theory ==&lt;br /&gt;
&lt;br /&gt;
[In chemistry, a soap is a salt of a fatty acid. https://en.wikipedia.org/wiki/Soap]&lt;br /&gt;
&lt;br /&gt;
[[File:NaStearate.png]]&lt;/div&gt;</summary>
		<author><name>0rel</name></author>
	</entry>
	<entry>
		<id>https://wiki.sgmk-ssam.ch/index.php?title=File:NaStearate.png&amp;diff=6583</id>
		<title>File:NaStearate.png</title>
		<link rel="alternate" type="text/html" href="https://wiki.sgmk-ssam.ch/index.php?title=File:NaStearate.png&amp;diff=6583"/>
		<updated>2016-10-31T19:45:15Z</updated>

		<summary type="html">&lt;p&gt;0rel: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>0rel</name></author>
	</entry>
	<entry>
		<id>https://wiki.sgmk-ssam.ch/index.php?title=Projects/simple_soap&amp;diff=6582</id>
		<title>Projects/simple soap</title>
		<link rel="alternate" type="text/html" href="https://wiki.sgmk-ssam.ch/index.php?title=Projects/simple_soap&amp;diff=6582"/>
		<updated>2016-10-31T19:41:31Z</updated>

		<summary type="html">&lt;p&gt;0rel: /* Instructions (Cold Process): */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
=== Simple Soap ===&lt;br /&gt;
&lt;br /&gt;
Got some [https://en.wikipedia.org/wiki/Lye NaOH] lye-ing around? Enough to make a simple [https://en.wikipedia.org/wiki/Lye_soap lye soap] with only house hold materials.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Ingredients: ==&lt;br /&gt;
&lt;br /&gt;
- 10 g Olive Oil&lt;br /&gt;
- 10 g Sunflower Oil&lt;br /&gt;
- 30 g Coconut Oil (76 °C)&lt;br /&gt;
- 50 g Palm Oil&lt;br /&gt;
&lt;br /&gt;
- 38 g Water&lt;br /&gt;
- 14.6 g - 15.5 g NaOH -&amp;gt; (15 g for about 3% super fat)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Instructions ==&lt;br /&gt;
&lt;br /&gt;
1) Combine oils and heat gently. Let cool to 38 °C.&lt;br /&gt;
&lt;br /&gt;
2) Combine solid lye and water, stir well. Set aside and allow to cool (38 °C).&lt;br /&gt;
&lt;br /&gt;
3) Combine lye solution and melted oils. Stir until the mixture traces.&lt;br /&gt;
&lt;br /&gt;
4) Pour raw soap into prepared molds. Let it in the mold for at least 24 hours.&lt;br /&gt;
&lt;br /&gt;
5) Remove the soap from the molds, slice it into bars and let it cure for 4-8 weeks.&lt;br /&gt;
&lt;br /&gt;
== Result ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:DSCN2247_600.jpg|400px]]&lt;/div&gt;</summary>
		<author><name>0rel</name></author>
	</entry>
	<entry>
		<id>https://wiki.sgmk-ssam.ch/index.php?title=Projects/simple_soap&amp;diff=6581</id>
		<title>Projects/simple soap</title>
		<link rel="alternate" type="text/html" href="https://wiki.sgmk-ssam.ch/index.php?title=Projects/simple_soap&amp;diff=6581"/>
		<updated>2016-10-31T19:41:18Z</updated>

		<summary type="html">&lt;p&gt;0rel: /* Instructions (Cold Process): */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
=== Simple Soap ===&lt;br /&gt;
&lt;br /&gt;
Got some [https://en.wikipedia.org/wiki/Lye NaOH] lye-ing around? Enough to make a simple [https://en.wikipedia.org/wiki/Lye_soap lye soap] with only house hold materials.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Ingredients: ==&lt;br /&gt;
&lt;br /&gt;
- 10 g Olive Oil&lt;br /&gt;
- 10 g Sunflower Oil&lt;br /&gt;
- 30 g Coconut Oil (76 °C)&lt;br /&gt;
- 50 g Palm Oil&lt;br /&gt;
&lt;br /&gt;
- 38 g Water&lt;br /&gt;
- 14.6 g - 15.5 g NaOH -&amp;gt; (15 g for about 3% super fat)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Instructions (Cold Process): ==&lt;br /&gt;
&lt;br /&gt;
1) Combine oils and heat gently. Let cool to 38 °C.&lt;br /&gt;
&lt;br /&gt;
2) Combine solid lye and water, stir well. Set aside and allow to cool (38 °C).&lt;br /&gt;
&lt;br /&gt;
3) Combine lye solution and melted oils. Stir until the mixture traces.&lt;br /&gt;
&lt;br /&gt;
4) Pour raw soap into prepared molds. Let it in the mold for at least 24 hours.&lt;br /&gt;
&lt;br /&gt;
5) Remove the soap from the molds, slice it into bars and let it cure for 4-8 weeks.&lt;br /&gt;
&lt;br /&gt;
== Result ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:DSCN2247_600.jpg|400px]]&lt;/div&gt;</summary>
		<author><name>0rel</name></author>
	</entry>
	<entry>
		<id>https://wiki.sgmk-ssam.ch/index.php?title=Projects/simple_soap&amp;diff=6580</id>
		<title>Projects/simple soap</title>
		<link rel="alternate" type="text/html" href="https://wiki.sgmk-ssam.ch/index.php?title=Projects/simple_soap&amp;diff=6580"/>
		<updated>2016-10-31T19:41:07Z</updated>

		<summary type="html">&lt;p&gt;0rel: Created page with &amp;quot; === Simple Soap ===  Got some [https://en.wikipedia.org/wiki/Lye NaOH] lye-ing around? Enough to make a simple [https://en.wikipedia.org/wiki/Lye_soap lye soap] with only hou...&amp;quot;&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
=== Simple Soap ===&lt;br /&gt;
&lt;br /&gt;
Got some [https://en.wikipedia.org/wiki/Lye NaOH] lye-ing around? Enough to make a simple [https://en.wikipedia.org/wiki/Lye_soap lye soap] with only house hold materials.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Ingredients: ==&lt;br /&gt;
&lt;br /&gt;
- 10 g Olive Oil&lt;br /&gt;
- 10 g Sunflower Oil&lt;br /&gt;
- 30 g Coconut Oil (76 °C)&lt;br /&gt;
- 50 g Palm Oil&lt;br /&gt;
&lt;br /&gt;
- 38 g Water&lt;br /&gt;
- 14.6 g - 15.5 g NaOH -&amp;gt; (15 g for about 3% super fat)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Instructions (Cold Process): ==&lt;br /&gt;
&lt;br /&gt;
1) Combine oils and heat gently. Let cool to 38 °C.&lt;br /&gt;
&lt;br /&gt;
2) Combine solid lye and water, stir well. Set aside and allow to cool (38 °C).&lt;br /&gt;
&lt;br /&gt;
3) Combine lye solution and melted oils. Stir until the mixture traces.&lt;br /&gt;
&lt;br /&gt;
4) Pour raw soap into prepared molds. Let it in the mold for at least 24 hours.&lt;br /&gt;
&lt;br /&gt;
5) Remove the soap from the molds, slice it into bars and let it cure for&lt;br /&gt;
   4-8 weeks.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Result ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:DSCN2247_600.jpg|400px]]&lt;/div&gt;</summary>
		<author><name>0rel</name></author>
	</entry>
	<entry>
		<id>https://wiki.sgmk-ssam.ch/index.php?title=File:DSCN2247_600.jpg&amp;diff=6579</id>
		<title>File:DSCN2247 600.jpg</title>
		<link rel="alternate" type="text/html" href="https://wiki.sgmk-ssam.ch/index.php?title=File:DSCN2247_600.jpg&amp;diff=6579"/>
		<updated>2016-10-31T19:38:56Z</updated>

		<summary type="html">&lt;p&gt;0rel: File uploaded with MsUpload&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;File uploaded with MsUpload&lt;/div&gt;</summary>
		<author><name>0rel</name></author>
	</entry>
	<entry>
		<id>https://wiki.sgmk-ssam.ch/index.php?title=STM32_dev&amp;diff=6578</id>
		<title>STM32 dev</title>
		<link rel="alternate" type="text/html" href="https://wiki.sgmk-ssam.ch/index.php?title=STM32_dev&amp;diff=6578"/>
		<updated>2016-10-15T19:42:37Z</updated>

		<summary type="html">&lt;p&gt;0rel: /* IDE: Eclipse SW4STM32 */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Overview ==&lt;br /&gt;
&lt;br /&gt;
Notes on STM32 microcontrollers and on how to get them working in DIY projects.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;/// this is a work in progress draft ///&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
== Software ==&lt;br /&gt;
&lt;br /&gt;
All about software tools for STM32 dev. Development environments, compilers, debuggers, IDEs etc.&lt;br /&gt;
&lt;br /&gt;
=== ARM toolchains ===&lt;br /&gt;
&lt;br /&gt;
==== gcc-arm-embedded Toolchain ====&lt;br /&gt;
&lt;br /&gt;
Install the GCC arm-none-eabi toolchain for your OS. On Arch Linux this can be done with the package manager:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
$ sudo pacman -S arm-none-eabi-gcc arm-none-eabi-gdb arm-none-eabi-binutils arm-none-eabi-newlib&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Alternatively, it can be built from scratch, to have all tools and their sources in one place.&lt;br /&gt;
&lt;br /&gt;
* Download the sources here: https://launchpad.net/gcc-arm-embedded/+download&lt;br /&gt;
* Install the &#039;&#039;common tools and libraries&#039;&#039; like described in the [https://launchpadlibrarian.net/231136652/How-to-build-toolchain.pdf documentation].&lt;br /&gt;
* Build the toolchain. - On my system, the following steps were required:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
$ cp gcc-arm-none-eabi-5_2-2015q4-20151219-src.tar.bz2 ~/toolchain&lt;br /&gt;
$ cd ~/toolchain&lt;br /&gt;
$ tar -xjf gcc-arm-none-eabi-5_2-2015q4-20151219-src.tar.bz2&lt;br /&gt;
$ cd ./gcc-arm-none-eabi-5_2-2015q4-20151219/src&lt;br /&gt;
$ find -name &#039;*.tar.*&#039; | xargs -I% tar -xf %&lt;br /&gt;
$ cd ..&lt;br /&gt;
$ ./build-prerequisites.sh --skip_steps=mingw32&lt;br /&gt;
$ ./build-toolchain.sh --skip_steps=mingw32,manual&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
Note that those &#039;&#039;skip_steps&#039;&#039; options were required in my case.&lt;br /&gt;
&lt;br /&gt;
==== Linaro Toolchain ====&lt;br /&gt;
&lt;br /&gt;
The [https://en.wikipedia.org/wiki/Linaro Linaro] toolchain seems to be famous as well.&lt;br /&gt;
&lt;br /&gt;
Install it with your package manager if available, or build it yourself:&amp;lt;br /&amp;gt;&lt;br /&gt;
https://wiki.linaro.org/WorkingGroups/ToolChain&amp;lt;br /&amp;gt;&lt;br /&gt;
https://wiki.linaro.org/WorkingGroups/ToolChain/FAQ&lt;br /&gt;
&lt;br /&gt;
==== devkitpro devkitARM toolchain ====&lt;br /&gt;
&lt;br /&gt;
Another gcc variant: http://devkitpro.org/&lt;br /&gt;
&lt;br /&gt;
Used in the homebrew scene for game consoles like the GP32, Nintendo (3)DS and GBA. It can [http://www.pouet.net/prod.php?which=59095 apparently] also be used for the STM32s as well! And generates probably more optimized binaries?&lt;br /&gt;
&lt;br /&gt;
(On Arch it can be installed from the AUR: https://aur.archlinux.org/packages/devkitarm-bin/ . But beware, the compiler, link, binutils have all the same name as the ones from the official GCC arm-none-eabi toolchain. So it&#039;s probably better to install it manually.)&lt;br /&gt;
&lt;br /&gt;
=== STM32CubeMX on Linux ===&lt;br /&gt;
&lt;br /&gt;
STM32CubeMX is a code generator for STM32 micros that can come in handy when you start a new project. It generates all the necessary init and HAL code, library and custom pin mux code for your specific MCU.&lt;br /&gt;
&lt;br /&gt;
Unfortunately, it comes as a Windows EXE and ST doesn&#039;t mention that it actually is a Java application. Luckily it can be installed on Linux by hand (thanks to 5V Joe&#039;s great note [http://fivevolt.blogspot.ch/2014/07/installing-stm32cubemx-on-linux.html there]):&lt;br /&gt;
&lt;br /&gt;
* Download [http://www.st.com/web/catalog/tools/FM147/CL1794/SC961/SS1743/PF259242?icmp=stm32cubemx_pron_prcube_feb2014&amp;amp;sc=stm32cube-pr STM32CubeMX].&lt;br /&gt;
* Install the application (tested in January 2016):&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
$ unzip SetupSTM32CubeMX-4.12.0.exe -d stm32cube&lt;br /&gt;
$ cd stm32cube&lt;br /&gt;
$ java -cp . com.izforge.izpack.installer.bootstrap.Installer&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
* Run:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
$ cd &amp;lt;install_dir&amp;gt;&lt;br /&gt;
$ unzip STM32CubeMX.exe&lt;br /&gt;
$ java -cp . com.st.microxplorer.maingui.STM32CubeMX&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== STM32CubeMX to Makefile ===&lt;br /&gt;
&lt;br /&gt;
For whatever reason, STM32CubeMX does not export plain GCC/Makefiles along with the initialization code. But instead, it supports an unpopular IDE called [http://www.st.com/web/catalog/tools/FM147/CL1794/SC961/SS1533/PF261797 SW4STM32], which is also based on free GNU tools. So after installing STM32CubeMX, these are the steps to get the GCC/Makefile project running:&lt;br /&gt;
&lt;br /&gt;
* Get this nice Python script by [http://www.ba0sh1.com/ Baoshi] to generate the Makefile for an exported SW4STM32 project:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
$ git clone https://github.com/baoshi/CubeMX2Makefile&lt;br /&gt;
$ cd CubeMX2Makefile&lt;br /&gt;
$ python2 CubeMX2Makefile.py &amp;lt;your_sw4stm32_prject_dir&amp;gt;&lt;br /&gt;
$ cd &amp;lt;your_sw4stm32_prject_dir&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* Fix a tiny bug in the generated Makefile (tested in January 2016). More can be read [http://www.ba0sh1.com/stm32cubemx-gcc-makefile/ here].&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
$ grep __weak Makefile &lt;br /&gt;
C_DEFS = -D__weak=&amp;quot;__attribute__\(\(weak\)\)&amp;quot; -D__packed=&amp;quot;__attribute__\(\(__packed__\)\)&amp;quot; -DUSE_HAL_DRIVER -DSTM32F072xB&lt;br /&gt;
$ sed -i &#039;s/\\(\\(weak\\)\\)/((weak))/g&#039; Makefile &lt;br /&gt;
$ sed -i &#039;s/\\(\\(packed\\)\\)/((packed))/g&#039; Makefile &lt;br /&gt;
$ grep __weak Makefile &lt;br /&gt;
C_DEFS = -D__weak=&amp;quot;__attribute__((weak))&amp;quot; -D__packed=&amp;quot;__attribute__\(\(__packed__\)\)&amp;quot; -DUSE_HAL_DRIVER -DSTM32F072xB&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* Then build the binary:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
$ make&lt;br /&gt;
(...)&lt;br /&gt;
arm-none-eabi-size build/STM32F072RBT6.elf&lt;br /&gt;
   text	   data	    bss	    dec	    hex	filename&lt;br /&gt;
   4568	     12	   1572	   6152	   1808	build/STM32F072RBT6.elf&lt;br /&gt;
arm-none-eabi-objcopy -O ihex build/STM32F072RBT6.elf build/STM32F072RBT6.hex&lt;br /&gt;
arm-none-eabi-objcopy -O binary -S build/STM32F072RBT6.elf build/STM32F072RBT6.bin	&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Flash ===&lt;br /&gt;
&lt;br /&gt;
Install OpenOCD and STLINK. On Arch Linux:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
sudo pacman -S stlink openocd&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now [http://openocd.org/ OpenOCD] and (arm-none-eabi-)gdb can be used to program and debug the MCU. All discovery boards also come with an ST-LINK/V2 programmer right built in speaking over USB to the host and over JTAG/[http://www.arm.com/products/system-ip/debug-trace/coresight-soc-components/serial-wire-debug.php SWD] to the target (note: only two pins are actually required for SWD debugging/flashing (SWDIO/SWCLK), but that for later (see also [[#Hardware]])). STM32 Discovery Boards should show up in the lsusb list like that:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
$ lsusb&lt;br /&gt;
(...)&lt;br /&gt;
Bus 003 Device 006: ID 0483:3748 STMicroelectronics ST-LINK/V2&lt;br /&gt;
(...)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
OpenOCD can now act as a &amp;quot;middleman&amp;quot; between the ST-LINK programmer and the user. As a server on the host, to which you can connect with telnet and GDB.&lt;br /&gt;
&lt;br /&gt;
To configure OpenOCD, put a configuration file called opencd.cfg into the project folder and start OpenOCD. While working on the project, let it run there in the foreground to see all the logs...&lt;br /&gt;
&lt;br /&gt;
For the [http://www.st.com/st-web-ui/static/active/jp/resource/technical/document/user_manual/DM00099401.pdf STM32 F072 Discovery] board this should work, for example:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
$ cd &amp;lt;project_directory&amp;gt;&lt;br /&gt;
$ echo &amp;quot;source [find board/stm32f0discovery.cfg]&amp;quot; &amp;gt; openocd.cfg&lt;br /&gt;
$ openocd&lt;br /&gt;
Open On-Chip Debugger 0.9.0 (2015-05-19-13:50)&lt;br /&gt;
Licensed under GNU GPL v2&lt;br /&gt;
For bug reports, read&lt;br /&gt;
	http://openocd.org/doc/doxygen/bugs.html&lt;br /&gt;
Info : The selected transport took over low-level target control. The results might differ compared to plain JTAG/SWD&lt;br /&gt;
adapter speed: 1000 kHz&lt;br /&gt;
adapter_nsrst_delay: 100&lt;br /&gt;
none separate&lt;br /&gt;
srst_only separate srst_nogate srst_open_drain connect_deassert_srst&lt;br /&gt;
Info : Unable to match requested speed 1000 kHz, using 950 kHz&lt;br /&gt;
Info : Unable to match requested speed 1000 kHz, using 950 kHz&lt;br /&gt;
Info : clock speed 950 kHz&lt;br /&gt;
Info : STLINK v2 JTAG v17 API v2 SWIM v0 VID 0x0483 PID 0x3748&lt;br /&gt;
Info : using stlink api v2&lt;br /&gt;
Info : Target voltage: 2.896454&lt;br /&gt;
Info : stm32f0x.cpu: hardware has 4 breakpoints, 2 watchpoints&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
(Don&#039;t worry about those warnings about the wrong clock speed for now...)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
In order to program the flash, connect to OpenOCD via telnet in another terminal:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
$ telnet 127.0.0.1 4444&lt;br /&gt;
Trying 127.0.0.1...&lt;br /&gt;
Connected to 127.0.0.1.&lt;br /&gt;
Escape character is &#039;^]&#039;.&lt;br /&gt;
Open On-Chip Debugger&lt;br /&gt;
&amp;gt; &lt;br /&gt;
&amp;gt; reset halt&lt;br /&gt;
target state: halted&lt;br /&gt;
target halted due to debug-request, current mode: Thread &lt;br /&gt;
xPSR: 0xc1000000 pc: 0x080014d0 msp: 0x20004000&lt;br /&gt;
&amp;gt; flash probe 0&lt;br /&gt;
device id = 0x20016448&lt;br /&gt;
flash size = 128kbytes&lt;br /&gt;
flash &#039;stm32f1x&#039; found at 0x08000000&lt;br /&gt;
&amp;gt; flash write_image erase build/STM32F072RBT6.elf&lt;br /&gt;
auto erase enabled&lt;br /&gt;
target state: halted&lt;br /&gt;
target halted due to breakpoint, current mode: Thread &lt;br /&gt;
xPSR: 0x61000000 pc: 0x2000003a msp: 0x20004000&lt;br /&gt;
wrote 6144 bytes from file build/STM32F072RBT6.elf in 0.503961s (11.906 KiB/s)&lt;br /&gt;
&amp;gt; reset run&lt;br /&gt;
&amp;gt; exit&lt;br /&gt;
Connection closed by foreign host.&lt;br /&gt;
$&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This should write the binary to the flash memory and start the program.&lt;br /&gt;
Of course, all those steps can be automated further and integrated into an IDE, but that&#039;s for later...&lt;br /&gt;
&lt;br /&gt;
To program the STM32F0Discovery board for example, this can be used to just flash the chip:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
$ openocd -f board/stm32f0discovery.cfg -c &amp;quot;program build/STM32F072RBT6.elf verify reset exit&amp;quot; &lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
To program a custom board for example with the STM32F0x chip, a command like this can be used:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
$ openocd -f interface/stlink-v2.cfg -f target/stm32f0x.cfg -c &amp;quot;program testSTM32F072_interrupt_test0.elf verify reset exit&amp;quot;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
To make things more convenient, add a new target &#039;&#039;flash&#039;&#039; to the Makefile with this command, and you can simply run &#039;&#039;make flash&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The exported main.c from STM32CubeMX was only slightly modified to let the user LEDs flash and react to the user pushbutton:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
******************************************************************************&lt;br /&gt;
* main.c *&lt;br /&gt;
******************************************************************************&lt;br /&gt;
&lt;br /&gt;
#include &amp;quot;stm32f0xx_hal.h&amp;quot;&lt;br /&gt;
&lt;br /&gt;
void SystemClock_Config(void);&lt;br /&gt;
static void MX_GPIO_Init(void);&lt;br /&gt;
&lt;br /&gt;
int main(void)&lt;br /&gt;
{&lt;br /&gt;
  /* Reset of all peripherals, Initializes the Flash interface and the Systick. */&lt;br /&gt;
  HAL_Init();&lt;br /&gt;
&lt;br /&gt;
  /* Configure the system clock */&lt;br /&gt;
  SystemClock_Config();&lt;br /&gt;
&lt;br /&gt;
  /* Initialize all configured peripherals */&lt;br /&gt;
  MX_GPIO_Init();&lt;br /&gt;
&lt;br /&gt;
  while (1)&lt;br /&gt;
  {&lt;br /&gt;
    uint32_t delay;&lt;br /&gt;
    if( HAL_GPIO_ReadPin( GPIOA, GPIO_PIN_0 ) == GPIO_PIN_SET )&lt;br /&gt;
      delay = 50;&lt;br /&gt;
    else&lt;br /&gt;
      delay = 250;&lt;br /&gt;
&lt;br /&gt;
    HAL_GPIO_TogglePin( GPIOC, GPIO_PIN_9 );&lt;br /&gt;
    HAL_Delay( delay );&lt;br /&gt;
    HAL_GPIO_TogglePin( GPIOC, GPIO_PIN_8 );&lt;br /&gt;
    HAL_Delay( delay );&lt;br /&gt;
    HAL_GPIO_TogglePin( GPIOC, GPIO_PIN_7 );&lt;br /&gt;
    HAL_Delay( delay );&lt;br /&gt;
    HAL_GPIO_TogglePin( GPIOC, GPIO_PIN_6 );&lt;br /&gt;
    HAL_Delay( delay );&lt;br /&gt;
&lt;br /&gt;
  }&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
/** System Clock Configuration&lt;br /&gt;
*/&lt;br /&gt;
void SystemClock_Config(void)&lt;br /&gt;
{&lt;br /&gt;
&lt;br /&gt;
  RCC_OscInitTypeDef RCC_OscInitStruct;&lt;br /&gt;
  RCC_ClkInitTypeDef RCC_ClkInitStruct;&lt;br /&gt;
&lt;br /&gt;
  RCC_OscInitStruct.OscillatorType = RCC_OSCILLATORTYPE_HSI;&lt;br /&gt;
  RCC_OscInitStruct.HSIState = RCC_HSI_ON;&lt;br /&gt;
  RCC_OscInitStruct.HSICalibrationValue = 16;&lt;br /&gt;
  RCC_OscInitStruct.PLL.PLLState = RCC_PLL_NONE;&lt;br /&gt;
  HAL_RCC_OscConfig(&amp;amp;RCC_OscInitStruct);&lt;br /&gt;
&lt;br /&gt;
  RCC_ClkInitStruct.ClockType = RCC_CLOCKTYPE_SYSCLK;&lt;br /&gt;
  RCC_ClkInitStruct.SYSCLKSource = RCC_SYSCLKSOURCE_HSI;&lt;br /&gt;
  RCC_ClkInitStruct.AHBCLKDivider = RCC_SYSCLK_DIV1;&lt;br /&gt;
  RCC_ClkInitStruct.APB1CLKDivider = RCC_HCLK_DIV1;&lt;br /&gt;
  HAL_RCC_ClockConfig(&amp;amp;RCC_ClkInitStruct, FLASH_LATENCY_0);&lt;br /&gt;
&lt;br /&gt;
  HAL_SYSTICK_Config(HAL_RCC_GetHCLKFreq()/1000);&lt;br /&gt;
&lt;br /&gt;
  HAL_SYSTICK_CLKSourceConfig(SYSTICK_CLKSOURCE_HCLK);&lt;br /&gt;
&lt;br /&gt;
  /* SysTick_IRQn interrupt configuration */&lt;br /&gt;
  HAL_NVIC_SetPriority(SysTick_IRQn, 0, 0);&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
/** Configure pins as&lt;br /&gt;
        * Analog&lt;br /&gt;
        * Input&lt;br /&gt;
        * Output&lt;br /&gt;
        * EVENT_OUT&lt;br /&gt;
        * EXTI&lt;br /&gt;
*/&lt;br /&gt;
void MX_GPIO_Init(void)&lt;br /&gt;
{&lt;br /&gt;
&lt;br /&gt;
  GPIO_InitTypeDef GPIO_InitStruct;&lt;br /&gt;
&lt;br /&gt;
  /* GPIO Ports Clock Enable */&lt;br /&gt;
  __GPIOA_CLK_ENABLE();&lt;br /&gt;
  __GPIOC_CLK_ENABLE();&lt;br /&gt;
&lt;br /&gt;
  /*Configure GPIO pin : PA0 */&lt;br /&gt;
  GPIO_InitStruct.Pin = GPIO_PIN_0;&lt;br /&gt;
  GPIO_InitStruct.Mode = GPIO_MODE_INPUT;&lt;br /&gt;
  GPIO_InitStruct.Pull = GPIO_NOPULL;&lt;br /&gt;
  HAL_GPIO_Init(GPIOA, &amp;amp;GPIO_InitStruct);&lt;br /&gt;
&lt;br /&gt;
  /*Configure GPIO pins : PC6 PC7 PC8 PC9 */&lt;br /&gt;
  GPIO_InitStruct.Pin = GPIO_PIN_6|GPIO_PIN_7|GPIO_PIN_8|GPIO_PIN_9;&lt;br /&gt;
  GPIO_InitStruct.Mode = GPIO_MODE_OUTPUT_PP;&lt;br /&gt;
  GPIO_InitStruct.Pull = GPIO_NOPULL;&lt;br /&gt;
  GPIO_InitStruct.Speed = GPIO_SPEED_LOW;&lt;br /&gt;
  HAL_GPIO_Init(GPIOC, &amp;amp;GPIO_InitStruct);&lt;br /&gt;
&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
(&lt;br /&gt;
Note that pins -- among various other things -- can be customized in the CubeMX editor. Reexporting code to an existing project is straight forward, and can be done easily while the old Makefile keeps valid for minor changes... - However, STM32CubeMX looks still quite unfinished to me. It&#039;s a nice concept, but where are all the ST libraries, for example for the [http://www.st.com/web/en/catalog/tools/FM147/CL1794/SC961/SS1743/LN1734/PF258658# touch functionality]? It still needs to be downloaded separately... and it comes in a bloody EXE file as well! *arghs*&lt;br /&gt;
&lt;br /&gt;
Unfortunately, things seem to be a bit confusing. If you&#039;re using a STM32F0, then probably need to take a look into the [http://www.st.com/web/catalog/tools/FM147/CL1794/SC961/SS1743/LN1897/PF260612?icmp=pf260612_pron_nb_jun2014&amp;amp;sc=stm32cubef0-pr STM32CubeF0] software bundle, which contains a more up-to-date TouchSensing Library... Hm.&lt;br /&gt;
&lt;br /&gt;
Also, note that most of the provided code by ST is only documented in the source files themselves... And there are at least two vastly differing versions of the basic functions out there, what makes copy/pasting/sharing a bit difficult. I even don&#039;t know if they continue working on this code base, or if they switch over to [https://www.mbed.com/en/ mbed]. That seems to be the focus of those newer [http://www.st.com/web/catalog/tools/FM116/SC959/SS1532/LN1847?sc=stm32nucleo Nucleo] evaluation boards.&lt;br /&gt;
)&lt;br /&gt;
&lt;br /&gt;
=== Debugging: GDB ===&lt;br /&gt;
&lt;br /&gt;
GDB can be used to debug the code right on the hardware. While OpenOCD is running, you can connect to the target like this and step through the program:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
$ arm-none-eabi-gdb -tui build/STM32F072RBT6.elf&lt;br /&gt;
(...)&lt;br /&gt;
Reading symbols from build/STM32F072RBT6.elf...done.&lt;br /&gt;
&lt;br /&gt;
(gdb) target remote :3333&lt;br /&gt;
Remote debugging using :3333&lt;br /&gt;
Python Exception &amp;lt;type &#039;exceptions.NameError&#039;&amp;gt; Installation error: gdb.execute_u&lt;br /&gt;
nwinders function is missing:&lt;br /&gt;
HAL_GetTick () at Drivers/STM32F0xx_HAL_Driver/Src/stm32f0xx_hal.c:298&lt;br /&gt;
&lt;br /&gt;
(gdb) c&lt;br /&gt;
Continuing.&lt;br /&gt;
&lt;br /&gt;
Program received signal SIGINT, Interrupt.&lt;br /&gt;
0x080002f6 in HAL_Delay (Python Exception &amp;lt;type &#039;exceptions.NameError&#039;&amp;gt; Installa&lt;br /&gt;
tion error: gdb.execute_unwinders function is missing:&lt;br /&gt;
Delay=250)&lt;br /&gt;
    at Drivers/STM32F0xx_HAL_Driver/Src/stm32f0xx_hal.c:317&lt;br /&gt;
&lt;br /&gt;
(gdb) break main.c:91&lt;br /&gt;
Breakpoint 1 at 0x8001392: file Src/main.c, line 91.&lt;br /&gt;
&lt;br /&gt;
(gdb) c&lt;br /&gt;
Continuing.&lt;br /&gt;
Note: automatically using hardware breakpoints for read-only addresses.&lt;br /&gt;
Python Exception &amp;lt;type &#039;exceptions.NameError&#039;&amp;gt; Installation error: gdb.execute_u&lt;br /&gt;
nwinders function is missing:&lt;br /&gt;
&lt;br /&gt;
Breakpoint 1, main () at Src/main.c:91&lt;br /&gt;
&lt;br /&gt;
(...)&lt;br /&gt;
(gdb) detach&lt;br /&gt;
(qdb) quit&lt;br /&gt;
$&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
(Note: the -tui option is really great to inspect the code... see [http://ftp.gnu.org/old-gnu/Manuals/gdb-5.1.1/html_chapter/gdb_19.html GDB Text User Interface])&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== IDE: Eclipse SW4STM32 ===&lt;br /&gt;
&lt;br /&gt;
GOOD NEWS: This officially supported Eclipse variant should work out of the box with STM32CubeMX generated project. You simply need to register on that site, and you&#039;ll get a software package that should work:&lt;br /&gt;
&lt;br /&gt;
[http://www.st.com/content/st_com/en/products/development-tools/software-development-tools/stm32-software-development-tools/stm32-ides/sw4stm32.html SW4STM32 - System Workbench for STM32: free IDE on Windows, Linux and OS X ]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
(Side note: I don&#039;t know how well it works when you have another Eclipse installed on your system... currently testing this out.)&lt;br /&gt;
&lt;br /&gt;
=== IDE: Eclipse with GNU ARM Eclipse plugin ===&lt;br /&gt;
&lt;br /&gt;
To use Eclipse as an IDE for the STM32s, just install Eclipse and a the GNU ARM Eclipse Plugin.&lt;br /&gt;
&lt;br /&gt;
* Eclipse IDE for C/C++ (CDT). This can be installed manually or with your package manager.&lt;br /&gt;
* Eclipse Plugin: [https://gnuarmeclipse.github.io/ GNU ARM Eclipse]. - This can be done in the Eclipse Marketplace (under &#039;&#039;Help &amp;gt; Eclipse Marketplace&#039;&#039; (use the default options)).&lt;br /&gt;
* Create a new Eclipse project with the GNU ARM Eclipse (Choose STM32Fxxx C/C++ Project in the Wizard)&lt;br /&gt;
&lt;br /&gt;
With some minor adjustments in the settings (OpenOCD), the basic Blinky example that comes with the plugin should work out of the box, with a STLink v2 programmer. Code completion etc. works fine too.&lt;br /&gt;
&lt;br /&gt;
(/todo: show every step)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
But there&#039;s quite annoying problem with this workflow!:&lt;br /&gt;
&lt;br /&gt;
http://www.carminenoviello.com/en/2015/06/04/stm32-applications-eclipse-gcc-stcube/:&lt;br /&gt;
&amp;lt;blockquote&amp;gt;&lt;br /&gt;
Unfortunately, the plug-in author has updated just the template for STM32-F4 family to the more recently STM32Cube-F4 HAL framework from ST (which still supports only commercial IDE.....), leaving the other templates still based on the old Standard Peripheral Library, which is no longer supported by ST and STM32CubeMX tool used in my tutorial. This causes my instructions to be wrong for processor families different from STM32-F4. &lt;br /&gt;
&amp;lt;/blockquote&amp;gt;&lt;br /&gt;
&lt;br /&gt;
So, several manual setup steps will be required to get started with your own STM32 project. To goal is to configure the project in STM32CubeMX, and use up-to-date HAL code, and not the deprecated Standard Peripheral Library.&lt;br /&gt;
&lt;br /&gt;
The GNU ARM Eclipse plugin is great, but doesn&#039;t create projects with up-to-date code. So we need to modify the manually created GNU ARM Eclipse project. - I used a custom STM32F072C8 board, and all steps below assum this hardware. The steps would be slightly different for other hardware.&lt;br /&gt;
&lt;br /&gt;
([http://www.carminenoviello.com/en/2015/06/04/stm32-applications-eclipse-gcc-stcube This tutorial] was helping here...)&lt;br /&gt;
&lt;br /&gt;
* First create a new &#039;C Project&#039; in your Eclipse workspace.&lt;br /&gt;
* In Wizard slide &#039;&#039;C Project&#039;&#039;: Choose Executable &amp;gt; &#039;&#039;Hello World ARM Cortex-M C/C++ Project&#039;&#039; and give it a name (e.g. testSTM32_00). This will generate a generic ARM project instead of an STM32Fxxx one. - Then hit &#039;&#039;Next&#039;&#039;.&lt;br /&gt;
* In Wizard slide &#039;&#039;Target processor settings&#039;&#039;: Configure the target processor: For the STM32F072C8: Change the defaults to Flash size (kB): 64, RAM size (kB): 16, Use system calls: Freestanding (no POSIX system calls), Trace output: None (no trace output). - Then hit &#039;&#039;Next&#039;&#039;.&lt;br /&gt;
* In Wizard slide &#039;&#039;Folders&#039;&#039;: Change Vendor CMSIS name to stm32f0xx. - Then hit next.&lt;br /&gt;
* In Wizard slide &#039;&#039;Select Configurations&#039;&#039;: Leave as is. - Then hit &#039;&#039;Next&#039;&#039;.&lt;br /&gt;
* In Wizard slide &#039;&#039;Cross GNU ARM Toolchain&#039;&#039;: Select &#039;&#039;GNU Tools for ARM Embedded Processors (arm-none-eabi-gcc)&#039;&#039; and either choose the global, system wide toolchain (probably in /usr/bin) or enter the path to your custom one. - Then hit &#039;&#039;Finish&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
This will create a generic ARM project, which should build without errors (hit Ctrl+B). &lt;br /&gt;
&lt;br /&gt;
Next, we need to add the vendor specific HAL code by ST generated with STM32CubeMX and/or downloaded in a more specific firmware package (STM32CubeF0, STM32CubeF4 etc.).&lt;br /&gt;
&lt;br /&gt;
...&lt;br /&gt;
So, after configuring a generic Eclipse project, we&#039;re ready to modify it.&lt;br /&gt;
&lt;br /&gt;
* Configure and export an EWARM project in [http://www.st.com/web/en/catalog/tools/PF259242 STM32CubeMX] (with default settings).&lt;br /&gt;
&lt;br /&gt;
* Extract the [http://www.st.com/web/en/catalog/tools/PF260612 STM32CubeF0] archive. ([http://www.st.com/web/en/catalog/tools/PF260820 STM32CubeF1], [http://www.st.com/web/en/catalog/tools/PF260266 STM32CubeF2], [http://www.st.com/web/en/catalog/tools/PF260613 STMCubeF3], [http://www.st.com/web/en/catalog/tools/PF259243 STMCubeF4]).&lt;br /&gt;
&lt;br /&gt;
As a starting point, here&#039;s a bash script, that modifies the previously created Eclipse project:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
#!/usr/bin/env bash&lt;br /&gt;
&lt;br /&gt;
set -e&lt;br /&gt;
&lt;br /&gt;
#echo &amp;quot;Press CTRL+C to proceed.&amp;quot;&lt;br /&gt;
#trap &amp;quot;pkill -f &#039;sleep 1h&#039;&amp;quot; INT&lt;br /&gt;
#trap &amp;quot;set +x ; sleep 1h ; set -x&amp;quot; DEBUG&lt;br /&gt;
&lt;br /&gt;
# MODIFY THIS!&lt;br /&gt;
ECLIPSE_PROJECT=/run/media/rel/prc/code/workspace_testSTM32_01/testSTM32_00&lt;br /&gt;
STM32CUBEF0=/home/rel/src/STM32Cube_FW_F0_V1.4.0&lt;br /&gt;
STM32CUBEMX=/home/rel/Desktop/test_stm32cubemx_ewarm&lt;br /&gt;
&lt;br /&gt;
echo --------------------------------------------------------------------------------&lt;br /&gt;
echo Eclipse Project Initializer for STM32F072 Dev&lt;br /&gt;
echo --------------------------------------------------------------------------------&lt;br /&gt;
&lt;br /&gt;
echo&lt;br /&gt;
echo The script is using the following paths:&lt;br /&gt;
echo&lt;br /&gt;
echo Eclipse Project:&lt;br /&gt;
echo $ECLIPSE_PROJECT&lt;br /&gt;
echo&lt;br /&gt;
echo STM32Cube:&lt;br /&gt;
echo $STM32CUBEF0&lt;br /&gt;
echo&lt;br /&gt;
echo STM32CubeMX:&lt;br /&gt;
echo $STM32CUBEMX&lt;br /&gt;
&lt;br /&gt;
echo&lt;br /&gt;
echo -n &amp;quot;Do you want to proceed? [ENTER]&amp;quot;&lt;br /&gt;
read&lt;br /&gt;
&lt;br /&gt;
echo&lt;br /&gt;
echo Deleting files from eclipse project:&lt;br /&gt;
rm -fv $ECLIPSE_PROJECT/src/main.c&lt;br /&gt;
rm -fv $ECLIPSE_PROJECT/src/Timer.c&lt;br /&gt;
rm -fv $ECLIPSE_PROJECT/include/Timer.h&lt;br /&gt;
&lt;br /&gt;
rm -fv $ECLIPSE_PROJECT/system/include/cmsis/stm32f0xx.h&lt;br /&gt;
rm -fv $ECLIPSE_PROJECT/system/include/cmsis/system_stm32f0xx.h&lt;br /&gt;
&lt;br /&gt;
rm -fv $ECLIPSE_PROJECT/system/src/cmsis/system_stm32f0xx.c&lt;br /&gt;
rm -fv $ECLIPSE_PROJECT/system/src/cmsis/vectors_stm32f0xx.c&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
echo&lt;br /&gt;
echo Copying: ST HAL:&lt;br /&gt;
cp -rfv $STM32CUBEF0/Drivers/STM32F0xx_HAL_Driver/Src/* \&lt;br /&gt;
$ECLIPSE_PROJECT/system/src/stm32f0xx&lt;br /&gt;
&lt;br /&gt;
cp -rfv $STM32CUBEF0/Drivers/STM32F0xx_HAL_Driver/Inc/* \&lt;br /&gt;
$ECLIPSE_PROJECT/system/include/stm32f0xx&lt;br /&gt;
&lt;br /&gt;
cp -rfv $STM32CUBEF0/Drivers/CMSIS/Device/ST/STM32F0xx/Include/* \&lt;br /&gt;
$ECLIPSE_PROJECT/system/include/cmsis&lt;br /&gt;
&lt;br /&gt;
cp -fv $STM32CUBEF0/Drivers/CMSIS/Device/ST/STM32F0xx/Source/Templates/gcc/startup_stm32f072xb.s \&lt;br /&gt;
$ECLIPSE_PROJECT/system/src/cmsis/startup_stm32f072xb.S&lt;br /&gt;
&lt;br /&gt;
cp -fv $STM32CUBEF0/Drivers/CMSIS/Device/ST/STM32F0xx/Source/Templates/system_stm32f0xx.c \&lt;br /&gt;
$ECLIPSE_PROJECT/system/src/cmsis&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
# echo Copying: example project from STM32CubeF0:&lt;br /&gt;
#cp $STM32CUBEF0/Projects/STM32F072B-Discovery/Examples/GPIO/GPIO_IOToggle/Inc/* \&lt;br /&gt;
#$ECLIPSE_PROJECT/include&lt;br /&gt;
&lt;br /&gt;
#cp $STM32CUBEF0/Projects/STM32F072B-Discovery/Examples/GPIO/GPIO_IOToggle/Src/main.c \&lt;br /&gt;
#$ECLIPSE_PROJECT/src&lt;br /&gt;
&lt;br /&gt;
#cp $STM32CUBEF0/Projects/STM32F072B-Discovery/Examples/GPIO/GPIO_IOToggle/Src/stm32f0xx_it.c \&lt;br /&gt;
#$ECLIPSE_PROJECT/src&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
echo&lt;br /&gt;
echo Copying: example project from STM32CubeMX:&lt;br /&gt;
cp $STM32CUBEMX/Src/* $ECLIPSE_PROJECT/src&lt;br /&gt;
cp $STM32CUBEMX/Inc/* $ECLIPSE_PROJECT/include&lt;br /&gt;
&lt;br /&gt;
echo&lt;br /&gt;
echo Modifiying/fixing the memory map:&lt;br /&gt;
echo $ECLIPSE_PROJECT/ldscripts/mem.ld&lt;br /&gt;
sed -i &#039;s/FLASH (rx) : ORIGIN = 0x00000000/FLASH (rx) : ORIGIN = 0x08000000/g&#039; $ECLIPSE_PROJECT/ldscripts/mem.ld&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
echo&lt;br /&gt;
echo SUCCESS&lt;br /&gt;
echo&lt;br /&gt;
&lt;br /&gt;
echo&lt;br /&gt;
echo Now, exclude the following file from the Eclipse project manually:&lt;br /&gt;
ls $ECLIPSE_PROJECT/system/src/stm32f0xx/stm32f0xx_hal_msp_template.c&lt;br /&gt;
&lt;br /&gt;
echo&lt;br /&gt;
echo And add the following preprocessor constants to the C/C++ compiler settings in Eclipse:&lt;br /&gt;
echo USE_HAL_DRIVER&lt;br /&gt;
echo STM32F072xB&lt;br /&gt;
&lt;br /&gt;
echo&lt;br /&gt;
echo &amp;quot;And add the following config options to the GDB OpenOCD Debugging settings (in Run Configurations):&amp;quot;&lt;br /&gt;
echo &amp;quot;-f interface/stlink-v2.cfg -f target/stm32f0x.cfg&amp;quot;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This script needs to be modified according to your needs! (Currently is working for the STM32F072C8, and contains fixed paths! - Note that there minor inconsistencies in some of these ST projects. For example, all the provided STM32F072xB* files by ST work for both types of chips -- STM32F072x8 and STM32F072xB.)&lt;br /&gt;
&lt;br /&gt;
Like described in the script above, some minor manual changes need to be made in Eclipse after running the script.&lt;br /&gt;
&lt;br /&gt;
This should now be a good basis to start a new STM32 project.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Note that the GNU ARM Eclipse plugin always generates a Makefile for every project configuration (Debug / Release). It can be found in &amp;lt;project_folder&amp;gt;/Debug pr &amp;lt;project_folder&amp;gt;/Release respectively.&lt;br /&gt;
&lt;br /&gt;
==== Semihosting ====&lt;br /&gt;
&lt;br /&gt;
http://infocenter.arm.com/help/index.jsp?topic=/com.arm.doc.dui0471c/Bgbjjgij.html:&lt;br /&gt;
&amp;lt;blockquote&amp;gt;&lt;br /&gt;
What is semihosting?&lt;br /&gt;
&lt;br /&gt;
Semihosting is a mechanism that enables code running on an ARM target to communicate and use the Input/Output facilities on a host computer that is running a debugger.&lt;br /&gt;
&lt;br /&gt;
Examples of these facilities include keyboard input, screen output, and disk I/O.&lt;br /&gt;
&amp;lt;/blockquote&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The GNU ARM Eclipse plugin comes with a really bare-bone implementation of some semihosting print functions that can be used to print logs to the console right in Eclipse (over GDB, without using any additional serial/UART connection whatsoever).&lt;br /&gt;
&lt;br /&gt;
Since I&#039;d always create a project without Semihosting enabled in the GNU ARM Eclipse wizard, you can still easily enable it later on:&lt;br /&gt;
&lt;br /&gt;
The easiest way I&#039;ve found so far, is by defining those Preprocessor constants in the C/C++ Project settings (Projects &amp;gt; Properties &amp;gt; C/C++ Build &amp;gt; Settings &amp;gt; Cross ARM GNU C/C++ Compiler &amp;gt; Preprocessor):&lt;br /&gt;
* TRACE&lt;br /&gt;
* OS_USE_TRACE_SEMIHOSTING_STDOUT&lt;br /&gt;
&lt;br /&gt;
And then, by using the following function calls in your code to log stuff to the Eclipse console right away:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
trace_initialize(); // in fact not required&lt;br /&gt;
// (...)&lt;br /&gt;
static int i = 0;&lt;br /&gt;
trace_puts( &amp;quot;hello&amp;quot; );&lt;br /&gt;
trace_printf( &amp;quot;nr %d\n&amp;quot;, i++ );&lt;br /&gt;
HAL_Delay( 1000 );  &lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
These functions were implemented by the author of GNU ARM Eclipse [https://github.com/ilg-ul Liviu Ionescu], and can be looked up in these files:&lt;br /&gt;
* &amp;lt;eclipse_project&amp;gt;/system/include/arm/semihosting.h&lt;br /&gt;
* &amp;lt;eclipse_project&amp;gt;/system/include/diag/Trace.h&lt;br /&gt;
* &amp;lt;eclipse_project&amp;gt;/system/src/diag/Trace.c&lt;br /&gt;
* &amp;lt;eclipse_project&amp;gt;/system/src/diag/trace_impl.c&lt;br /&gt;
&lt;br /&gt;
An interesting comment in &#039;&#039;trace_impl.c:133&#039;&#039; says:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
// Semihosting is the other output channel that can be used for the trace&lt;br /&gt;
// messages. It comes in two flavours: STDOUT and DEBUG. The STDOUT channel&lt;br /&gt;
// is the equivalent of the stdout in POSIX and in most cases it is forwarded&lt;br /&gt;
// to the GDB server stdout stream. The debug channel is a separate&lt;br /&gt;
// channel. STDOUT is buffered, so nothing is displayed until a \n;&lt;br /&gt;
// DEBUG is not buffered, but can be slow.&lt;br /&gt;
//&lt;br /&gt;
// Choosing between semihosting stdout and debug depends on the capabilities&lt;br /&gt;
// of your GDB server, and also on specific needs. It is recommended to test&lt;br /&gt;
// DEBUG first, and if too slow, try STDOUT.&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Note that semihosting needs to be enabled in your Eclipse run configuration (it is by default), in the Startup tab &amp;gt; Enable ARM semihosting. This will tell GDB to use semihosting. Without enabling, calls to those trace_* functions will throw some kind of exception... and make the processor halt. I couldn&#039;t find out much yet about how this feature really works, somehow it uses a special BKPT instruction...&lt;br /&gt;
&lt;br /&gt;
Semihosting (OS_USE_TRACE_SEMIHOSTING_STDOUT) can also be used in &amp;quot;Release&amp;quot; builds, since the semihosted calls don&#039;t rely on debug symbols.&lt;br /&gt;
&lt;br /&gt;
=== IDE: Code::Blocks ===&lt;br /&gt;
&lt;br /&gt;
My favorite cross-platform IDE for C/C++ is Code::Blocks. - And luckily, it also works well for ARM development! After twiddling around with those confusing Eclipse settings, I&#039;ve almost forgot to try out and setup Code::Blocks.&lt;br /&gt;
&lt;br /&gt;
The steps required are bit unintuitive, but building and debugging projects with full auto-complete and indexer support works now.&lt;br /&gt;
&lt;br /&gt;
The advantages over using Eclipse:&lt;br /&gt;
* Faster GUI.&lt;br /&gt;
* Works with STM32CubeMX generated code.&lt;br /&gt;
* Uses just a plain/manually editable Makefile to build the project.&lt;br /&gt;
* Familiar C/C++ settings and more *transparent* project handling -&amp;gt; Edit + debug. Nothing more. Everything can be done by hand on a console too. No mysterious hidden helpers...&lt;br /&gt;
&lt;br /&gt;
I&#039;m still evaluating this workflow... But to get things up and running, you can do this:&lt;br /&gt;
&lt;br /&gt;
(Assuming you already have a working Makefile based project, e.g. [http://wiki.sgmk-ssam.ch/wiki/STM32_dev#STM32CubeMX_to_Makefile created with STM32CubeMX, like described above]).&lt;br /&gt;
&lt;br /&gt;
* Open Code::Blocks and create an &#039;&#039;&#039;empty&#039;&#039;&#039; project (&#039;&#039;File &amp;gt; New &amp;gt; Project &amp;gt; Empty project&#039;&#039;).&lt;br /&gt;
* Give it a name in the Wizard, and choose the &#039;&#039;GNU GCC Compiler for ARM&#039;&#039;, and save it. &lt;br /&gt;
* Copy all content of the Makefile project over to Code::Blocks project folder.&lt;br /&gt;
* Import all required source files into the Code::Blocks workspace (right click -&amp;gt; &#039;&#039;Add files recursively...&#039;&#039;). &lt;br /&gt;
* Check &#039;&#039;Project &amp;gt; Properties &amp;gt; Project settings &amp;gt; Makefile: This is a custom Makefile&#039;&#039;.&lt;br /&gt;
* Adjust the build settings in &#039;&#039;Project &amp;gt; Build options &amp;gt; &amp;quot;Make commands&amp;quot;&#039;&#039;. - This might either require you to change the Makefile (i.e. add Debug/Release targets), or the commands. - For simplicity&#039;s sake, just ignore those $make, $makefile variables and overwrite them with your actual commands (i.e.&#039;&#039;$make -f $makefile $target&#039;&#039; -&amp;gt; &#039;&#039;make all&#039;&#039;).&lt;br /&gt;
* &#039;&#039;Build&#039;&#039; the project and check in the &#039;&#039;Build log&#039;&#039; if there where any errors/warnings.&lt;br /&gt;
&lt;br /&gt;
So, if this is working now, try to edit a source file and see if those really useful auto-complete and jump to declaration/implementation features are working. - One caveat of using an external Makefile is that the IDE doesn&#039;t know the current settings. So, for example, #defines are not available, and syntax highlighting will not update automatically... So it might be worth it add settings manually at some point.&lt;br /&gt;
&lt;br /&gt;
Now, to get the flashing and debugging working, try this:&lt;br /&gt;
&lt;br /&gt;
* Go to the &#039;&#039;Settings &amp;gt; Debugger&#039;&#039; Settings.&lt;br /&gt;
* Add a new GDB debugger setting (hit &#039;&#039;Create Config&#039;&#039; and call it &#039;&#039;ARM OpenOCD&#039;&#039; for example).&lt;br /&gt;
* Change the &#039;&#039;Executable path&#039;&#039; according to your toolchains location, and check &#039;Do *not* run the debugee&#039;.&lt;br /&gt;
* Go to &#039;&#039;Projects &amp;gt; Properties &amp;gt; Debugger&#039;&#039;.&lt;br /&gt;
** Change the &amp;lt;Project&amp;gt; &#039;&#039;Remote connection&#039;&#039; settings to IP: 127.0.0.1 / Port: 3333.&lt;br /&gt;
** Go to the &amp;lt;Project&amp;gt; &#039;&#039;Additional GDB commands&#039;&#039; tab. And enter those commands into the &#039;&#039;After connection&#039;&#039; box (change filename!):&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
monitor halt&lt;br /&gt;
load ./build/test.elf&lt;br /&gt;
file ./build/test.elf&lt;br /&gt;
monitor sleep 1000&lt;br /&gt;
monitor reset&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
To not run the program automatically, remove the last two commands. Then you need to &#039;&#039;Start / Continue&#039;&#039; the program twice, but you&#039;ll catch the first breakpoint you&#039;ve set!&lt;br /&gt;
* Choose &#039;&#039;Debug &amp;gt; Active Debuggers &amp;gt; GDB/CDB Debugger: ARM OpenOCD&#039;&#039;.&lt;br /&gt;
* Start OpenOCD in a terminal. (Described above).&lt;br /&gt;
* Start debugging by pressing the red arrow (Run / continue) in the debugging toolbar.&lt;br /&gt;
&lt;br /&gt;
The steps are the same as the ones in [http://www.hackvandedam.nl/blog/?p=707 this tutorial &#039;&#039;&#039;with screenshots&#039;&#039;&#039;].&lt;br /&gt;
&lt;br /&gt;
=== stlink ===&lt;br /&gt;
&lt;br /&gt;
[https://github.com/texane/stlink stlink] is a command line tool for programming, inspecting and debugging the STM32 microcontrollers. It also used internally by OpenOCD (I think). - It comes with several small programs (st-flash, st-info, st-term, st-util) that can come in handy while working with the STM32 micros.&lt;br /&gt;
&lt;br /&gt;
There&#039;s a tutorial:&lt;br /&gt;
https://github.com/texane/stlink/blob/master/doc/tutorial/tutorial.pdf&lt;br /&gt;
&lt;br /&gt;
Some useful things I&#039;ve discovered:&lt;br /&gt;
&lt;br /&gt;
Just run st-util can Ctrl-C again to see all relevant uC properties:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
$ st-util&lt;br /&gt;
2016-01-29T13:06:25 INFO src/stlink-common.c: Loading device parameters....&lt;br /&gt;
2016-01-29T13:06:25 INFO src/stlink-common.c: Device connected is: F07x device, id 0x20016448&lt;br /&gt;
2016-01-29T13:06:25 INFO src/stlink-common.c: SRAM size: 0x4000 bytes (16 KiB), Flash: 0x10000 bytes (64 KiB) in pages of 2048 bytes&lt;br /&gt;
2016-01-29T13:06:25 INFO gdbserver/gdb-server.c: Chip ID is 00000448, Core ID is  0bb11477.&lt;br /&gt;
2016-01-29T13:06:25 INFO gdbserver/gdb-server.c: Target voltage is 3554 mV.&lt;br /&gt;
2016-01-29T13:06:25 INFO gdbserver/gdb-server.c: Listening at *:4242...&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Or with st-info:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
$ st-info &lt;br /&gt;
st-info --flash&lt;br /&gt;
st-info --sram&lt;br /&gt;
st-info --descr&lt;br /&gt;
st-info --pagesize&lt;br /&gt;
st-info --chipid&lt;br /&gt;
$ st-info --flash&lt;br /&gt;
0x10000&lt;br /&gt;
$ st-info --sram&lt;br /&gt;
0x4000&lt;br /&gt;
$ st-info --descr&lt;br /&gt;
F07x device&lt;br /&gt;
$ st-info --pagesize&lt;br /&gt;
0x800&lt;br /&gt;
$ st-info --chipid&lt;br /&gt;
0x0448&lt;br /&gt;
&lt;br /&gt;
$ echo `st-info --sram | xargs -I@ printf &amp;quot;%d/1024\n&amp;quot; @ | bc`kB RAM&lt;br /&gt;
16kB RAM&lt;br /&gt;
$ echo `st-info --flash | xargs -I@ printf &amp;quot;%d/1024\n&amp;quot; @ | bc`kB FLASH&lt;br /&gt;
64kB FLASH&lt;br /&gt;
&lt;br /&gt;
$ for a in sram flash pagesize; do echo `st-info --$a | xargs -I@ printf &amp;quot;%d/1024\n&amp;quot; @ | bc`kb $a; done&lt;br /&gt;
16kb sram&lt;br /&gt;
64kb flash&lt;br /&gt;
2kb pagesize&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Or simply:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
$ st-info --probe&lt;br /&gt;
Found 1 stlink programmers&lt;br /&gt;
 serial: 303030303030303030303031&lt;br /&gt;
openocd: &amp;quot;\x30\x30\x30\x30\x30\x30\x30\x30\x30\x30\x30\x31&amp;quot;&lt;br /&gt;
  flash: 131072 (pagesize: 256)&lt;br /&gt;
   sram: 16384&lt;br /&gt;
 chipid: 0x0416&lt;br /&gt;
  descr: L1 Med-density device&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Links ===&lt;br /&gt;
&lt;br /&gt;
==== Tools ====&lt;br /&gt;
* [https://gnuarmeclipse.github.io/ GNU ARM Eclipse]: [https://gnuarmeclipse.github.io/eclipse/workspace/preferences/ workspace_preferences], [http://gnuarmeclipse.github.io/toolchain/path/ toolchain_path], [http://gnuarmeclipse.github.io/eclipse/project/portability/ project_portability]&lt;br /&gt;
&lt;br /&gt;
==== Tutorials ====&lt;br /&gt;
* Great introduction: [http://www.triplespark.net/elec/pdev/arm/stm32.html Programming STM32 F2, F4 ARMs under Linux: A Tutorial from Scratch]&lt;br /&gt;
* STM32Cube to GNU ARM Eclipse tips: http://www.carminenoviello.com/en/2015/06/04/stm32-applications-eclipse-gcc-stcube/&lt;br /&gt;
* Micro Python on STM32F4-Discovery: http://gpio.kaltpost.de/?p=2082&lt;br /&gt;
* Logs: https://hackaday.io/project/4277/logs?page=2&lt;br /&gt;
* Code::Blocks tutorial: http://www.hackvandedam.nl/blog/?p=707&lt;br /&gt;
* Eclipse tutorial: http://www.carminenoviello.com/en/2015/06/04/stm32-applications-eclipse-gcc-stcube&lt;br /&gt;
* http://sigalrm.blogspot.ch/2013/12/using-ccm-memory-on-stm32.html&lt;br /&gt;
* http://stm32f4-discovery.com/2014/08/stm32f4-external-interrupts-tutorial/&lt;br /&gt;
* ...&lt;br /&gt;
&lt;br /&gt;
==== Projects / Demos / Code ====&lt;br /&gt;
* MrBlueXav&#039;s Synths: https://github.com/MrBlueXav&lt;br /&gt;
* cliffle&#039;s VGA stuff: https://github.com/cbiffle/m4vgalib-demos, http://cliffle.com/article/2015/06/05/introducing-glitch/&lt;br /&gt;
* ESPruino code: https://github.com/espruino/Espruino -&amp;gt; STM32F401CDU6&lt;br /&gt;
* STM32F4 Audio Codec Board: http://ebrombaugh.studionebula.com/synth/stm32f4_codec/&lt;br /&gt;
* ESPRUINO: http://www.espruino.com/ReferenceSTM32F4DISCOVERY&lt;br /&gt;
* micropython: https://github.com/micropython/micropython&lt;br /&gt;
* STM32F4 DIY: http://mikrocontroller.bplaced.net/wordpress/?page_id=1482&lt;br /&gt;
* STM32F4 overclocking: http://sigalrm.blogspot.ch/2014/01/overclocking-stm32f4.html&lt;br /&gt;
* thermal camera: http://www.theresistornetwork.com/2014/11/flir-lepton-thermal-imaging-sensor.html&lt;br /&gt;
* STM32F7: http://hackaday.com/2015/06/26/new-part-day-stm32f7-an-arm-cortex-m7/&lt;br /&gt;
* Karsten Schmidt: http://workshop.thi.ng/ [https://soundcloud.com/forthcharlie soundcloud] https://github.com/thi-ng/ws-ldn-4 https://github.com/thi-ng/ws-ldn-3 http://asm.thi.ng/&lt;br /&gt;
* Peridrummmm Demo: http://www.pouet.net/prod.php?which=59095 with sources: http://aka-san.halcy.de/revision2012/peridiummmm-src.zip&lt;br /&gt;
* Andy&#039;s Workshop: http://andybrown.me.uk/&lt;br /&gt;
* axoloti: http://axoloti.com/&lt;br /&gt;
&lt;br /&gt;
==== Libraries ====&lt;br /&gt;
* libopencm3 http://libopencm3.org/wiki/Main_Page&lt;br /&gt;
* list of libs: http://mikrocontroller.bplaced.net/wordpress/?page_id=2736&lt;br /&gt;
&lt;br /&gt;
==== OS ====&lt;br /&gt;
* FreeRTOS: http://www.freertos.org/index.html&lt;br /&gt;
* Embedded Linux on STM32: https://github.com/EmcraftSystems&lt;br /&gt;
* ChibiOS: http://www.chibios.org/dokuwiki/&lt;br /&gt;
&lt;br /&gt;
==== General ====&lt;br /&gt;
* ARM Related Books: http://www.arm.com/support/resources/arm-books/&lt;br /&gt;
* STM32 Overview http://www.st.com/web/en/catalog/mmc/FM141/SC1169?sc=stm32&lt;br /&gt;
* mbed https://en.wikipedia.org/wiki/Mbed&lt;br /&gt;
* CMSIS: http://www.keil.com/pack/doc/cmsis/Core/html/index.html&lt;br /&gt;
&lt;br /&gt;
== Hardware ==&lt;br /&gt;
&lt;br /&gt;
All about hardware and hardware tools for STM32 dev. Chips, programmers etc.&lt;br /&gt;
&lt;br /&gt;
=== ST-Link V2 Programmer ===&lt;br /&gt;
&lt;br /&gt;
There are two popular ST-Link V2 Progammers on the market. They have a different pinout but work both well like described above.&lt;br /&gt;
&lt;br /&gt;
[[File:ST-LinkV2_pinout_01.jpg]]&lt;br /&gt;
&lt;br /&gt;
Alternatively, STM32Discovery/[http://jeelabs.org/book/1547a/index.html Nucleo boards too can be used as SWD programmers].&lt;br /&gt;
&lt;br /&gt;
Luckily, only 4 pins have to be used to program and debug the target!&lt;br /&gt;
To find out more about this protocol, have a look into [http://www.arm.com/products/system-ip/debug-trace/coresight-soc-components/serial-wire-debug.php Serial Debug Wire (SWD)] as an alternative to JTAG.&lt;br /&gt;
&lt;br /&gt;
Connect to following pins of the programmer to the corresponding pins on the PCB:&lt;br /&gt;
&lt;br /&gt;
* V3V&lt;br /&gt;
* GND&lt;br /&gt;
* SWCLK&lt;br /&gt;
* SWDIO&lt;br /&gt;
&lt;br /&gt;
-&amp;gt; NRST can be important too on some STM32 chips!&lt;br /&gt;
&lt;br /&gt;
Remember: These are &#039;&#039;&#039;not&#039;&#039;&#039; the [http://www.st.com/web/catalog/tools/FM146/CL1984/SC724/SS1677/PF251168 official ST-Link V2 Programmers], sold by ST.&lt;br /&gt;
&lt;br /&gt;
== Projects ==&lt;br /&gt;
&lt;br /&gt;
STM32 based projects.&lt;br /&gt;
&lt;br /&gt;
=== STM32basic ===&lt;br /&gt;
&lt;br /&gt;
STM32basic is a test board to see how STM32 chips can be used in DIY circuits.&lt;br /&gt;
&lt;br /&gt;
==== STM32basic rev0.01 ====&lt;br /&gt;
&lt;br /&gt;
An initial list of tests:&lt;br /&gt;
&lt;br /&gt;
* JTAG: See how we can program the thing. Do we need all JTAG pins? Or only the SWD pins? What about reset? - Do the cheapo Chinese STLink V2 programmer really work?&lt;br /&gt;
* Basic I/O: LED and push button.&lt;br /&gt;
* U(S)ART: Check whether it&#039;s possible to hook up an FTDI to send/receive characters to/from the STM32basic?&lt;br /&gt;
* BOOT0/1: What about those boot modes?&lt;br /&gt;
* Power Usage : 3V3 Regulator: ..&lt;br /&gt;
&lt;br /&gt;
[[File:STM32basic_pcb1b.jpg]]&lt;br /&gt;
&lt;br /&gt;
Board at OSH Park:&amp;lt;br /&amp;gt;&lt;br /&gt;
https://oshpark.com/shared_projects/kCD7Yr0A&lt;br /&gt;
&lt;br /&gt;
KiCad project and everything else:&amp;lt;br /&amp;gt;&lt;br /&gt;
Remark: this has been made in hurry and is just a test:&amp;lt;br /&amp;gt;&lt;br /&gt;
http://0rel.com/prj/STM32basic/STM32basic_rev0.01.zip&lt;br /&gt;
&lt;br /&gt;
[[File:Stm32basic1.jpg]]&lt;br /&gt;
&lt;br /&gt;
So far, the tests have been working ok.&lt;br /&gt;
&lt;br /&gt;
* STLink V2 programmers seem to work fine, and only require 2 pins + VCC/GND! SWDIO and SWCLK, that&#039;s it! For programming and on-chip debugging.&lt;br /&gt;
* I/O works as well. External interrupts can be configured.&lt;br /&gt;
* UART works, but I have not yet tested it with a proper code. It was working with some echo snippet I&#039;ve found somewhere.&lt;br /&gt;
* Power usage is low. ~15 mA at 3.3 V.&lt;br /&gt;
* BOOT0 jumper has to be set (connected to ground) in order to run code... - Other boot modes have not been tested yet. More tests are needed there... What are the other available boot modes, what about those built-in boot loaders?&lt;br /&gt;
&lt;br /&gt;
However, the board has several flaws:&lt;br /&gt;
* 1.27 mm pin-pitch headers cannot be arranged like that (GPIOs). They need to be further apart to make sockets/headers fit.&lt;br /&gt;
* 3V3 LDO doesn&#039;t make much sense like this. Add add a buck/boost converter. Also remove 5V label.&lt;br /&gt;
* This BOOT0 jumper isn&#039;t nice like this...&lt;br /&gt;
* Remove unnecessary JTAG pins. SWD only.&lt;br /&gt;
* Remove unnecessary USART pins.&lt;br /&gt;
* Add crystal.&lt;br /&gt;
* Add USB plug.&lt;br /&gt;
&lt;br /&gt;
Probably, this will not be remade, since it was enough for a test. I&#039;d like to make a very basic USB touch device next.&lt;br /&gt;
&lt;br /&gt;
==== STM32basic Eclipse project ====&lt;br /&gt;
&lt;br /&gt;
Test project to see if GPIOs with External interrupts and semi hosting works. Sloppy and not cleaned up yet...&amp;lt;br /&amp;gt;&lt;br /&gt;
http://0rel.com/prj/STM32basic/testSTM32F072_interrupt_test0.zip&lt;br /&gt;
&lt;br /&gt;
Note: Eclipse projects can be imported in an existing or new workspace with: &#039;&#039;File &amp;gt; Import &amp;gt; General &amp;gt; Existing Projects into Workspace&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
=== todo ===&lt;br /&gt;
&lt;br /&gt;
* I2C peripherals&lt;br /&gt;
* I2S peripherals&lt;br /&gt;
* SPI peripherals&lt;br /&gt;
* touch&lt;br /&gt;
* usb&lt;br /&gt;
* external memory (sram, flash, eeprom...) -&amp;gt; RTOS / Linux / ChibiOS? (similar to this http://hforsten.com/making-embedded-linux-computer.html)?&lt;br /&gt;
.....&lt;/div&gt;</summary>
		<author><name>0rel</name></author>
	</entry>
	<entry>
		<id>https://wiki.sgmk-ssam.ch/index.php?title=STM32_dev&amp;diff=6577</id>
		<title>STM32 dev</title>
		<link rel="alternate" type="text/html" href="https://wiki.sgmk-ssam.ch/index.php?title=STM32_dev&amp;diff=6577"/>
		<updated>2016-10-15T19:39:58Z</updated>

		<summary type="html">&lt;p&gt;0rel: /* IDE: Eclipse SW4STM32 */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Overview ==&lt;br /&gt;
&lt;br /&gt;
Notes on STM32 microcontrollers and on how to get them working in DIY projects.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;/// this is a work in progress draft ///&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
== Software ==&lt;br /&gt;
&lt;br /&gt;
All about software tools for STM32 dev. Development environments, compilers, debuggers, IDEs etc.&lt;br /&gt;
&lt;br /&gt;
=== ARM toolchains ===&lt;br /&gt;
&lt;br /&gt;
==== gcc-arm-embedded Toolchain ====&lt;br /&gt;
&lt;br /&gt;
Install the GCC arm-none-eabi toolchain for your OS. On Arch Linux this can be done with the package manager:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
$ sudo pacman -S arm-none-eabi-gcc arm-none-eabi-gdb arm-none-eabi-binutils arm-none-eabi-newlib&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Alternatively, it can be built from scratch, to have all tools and their sources in one place.&lt;br /&gt;
&lt;br /&gt;
* Download the sources here: https://launchpad.net/gcc-arm-embedded/+download&lt;br /&gt;
* Install the &#039;&#039;common tools and libraries&#039;&#039; like described in the [https://launchpadlibrarian.net/231136652/How-to-build-toolchain.pdf documentation].&lt;br /&gt;
* Build the toolchain. - On my system, the following steps were required:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
$ cp gcc-arm-none-eabi-5_2-2015q4-20151219-src.tar.bz2 ~/toolchain&lt;br /&gt;
$ cd ~/toolchain&lt;br /&gt;
$ tar -xjf gcc-arm-none-eabi-5_2-2015q4-20151219-src.tar.bz2&lt;br /&gt;
$ cd ./gcc-arm-none-eabi-5_2-2015q4-20151219/src&lt;br /&gt;
$ find -name &#039;*.tar.*&#039; | xargs -I% tar -xf %&lt;br /&gt;
$ cd ..&lt;br /&gt;
$ ./build-prerequisites.sh --skip_steps=mingw32&lt;br /&gt;
$ ./build-toolchain.sh --skip_steps=mingw32,manual&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
Note that those &#039;&#039;skip_steps&#039;&#039; options were required in my case.&lt;br /&gt;
&lt;br /&gt;
==== Linaro Toolchain ====&lt;br /&gt;
&lt;br /&gt;
The [https://en.wikipedia.org/wiki/Linaro Linaro] toolchain seems to be famous as well.&lt;br /&gt;
&lt;br /&gt;
Install it with your package manager if available, or build it yourself:&amp;lt;br /&amp;gt;&lt;br /&gt;
https://wiki.linaro.org/WorkingGroups/ToolChain&amp;lt;br /&amp;gt;&lt;br /&gt;
https://wiki.linaro.org/WorkingGroups/ToolChain/FAQ&lt;br /&gt;
&lt;br /&gt;
==== devkitpro devkitARM toolchain ====&lt;br /&gt;
&lt;br /&gt;
Another gcc variant: http://devkitpro.org/&lt;br /&gt;
&lt;br /&gt;
Used in the homebrew scene for game consoles like the GP32, Nintendo (3)DS and GBA. It can [http://www.pouet.net/prod.php?which=59095 apparently] also be used for the STM32s as well! And generates probably more optimized binaries?&lt;br /&gt;
&lt;br /&gt;
(On Arch it can be installed from the AUR: https://aur.archlinux.org/packages/devkitarm-bin/ . But beware, the compiler, link, binutils have all the same name as the ones from the official GCC arm-none-eabi toolchain. So it&#039;s probably better to install it manually.)&lt;br /&gt;
&lt;br /&gt;
=== STM32CubeMX on Linux ===&lt;br /&gt;
&lt;br /&gt;
STM32CubeMX is a code generator for STM32 micros that can come in handy when you start a new project. It generates all the necessary init and HAL code, library and custom pin mux code for your specific MCU.&lt;br /&gt;
&lt;br /&gt;
Unfortunately, it comes as a Windows EXE and ST doesn&#039;t mention that it actually is a Java application. Luckily it can be installed on Linux by hand (thanks to 5V Joe&#039;s great note [http://fivevolt.blogspot.ch/2014/07/installing-stm32cubemx-on-linux.html there]):&lt;br /&gt;
&lt;br /&gt;
* Download [http://www.st.com/web/catalog/tools/FM147/CL1794/SC961/SS1743/PF259242?icmp=stm32cubemx_pron_prcube_feb2014&amp;amp;sc=stm32cube-pr STM32CubeMX].&lt;br /&gt;
* Install the application (tested in January 2016):&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
$ unzip SetupSTM32CubeMX-4.12.0.exe -d stm32cube&lt;br /&gt;
$ cd stm32cube&lt;br /&gt;
$ java -cp . com.izforge.izpack.installer.bootstrap.Installer&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
* Run:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
$ cd &amp;lt;install_dir&amp;gt;&lt;br /&gt;
$ unzip STM32CubeMX.exe&lt;br /&gt;
$ java -cp . com.st.microxplorer.maingui.STM32CubeMX&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== STM32CubeMX to Makefile ===&lt;br /&gt;
&lt;br /&gt;
For whatever reason, STM32CubeMX does not export plain GCC/Makefiles along with the initialization code. But instead, it supports an unpopular IDE called [http://www.st.com/web/catalog/tools/FM147/CL1794/SC961/SS1533/PF261797 SW4STM32], which is also based on free GNU tools. So after installing STM32CubeMX, these are the steps to get the GCC/Makefile project running:&lt;br /&gt;
&lt;br /&gt;
* Get this nice Python script by [http://www.ba0sh1.com/ Baoshi] to generate the Makefile for an exported SW4STM32 project:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
$ git clone https://github.com/baoshi/CubeMX2Makefile&lt;br /&gt;
$ cd CubeMX2Makefile&lt;br /&gt;
$ python2 CubeMX2Makefile.py &amp;lt;your_sw4stm32_prject_dir&amp;gt;&lt;br /&gt;
$ cd &amp;lt;your_sw4stm32_prject_dir&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* Fix a tiny bug in the generated Makefile (tested in January 2016). More can be read [http://www.ba0sh1.com/stm32cubemx-gcc-makefile/ here].&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
$ grep __weak Makefile &lt;br /&gt;
C_DEFS = -D__weak=&amp;quot;__attribute__\(\(weak\)\)&amp;quot; -D__packed=&amp;quot;__attribute__\(\(__packed__\)\)&amp;quot; -DUSE_HAL_DRIVER -DSTM32F072xB&lt;br /&gt;
$ sed -i &#039;s/\\(\\(weak\\)\\)/((weak))/g&#039; Makefile &lt;br /&gt;
$ sed -i &#039;s/\\(\\(packed\\)\\)/((packed))/g&#039; Makefile &lt;br /&gt;
$ grep __weak Makefile &lt;br /&gt;
C_DEFS = -D__weak=&amp;quot;__attribute__((weak))&amp;quot; -D__packed=&amp;quot;__attribute__\(\(__packed__\)\)&amp;quot; -DUSE_HAL_DRIVER -DSTM32F072xB&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* Then build the binary:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
$ make&lt;br /&gt;
(...)&lt;br /&gt;
arm-none-eabi-size build/STM32F072RBT6.elf&lt;br /&gt;
   text	   data	    bss	    dec	    hex	filename&lt;br /&gt;
   4568	     12	   1572	   6152	   1808	build/STM32F072RBT6.elf&lt;br /&gt;
arm-none-eabi-objcopy -O ihex build/STM32F072RBT6.elf build/STM32F072RBT6.hex&lt;br /&gt;
arm-none-eabi-objcopy -O binary -S build/STM32F072RBT6.elf build/STM32F072RBT6.bin	&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Flash ===&lt;br /&gt;
&lt;br /&gt;
Install OpenOCD and STLINK. On Arch Linux:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
sudo pacman -S stlink openocd&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now [http://openocd.org/ OpenOCD] and (arm-none-eabi-)gdb can be used to program and debug the MCU. All discovery boards also come with an ST-LINK/V2 programmer right built in speaking over USB to the host and over JTAG/[http://www.arm.com/products/system-ip/debug-trace/coresight-soc-components/serial-wire-debug.php SWD] to the target (note: only two pins are actually required for SWD debugging/flashing (SWDIO/SWCLK), but that for later (see also [[#Hardware]])). STM32 Discovery Boards should show up in the lsusb list like that:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
$ lsusb&lt;br /&gt;
(...)&lt;br /&gt;
Bus 003 Device 006: ID 0483:3748 STMicroelectronics ST-LINK/V2&lt;br /&gt;
(...)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
OpenOCD can now act as a &amp;quot;middleman&amp;quot; between the ST-LINK programmer and the user. As a server on the host, to which you can connect with telnet and GDB.&lt;br /&gt;
&lt;br /&gt;
To configure OpenOCD, put a configuration file called opencd.cfg into the project folder and start OpenOCD. While working on the project, let it run there in the foreground to see all the logs...&lt;br /&gt;
&lt;br /&gt;
For the [http://www.st.com/st-web-ui/static/active/jp/resource/technical/document/user_manual/DM00099401.pdf STM32 F072 Discovery] board this should work, for example:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
$ cd &amp;lt;project_directory&amp;gt;&lt;br /&gt;
$ echo &amp;quot;source [find board/stm32f0discovery.cfg]&amp;quot; &amp;gt; openocd.cfg&lt;br /&gt;
$ openocd&lt;br /&gt;
Open On-Chip Debugger 0.9.0 (2015-05-19-13:50)&lt;br /&gt;
Licensed under GNU GPL v2&lt;br /&gt;
For bug reports, read&lt;br /&gt;
	http://openocd.org/doc/doxygen/bugs.html&lt;br /&gt;
Info : The selected transport took over low-level target control. The results might differ compared to plain JTAG/SWD&lt;br /&gt;
adapter speed: 1000 kHz&lt;br /&gt;
adapter_nsrst_delay: 100&lt;br /&gt;
none separate&lt;br /&gt;
srst_only separate srst_nogate srst_open_drain connect_deassert_srst&lt;br /&gt;
Info : Unable to match requested speed 1000 kHz, using 950 kHz&lt;br /&gt;
Info : Unable to match requested speed 1000 kHz, using 950 kHz&lt;br /&gt;
Info : clock speed 950 kHz&lt;br /&gt;
Info : STLINK v2 JTAG v17 API v2 SWIM v0 VID 0x0483 PID 0x3748&lt;br /&gt;
Info : using stlink api v2&lt;br /&gt;
Info : Target voltage: 2.896454&lt;br /&gt;
Info : stm32f0x.cpu: hardware has 4 breakpoints, 2 watchpoints&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
(Don&#039;t worry about those warnings about the wrong clock speed for now...)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
In order to program the flash, connect to OpenOCD via telnet in another terminal:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
$ telnet 127.0.0.1 4444&lt;br /&gt;
Trying 127.0.0.1...&lt;br /&gt;
Connected to 127.0.0.1.&lt;br /&gt;
Escape character is &#039;^]&#039;.&lt;br /&gt;
Open On-Chip Debugger&lt;br /&gt;
&amp;gt; &lt;br /&gt;
&amp;gt; reset halt&lt;br /&gt;
target state: halted&lt;br /&gt;
target halted due to debug-request, current mode: Thread &lt;br /&gt;
xPSR: 0xc1000000 pc: 0x080014d0 msp: 0x20004000&lt;br /&gt;
&amp;gt; flash probe 0&lt;br /&gt;
device id = 0x20016448&lt;br /&gt;
flash size = 128kbytes&lt;br /&gt;
flash &#039;stm32f1x&#039; found at 0x08000000&lt;br /&gt;
&amp;gt; flash write_image erase build/STM32F072RBT6.elf&lt;br /&gt;
auto erase enabled&lt;br /&gt;
target state: halted&lt;br /&gt;
target halted due to breakpoint, current mode: Thread &lt;br /&gt;
xPSR: 0x61000000 pc: 0x2000003a msp: 0x20004000&lt;br /&gt;
wrote 6144 bytes from file build/STM32F072RBT6.elf in 0.503961s (11.906 KiB/s)&lt;br /&gt;
&amp;gt; reset run&lt;br /&gt;
&amp;gt; exit&lt;br /&gt;
Connection closed by foreign host.&lt;br /&gt;
$&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This should write the binary to the flash memory and start the program.&lt;br /&gt;
Of course, all those steps can be automated further and integrated into an IDE, but that&#039;s for later...&lt;br /&gt;
&lt;br /&gt;
To program the STM32F0Discovery board for example, this can be used to just flash the chip:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
$ openocd -f board/stm32f0discovery.cfg -c &amp;quot;program build/STM32F072RBT6.elf verify reset exit&amp;quot; &lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
To program a custom board for example with the STM32F0x chip, a command like this can be used:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
$ openocd -f interface/stlink-v2.cfg -f target/stm32f0x.cfg -c &amp;quot;program testSTM32F072_interrupt_test0.elf verify reset exit&amp;quot;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
To make things more convenient, add a new target &#039;&#039;flash&#039;&#039; to the Makefile with this command, and you can simply run &#039;&#039;make flash&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The exported main.c from STM32CubeMX was only slightly modified to let the user LEDs flash and react to the user pushbutton:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
******************************************************************************&lt;br /&gt;
* main.c *&lt;br /&gt;
******************************************************************************&lt;br /&gt;
&lt;br /&gt;
#include &amp;quot;stm32f0xx_hal.h&amp;quot;&lt;br /&gt;
&lt;br /&gt;
void SystemClock_Config(void);&lt;br /&gt;
static void MX_GPIO_Init(void);&lt;br /&gt;
&lt;br /&gt;
int main(void)&lt;br /&gt;
{&lt;br /&gt;
  /* Reset of all peripherals, Initializes the Flash interface and the Systick. */&lt;br /&gt;
  HAL_Init();&lt;br /&gt;
&lt;br /&gt;
  /* Configure the system clock */&lt;br /&gt;
  SystemClock_Config();&lt;br /&gt;
&lt;br /&gt;
  /* Initialize all configured peripherals */&lt;br /&gt;
  MX_GPIO_Init();&lt;br /&gt;
&lt;br /&gt;
  while (1)&lt;br /&gt;
  {&lt;br /&gt;
    uint32_t delay;&lt;br /&gt;
    if( HAL_GPIO_ReadPin( GPIOA, GPIO_PIN_0 ) == GPIO_PIN_SET )&lt;br /&gt;
      delay = 50;&lt;br /&gt;
    else&lt;br /&gt;
      delay = 250;&lt;br /&gt;
&lt;br /&gt;
    HAL_GPIO_TogglePin( GPIOC, GPIO_PIN_9 );&lt;br /&gt;
    HAL_Delay( delay );&lt;br /&gt;
    HAL_GPIO_TogglePin( GPIOC, GPIO_PIN_8 );&lt;br /&gt;
    HAL_Delay( delay );&lt;br /&gt;
    HAL_GPIO_TogglePin( GPIOC, GPIO_PIN_7 );&lt;br /&gt;
    HAL_Delay( delay );&lt;br /&gt;
    HAL_GPIO_TogglePin( GPIOC, GPIO_PIN_6 );&lt;br /&gt;
    HAL_Delay( delay );&lt;br /&gt;
&lt;br /&gt;
  }&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
/** System Clock Configuration&lt;br /&gt;
*/&lt;br /&gt;
void SystemClock_Config(void)&lt;br /&gt;
{&lt;br /&gt;
&lt;br /&gt;
  RCC_OscInitTypeDef RCC_OscInitStruct;&lt;br /&gt;
  RCC_ClkInitTypeDef RCC_ClkInitStruct;&lt;br /&gt;
&lt;br /&gt;
  RCC_OscInitStruct.OscillatorType = RCC_OSCILLATORTYPE_HSI;&lt;br /&gt;
  RCC_OscInitStruct.HSIState = RCC_HSI_ON;&lt;br /&gt;
  RCC_OscInitStruct.HSICalibrationValue = 16;&lt;br /&gt;
  RCC_OscInitStruct.PLL.PLLState = RCC_PLL_NONE;&lt;br /&gt;
  HAL_RCC_OscConfig(&amp;amp;RCC_OscInitStruct);&lt;br /&gt;
&lt;br /&gt;
  RCC_ClkInitStruct.ClockType = RCC_CLOCKTYPE_SYSCLK;&lt;br /&gt;
  RCC_ClkInitStruct.SYSCLKSource = RCC_SYSCLKSOURCE_HSI;&lt;br /&gt;
  RCC_ClkInitStruct.AHBCLKDivider = RCC_SYSCLK_DIV1;&lt;br /&gt;
  RCC_ClkInitStruct.APB1CLKDivider = RCC_HCLK_DIV1;&lt;br /&gt;
  HAL_RCC_ClockConfig(&amp;amp;RCC_ClkInitStruct, FLASH_LATENCY_0);&lt;br /&gt;
&lt;br /&gt;
  HAL_SYSTICK_Config(HAL_RCC_GetHCLKFreq()/1000);&lt;br /&gt;
&lt;br /&gt;
  HAL_SYSTICK_CLKSourceConfig(SYSTICK_CLKSOURCE_HCLK);&lt;br /&gt;
&lt;br /&gt;
  /* SysTick_IRQn interrupt configuration */&lt;br /&gt;
  HAL_NVIC_SetPriority(SysTick_IRQn, 0, 0);&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
/** Configure pins as&lt;br /&gt;
        * Analog&lt;br /&gt;
        * Input&lt;br /&gt;
        * Output&lt;br /&gt;
        * EVENT_OUT&lt;br /&gt;
        * EXTI&lt;br /&gt;
*/&lt;br /&gt;
void MX_GPIO_Init(void)&lt;br /&gt;
{&lt;br /&gt;
&lt;br /&gt;
  GPIO_InitTypeDef GPIO_InitStruct;&lt;br /&gt;
&lt;br /&gt;
  /* GPIO Ports Clock Enable */&lt;br /&gt;
  __GPIOA_CLK_ENABLE();&lt;br /&gt;
  __GPIOC_CLK_ENABLE();&lt;br /&gt;
&lt;br /&gt;
  /*Configure GPIO pin : PA0 */&lt;br /&gt;
  GPIO_InitStruct.Pin = GPIO_PIN_0;&lt;br /&gt;
  GPIO_InitStruct.Mode = GPIO_MODE_INPUT;&lt;br /&gt;
  GPIO_InitStruct.Pull = GPIO_NOPULL;&lt;br /&gt;
  HAL_GPIO_Init(GPIOA, &amp;amp;GPIO_InitStruct);&lt;br /&gt;
&lt;br /&gt;
  /*Configure GPIO pins : PC6 PC7 PC8 PC9 */&lt;br /&gt;
  GPIO_InitStruct.Pin = GPIO_PIN_6|GPIO_PIN_7|GPIO_PIN_8|GPIO_PIN_9;&lt;br /&gt;
  GPIO_InitStruct.Mode = GPIO_MODE_OUTPUT_PP;&lt;br /&gt;
  GPIO_InitStruct.Pull = GPIO_NOPULL;&lt;br /&gt;
  GPIO_InitStruct.Speed = GPIO_SPEED_LOW;&lt;br /&gt;
  HAL_GPIO_Init(GPIOC, &amp;amp;GPIO_InitStruct);&lt;br /&gt;
&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
(&lt;br /&gt;
Note that pins -- among various other things -- can be customized in the CubeMX editor. Reexporting code to an existing project is straight forward, and can be done easily while the old Makefile keeps valid for minor changes... - However, STM32CubeMX looks still quite unfinished to me. It&#039;s a nice concept, but where are all the ST libraries, for example for the [http://www.st.com/web/en/catalog/tools/FM147/CL1794/SC961/SS1743/LN1734/PF258658# touch functionality]? It still needs to be downloaded separately... and it comes in a bloody EXE file as well! *arghs*&lt;br /&gt;
&lt;br /&gt;
Unfortunately, things seem to be a bit confusing. If you&#039;re using a STM32F0, then probably need to take a look into the [http://www.st.com/web/catalog/tools/FM147/CL1794/SC961/SS1743/LN1897/PF260612?icmp=pf260612_pron_nb_jun2014&amp;amp;sc=stm32cubef0-pr STM32CubeF0] software bundle, which contains a more up-to-date TouchSensing Library... Hm.&lt;br /&gt;
&lt;br /&gt;
Also, note that most of the provided code by ST is only documented in the source files themselves... And there are at least two vastly differing versions of the basic functions out there, what makes copy/pasting/sharing a bit difficult. I even don&#039;t know if they continue working on this code base, or if they switch over to [https://www.mbed.com/en/ mbed]. That seems to be the focus of those newer [http://www.st.com/web/catalog/tools/FM116/SC959/SS1532/LN1847?sc=stm32nucleo Nucleo] evaluation boards.&lt;br /&gt;
)&lt;br /&gt;
&lt;br /&gt;
=== Debugging: GDB ===&lt;br /&gt;
&lt;br /&gt;
GDB can be used to debug the code right on the hardware. While OpenOCD is running, you can connect to the target like this and step through the program:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
$ arm-none-eabi-gdb -tui build/STM32F072RBT6.elf&lt;br /&gt;
(...)&lt;br /&gt;
Reading symbols from build/STM32F072RBT6.elf...done.&lt;br /&gt;
&lt;br /&gt;
(gdb) target remote :3333&lt;br /&gt;
Remote debugging using :3333&lt;br /&gt;
Python Exception &amp;lt;type &#039;exceptions.NameError&#039;&amp;gt; Installation error: gdb.execute_u&lt;br /&gt;
nwinders function is missing:&lt;br /&gt;
HAL_GetTick () at Drivers/STM32F0xx_HAL_Driver/Src/stm32f0xx_hal.c:298&lt;br /&gt;
&lt;br /&gt;
(gdb) c&lt;br /&gt;
Continuing.&lt;br /&gt;
&lt;br /&gt;
Program received signal SIGINT, Interrupt.&lt;br /&gt;
0x080002f6 in HAL_Delay (Python Exception &amp;lt;type &#039;exceptions.NameError&#039;&amp;gt; Installa&lt;br /&gt;
tion error: gdb.execute_unwinders function is missing:&lt;br /&gt;
Delay=250)&lt;br /&gt;
    at Drivers/STM32F0xx_HAL_Driver/Src/stm32f0xx_hal.c:317&lt;br /&gt;
&lt;br /&gt;
(gdb) break main.c:91&lt;br /&gt;
Breakpoint 1 at 0x8001392: file Src/main.c, line 91.&lt;br /&gt;
&lt;br /&gt;
(gdb) c&lt;br /&gt;
Continuing.&lt;br /&gt;
Note: automatically using hardware breakpoints for read-only addresses.&lt;br /&gt;
Python Exception &amp;lt;type &#039;exceptions.NameError&#039;&amp;gt; Installation error: gdb.execute_u&lt;br /&gt;
nwinders function is missing:&lt;br /&gt;
&lt;br /&gt;
Breakpoint 1, main () at Src/main.c:91&lt;br /&gt;
&lt;br /&gt;
(...)&lt;br /&gt;
(gdb) detach&lt;br /&gt;
(qdb) quit&lt;br /&gt;
$&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
(Note: the -tui option is really great to inspect the code... see [http://ftp.gnu.org/old-gnu/Manuals/gdb-5.1.1/html_chapter/gdb_19.html GDB Text User Interface])&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== IDE: Eclipse SW4STM32 ===&lt;br /&gt;
&lt;br /&gt;
GOOD NEWS: This officially supported Eclipse variant should work out of the box with STM32CubeMX generated project. You simply need to register on that site, and you&#039;ll get a software package that should work:&lt;br /&gt;
&lt;br /&gt;
[http://www.st.com/content/st_com/en/products/development-tools/software-development-tools/stm32-software-development-tools/stm32-ides/sw4stm32.html SW4STM32 - System Workbench for STM32: free IDE on Windows, Linux and OS X ]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
(Side note: I don&#039;t know how well it works when you have another Eclipse installed on your system... currently testing this out.)&lt;br /&gt;
&lt;br /&gt;
(Note: I have more problems with this Eclipse, than the GNU ARM Eclipse plugin below...)&lt;br /&gt;
&lt;br /&gt;
=== IDE: Eclipse with GNU ARM Eclipse plugin ===&lt;br /&gt;
&lt;br /&gt;
To use Eclipse as an IDE for the STM32s, just install Eclipse and a the GNU ARM Eclipse Plugin.&lt;br /&gt;
&lt;br /&gt;
* Eclipse IDE for C/C++ (CDT). This can be installed manually or with your package manager.&lt;br /&gt;
* Eclipse Plugin: [https://gnuarmeclipse.github.io/ GNU ARM Eclipse]. - This can be done in the Eclipse Marketplace (under &#039;&#039;Help &amp;gt; Eclipse Marketplace&#039;&#039; (use the default options)).&lt;br /&gt;
* Create a new Eclipse project with the GNU ARM Eclipse (Choose STM32Fxxx C/C++ Project in the Wizard)&lt;br /&gt;
&lt;br /&gt;
With some minor adjustments in the settings (OpenOCD), the basic Blinky example that comes with the plugin should work out of the box, with a STLink v2 programmer. Code completion etc. works fine too.&lt;br /&gt;
&lt;br /&gt;
(/todo: show every step)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
But there&#039;s quite annoying problem with this workflow!:&lt;br /&gt;
&lt;br /&gt;
http://www.carminenoviello.com/en/2015/06/04/stm32-applications-eclipse-gcc-stcube/:&lt;br /&gt;
&amp;lt;blockquote&amp;gt;&lt;br /&gt;
Unfortunately, the plug-in author has updated just the template for STM32-F4 family to the more recently STM32Cube-F4 HAL framework from ST (which still supports only commercial IDE.....), leaving the other templates still based on the old Standard Peripheral Library, which is no longer supported by ST and STM32CubeMX tool used in my tutorial. This causes my instructions to be wrong for processor families different from STM32-F4. &lt;br /&gt;
&amp;lt;/blockquote&amp;gt;&lt;br /&gt;
&lt;br /&gt;
So, several manual setup steps will be required to get started with your own STM32 project. To goal is to configure the project in STM32CubeMX, and use up-to-date HAL code, and not the deprecated Standard Peripheral Library.&lt;br /&gt;
&lt;br /&gt;
The GNU ARM Eclipse plugin is great, but doesn&#039;t create projects with up-to-date code. So we need to modify the manually created GNU ARM Eclipse project. - I used a custom STM32F072C8 board, and all steps below assum this hardware. The steps would be slightly different for other hardware.&lt;br /&gt;
&lt;br /&gt;
([http://www.carminenoviello.com/en/2015/06/04/stm32-applications-eclipse-gcc-stcube This tutorial] was helping here...)&lt;br /&gt;
&lt;br /&gt;
* First create a new &#039;C Project&#039; in your Eclipse workspace.&lt;br /&gt;
* In Wizard slide &#039;&#039;C Project&#039;&#039;: Choose Executable &amp;gt; &#039;&#039;Hello World ARM Cortex-M C/C++ Project&#039;&#039; and give it a name (e.g. testSTM32_00). This will generate a generic ARM project instead of an STM32Fxxx one. - Then hit &#039;&#039;Next&#039;&#039;.&lt;br /&gt;
* In Wizard slide &#039;&#039;Target processor settings&#039;&#039;: Configure the target processor: For the STM32F072C8: Change the defaults to Flash size (kB): 64, RAM size (kB): 16, Use system calls: Freestanding (no POSIX system calls), Trace output: None (no trace output). - Then hit &#039;&#039;Next&#039;&#039;.&lt;br /&gt;
* In Wizard slide &#039;&#039;Folders&#039;&#039;: Change Vendor CMSIS name to stm32f0xx. - Then hit next.&lt;br /&gt;
* In Wizard slide &#039;&#039;Select Configurations&#039;&#039;: Leave as is. - Then hit &#039;&#039;Next&#039;&#039;.&lt;br /&gt;
* In Wizard slide &#039;&#039;Cross GNU ARM Toolchain&#039;&#039;: Select &#039;&#039;GNU Tools for ARM Embedded Processors (arm-none-eabi-gcc)&#039;&#039; and either choose the global, system wide toolchain (probably in /usr/bin) or enter the path to your custom one. - Then hit &#039;&#039;Finish&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
This will create a generic ARM project, which should build without errors (hit Ctrl+B). &lt;br /&gt;
&lt;br /&gt;
Next, we need to add the vendor specific HAL code by ST generated with STM32CubeMX and/or downloaded in a more specific firmware package (STM32CubeF0, STM32CubeF4 etc.).&lt;br /&gt;
&lt;br /&gt;
...&lt;br /&gt;
So, after configuring a generic Eclipse project, we&#039;re ready to modify it.&lt;br /&gt;
&lt;br /&gt;
* Configure and export an EWARM project in [http://www.st.com/web/en/catalog/tools/PF259242 STM32CubeMX] (with default settings).&lt;br /&gt;
&lt;br /&gt;
* Extract the [http://www.st.com/web/en/catalog/tools/PF260612 STM32CubeF0] archive. ([http://www.st.com/web/en/catalog/tools/PF260820 STM32CubeF1], [http://www.st.com/web/en/catalog/tools/PF260266 STM32CubeF2], [http://www.st.com/web/en/catalog/tools/PF260613 STMCubeF3], [http://www.st.com/web/en/catalog/tools/PF259243 STMCubeF4]).&lt;br /&gt;
&lt;br /&gt;
As a starting point, here&#039;s a bash script, that modifies the previously created Eclipse project:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
#!/usr/bin/env bash&lt;br /&gt;
&lt;br /&gt;
set -e&lt;br /&gt;
&lt;br /&gt;
#echo &amp;quot;Press CTRL+C to proceed.&amp;quot;&lt;br /&gt;
#trap &amp;quot;pkill -f &#039;sleep 1h&#039;&amp;quot; INT&lt;br /&gt;
#trap &amp;quot;set +x ; sleep 1h ; set -x&amp;quot; DEBUG&lt;br /&gt;
&lt;br /&gt;
# MODIFY THIS!&lt;br /&gt;
ECLIPSE_PROJECT=/run/media/rel/prc/code/workspace_testSTM32_01/testSTM32_00&lt;br /&gt;
STM32CUBEF0=/home/rel/src/STM32Cube_FW_F0_V1.4.0&lt;br /&gt;
STM32CUBEMX=/home/rel/Desktop/test_stm32cubemx_ewarm&lt;br /&gt;
&lt;br /&gt;
echo --------------------------------------------------------------------------------&lt;br /&gt;
echo Eclipse Project Initializer for STM32F072 Dev&lt;br /&gt;
echo --------------------------------------------------------------------------------&lt;br /&gt;
&lt;br /&gt;
echo&lt;br /&gt;
echo The script is using the following paths:&lt;br /&gt;
echo&lt;br /&gt;
echo Eclipse Project:&lt;br /&gt;
echo $ECLIPSE_PROJECT&lt;br /&gt;
echo&lt;br /&gt;
echo STM32Cube:&lt;br /&gt;
echo $STM32CUBEF0&lt;br /&gt;
echo&lt;br /&gt;
echo STM32CubeMX:&lt;br /&gt;
echo $STM32CUBEMX&lt;br /&gt;
&lt;br /&gt;
echo&lt;br /&gt;
echo -n &amp;quot;Do you want to proceed? [ENTER]&amp;quot;&lt;br /&gt;
read&lt;br /&gt;
&lt;br /&gt;
echo&lt;br /&gt;
echo Deleting files from eclipse project:&lt;br /&gt;
rm -fv $ECLIPSE_PROJECT/src/main.c&lt;br /&gt;
rm -fv $ECLIPSE_PROJECT/src/Timer.c&lt;br /&gt;
rm -fv $ECLIPSE_PROJECT/include/Timer.h&lt;br /&gt;
&lt;br /&gt;
rm -fv $ECLIPSE_PROJECT/system/include/cmsis/stm32f0xx.h&lt;br /&gt;
rm -fv $ECLIPSE_PROJECT/system/include/cmsis/system_stm32f0xx.h&lt;br /&gt;
&lt;br /&gt;
rm -fv $ECLIPSE_PROJECT/system/src/cmsis/system_stm32f0xx.c&lt;br /&gt;
rm -fv $ECLIPSE_PROJECT/system/src/cmsis/vectors_stm32f0xx.c&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
echo&lt;br /&gt;
echo Copying: ST HAL:&lt;br /&gt;
cp -rfv $STM32CUBEF0/Drivers/STM32F0xx_HAL_Driver/Src/* \&lt;br /&gt;
$ECLIPSE_PROJECT/system/src/stm32f0xx&lt;br /&gt;
&lt;br /&gt;
cp -rfv $STM32CUBEF0/Drivers/STM32F0xx_HAL_Driver/Inc/* \&lt;br /&gt;
$ECLIPSE_PROJECT/system/include/stm32f0xx&lt;br /&gt;
&lt;br /&gt;
cp -rfv $STM32CUBEF0/Drivers/CMSIS/Device/ST/STM32F0xx/Include/* \&lt;br /&gt;
$ECLIPSE_PROJECT/system/include/cmsis&lt;br /&gt;
&lt;br /&gt;
cp -fv $STM32CUBEF0/Drivers/CMSIS/Device/ST/STM32F0xx/Source/Templates/gcc/startup_stm32f072xb.s \&lt;br /&gt;
$ECLIPSE_PROJECT/system/src/cmsis/startup_stm32f072xb.S&lt;br /&gt;
&lt;br /&gt;
cp -fv $STM32CUBEF0/Drivers/CMSIS/Device/ST/STM32F0xx/Source/Templates/system_stm32f0xx.c \&lt;br /&gt;
$ECLIPSE_PROJECT/system/src/cmsis&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
# echo Copying: example project from STM32CubeF0:&lt;br /&gt;
#cp $STM32CUBEF0/Projects/STM32F072B-Discovery/Examples/GPIO/GPIO_IOToggle/Inc/* \&lt;br /&gt;
#$ECLIPSE_PROJECT/include&lt;br /&gt;
&lt;br /&gt;
#cp $STM32CUBEF0/Projects/STM32F072B-Discovery/Examples/GPIO/GPIO_IOToggle/Src/main.c \&lt;br /&gt;
#$ECLIPSE_PROJECT/src&lt;br /&gt;
&lt;br /&gt;
#cp $STM32CUBEF0/Projects/STM32F072B-Discovery/Examples/GPIO/GPIO_IOToggle/Src/stm32f0xx_it.c \&lt;br /&gt;
#$ECLIPSE_PROJECT/src&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
echo&lt;br /&gt;
echo Copying: example project from STM32CubeMX:&lt;br /&gt;
cp $STM32CUBEMX/Src/* $ECLIPSE_PROJECT/src&lt;br /&gt;
cp $STM32CUBEMX/Inc/* $ECLIPSE_PROJECT/include&lt;br /&gt;
&lt;br /&gt;
echo&lt;br /&gt;
echo Modifiying/fixing the memory map:&lt;br /&gt;
echo $ECLIPSE_PROJECT/ldscripts/mem.ld&lt;br /&gt;
sed -i &#039;s/FLASH (rx) : ORIGIN = 0x00000000/FLASH (rx) : ORIGIN = 0x08000000/g&#039; $ECLIPSE_PROJECT/ldscripts/mem.ld&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
echo&lt;br /&gt;
echo SUCCESS&lt;br /&gt;
echo&lt;br /&gt;
&lt;br /&gt;
echo&lt;br /&gt;
echo Now, exclude the following file from the Eclipse project manually:&lt;br /&gt;
ls $ECLIPSE_PROJECT/system/src/stm32f0xx/stm32f0xx_hal_msp_template.c&lt;br /&gt;
&lt;br /&gt;
echo&lt;br /&gt;
echo And add the following preprocessor constants to the C/C++ compiler settings in Eclipse:&lt;br /&gt;
echo USE_HAL_DRIVER&lt;br /&gt;
echo STM32F072xB&lt;br /&gt;
&lt;br /&gt;
echo&lt;br /&gt;
echo &amp;quot;And add the following config options to the GDB OpenOCD Debugging settings (in Run Configurations):&amp;quot;&lt;br /&gt;
echo &amp;quot;-f interface/stlink-v2.cfg -f target/stm32f0x.cfg&amp;quot;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This script needs to be modified according to your needs! (Currently is working for the STM32F072C8, and contains fixed paths! - Note that there minor inconsistencies in some of these ST projects. For example, all the provided STM32F072xB* files by ST work for both types of chips -- STM32F072x8 and STM32F072xB.)&lt;br /&gt;
&lt;br /&gt;
Like described in the script above, some minor manual changes need to be made in Eclipse after running the script.&lt;br /&gt;
&lt;br /&gt;
This should now be a good basis to start a new STM32 project.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Note that the GNU ARM Eclipse plugin always generates a Makefile for every project configuration (Debug / Release). It can be found in &amp;lt;project_folder&amp;gt;/Debug pr &amp;lt;project_folder&amp;gt;/Release respectively.&lt;br /&gt;
&lt;br /&gt;
==== Semihosting ====&lt;br /&gt;
&lt;br /&gt;
http://infocenter.arm.com/help/index.jsp?topic=/com.arm.doc.dui0471c/Bgbjjgij.html:&lt;br /&gt;
&amp;lt;blockquote&amp;gt;&lt;br /&gt;
What is semihosting?&lt;br /&gt;
&lt;br /&gt;
Semihosting is a mechanism that enables code running on an ARM target to communicate and use the Input/Output facilities on a host computer that is running a debugger.&lt;br /&gt;
&lt;br /&gt;
Examples of these facilities include keyboard input, screen output, and disk I/O.&lt;br /&gt;
&amp;lt;/blockquote&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The GNU ARM Eclipse plugin comes with a really bare-bone implementation of some semihosting print functions that can be used to print logs to the console right in Eclipse (over GDB, without using any additional serial/UART connection whatsoever).&lt;br /&gt;
&lt;br /&gt;
Since I&#039;d always create a project without Semihosting enabled in the GNU ARM Eclipse wizard, you can still easily enable it later on:&lt;br /&gt;
&lt;br /&gt;
The easiest way I&#039;ve found so far, is by defining those Preprocessor constants in the C/C++ Project settings (Projects &amp;gt; Properties &amp;gt; C/C++ Build &amp;gt; Settings &amp;gt; Cross ARM GNU C/C++ Compiler &amp;gt; Preprocessor):&lt;br /&gt;
* TRACE&lt;br /&gt;
* OS_USE_TRACE_SEMIHOSTING_STDOUT&lt;br /&gt;
&lt;br /&gt;
And then, by using the following function calls in your code to log stuff to the Eclipse console right away:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
trace_initialize(); // in fact not required&lt;br /&gt;
// (...)&lt;br /&gt;
static int i = 0;&lt;br /&gt;
trace_puts( &amp;quot;hello&amp;quot; );&lt;br /&gt;
trace_printf( &amp;quot;nr %d\n&amp;quot;, i++ );&lt;br /&gt;
HAL_Delay( 1000 );  &lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
These functions were implemented by the author of GNU ARM Eclipse [https://github.com/ilg-ul Liviu Ionescu], and can be looked up in these files:&lt;br /&gt;
* &amp;lt;eclipse_project&amp;gt;/system/include/arm/semihosting.h&lt;br /&gt;
* &amp;lt;eclipse_project&amp;gt;/system/include/diag/Trace.h&lt;br /&gt;
* &amp;lt;eclipse_project&amp;gt;/system/src/diag/Trace.c&lt;br /&gt;
* &amp;lt;eclipse_project&amp;gt;/system/src/diag/trace_impl.c&lt;br /&gt;
&lt;br /&gt;
An interesting comment in &#039;&#039;trace_impl.c:133&#039;&#039; says:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
// Semihosting is the other output channel that can be used for the trace&lt;br /&gt;
// messages. It comes in two flavours: STDOUT and DEBUG. The STDOUT channel&lt;br /&gt;
// is the equivalent of the stdout in POSIX and in most cases it is forwarded&lt;br /&gt;
// to the GDB server stdout stream. The debug channel is a separate&lt;br /&gt;
// channel. STDOUT is buffered, so nothing is displayed until a \n;&lt;br /&gt;
// DEBUG is not buffered, but can be slow.&lt;br /&gt;
//&lt;br /&gt;
// Choosing between semihosting stdout and debug depends on the capabilities&lt;br /&gt;
// of your GDB server, and also on specific needs. It is recommended to test&lt;br /&gt;
// DEBUG first, and if too slow, try STDOUT.&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Note that semihosting needs to be enabled in your Eclipse run configuration (it is by default), in the Startup tab &amp;gt; Enable ARM semihosting. This will tell GDB to use semihosting. Without enabling, calls to those trace_* functions will throw some kind of exception... and make the processor halt. I couldn&#039;t find out much yet about how this feature really works, somehow it uses a special BKPT instruction...&lt;br /&gt;
&lt;br /&gt;
Semihosting (OS_USE_TRACE_SEMIHOSTING_STDOUT) can also be used in &amp;quot;Release&amp;quot; builds, since the semihosted calls don&#039;t rely on debug symbols.&lt;br /&gt;
&lt;br /&gt;
=== IDE: Code::Blocks ===&lt;br /&gt;
&lt;br /&gt;
My favorite cross-platform IDE for C/C++ is Code::Blocks. - And luckily, it also works well for ARM development! After twiddling around with those confusing Eclipse settings, I&#039;ve almost forgot to try out and setup Code::Blocks.&lt;br /&gt;
&lt;br /&gt;
The steps required are bit unintuitive, but building and debugging projects with full auto-complete and indexer support works now.&lt;br /&gt;
&lt;br /&gt;
The advantages over using Eclipse:&lt;br /&gt;
* Faster GUI.&lt;br /&gt;
* Works with STM32CubeMX generated code.&lt;br /&gt;
* Uses just a plain/manually editable Makefile to build the project.&lt;br /&gt;
* Familiar C/C++ settings and more *transparent* project handling -&amp;gt; Edit + debug. Nothing more. Everything can be done by hand on a console too. No mysterious hidden helpers...&lt;br /&gt;
&lt;br /&gt;
I&#039;m still evaluating this workflow... But to get things up and running, you can do this:&lt;br /&gt;
&lt;br /&gt;
(Assuming you already have a working Makefile based project, e.g. [http://wiki.sgmk-ssam.ch/wiki/STM32_dev#STM32CubeMX_to_Makefile created with STM32CubeMX, like described above]).&lt;br /&gt;
&lt;br /&gt;
* Open Code::Blocks and create an &#039;&#039;&#039;empty&#039;&#039;&#039; project (&#039;&#039;File &amp;gt; New &amp;gt; Project &amp;gt; Empty project&#039;&#039;).&lt;br /&gt;
* Give it a name in the Wizard, and choose the &#039;&#039;GNU GCC Compiler for ARM&#039;&#039;, and save it. &lt;br /&gt;
* Copy all content of the Makefile project over to Code::Blocks project folder.&lt;br /&gt;
* Import all required source files into the Code::Blocks workspace (right click -&amp;gt; &#039;&#039;Add files recursively...&#039;&#039;). &lt;br /&gt;
* Check &#039;&#039;Project &amp;gt; Properties &amp;gt; Project settings &amp;gt; Makefile: This is a custom Makefile&#039;&#039;.&lt;br /&gt;
* Adjust the build settings in &#039;&#039;Project &amp;gt; Build options &amp;gt; &amp;quot;Make commands&amp;quot;&#039;&#039;. - This might either require you to change the Makefile (i.e. add Debug/Release targets), or the commands. - For simplicity&#039;s sake, just ignore those $make, $makefile variables and overwrite them with your actual commands (i.e.&#039;&#039;$make -f $makefile $target&#039;&#039; -&amp;gt; &#039;&#039;make all&#039;&#039;).&lt;br /&gt;
* &#039;&#039;Build&#039;&#039; the project and check in the &#039;&#039;Build log&#039;&#039; if there where any errors/warnings.&lt;br /&gt;
&lt;br /&gt;
So, if this is working now, try to edit a source file and see if those really useful auto-complete and jump to declaration/implementation features are working. - One caveat of using an external Makefile is that the IDE doesn&#039;t know the current settings. So, for example, #defines are not available, and syntax highlighting will not update automatically... So it might be worth it add settings manually at some point.&lt;br /&gt;
&lt;br /&gt;
Now, to get the flashing and debugging working, try this:&lt;br /&gt;
&lt;br /&gt;
* Go to the &#039;&#039;Settings &amp;gt; Debugger&#039;&#039; Settings.&lt;br /&gt;
* Add a new GDB debugger setting (hit &#039;&#039;Create Config&#039;&#039; and call it &#039;&#039;ARM OpenOCD&#039;&#039; for example).&lt;br /&gt;
* Change the &#039;&#039;Executable path&#039;&#039; according to your toolchains location, and check &#039;Do *not* run the debugee&#039;.&lt;br /&gt;
* Go to &#039;&#039;Projects &amp;gt; Properties &amp;gt; Debugger&#039;&#039;.&lt;br /&gt;
** Change the &amp;lt;Project&amp;gt; &#039;&#039;Remote connection&#039;&#039; settings to IP: 127.0.0.1 / Port: 3333.&lt;br /&gt;
** Go to the &amp;lt;Project&amp;gt; &#039;&#039;Additional GDB commands&#039;&#039; tab. And enter those commands into the &#039;&#039;After connection&#039;&#039; box (change filename!):&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
monitor halt&lt;br /&gt;
load ./build/test.elf&lt;br /&gt;
file ./build/test.elf&lt;br /&gt;
monitor sleep 1000&lt;br /&gt;
monitor reset&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
To not run the program automatically, remove the last two commands. Then you need to &#039;&#039;Start / Continue&#039;&#039; the program twice, but you&#039;ll catch the first breakpoint you&#039;ve set!&lt;br /&gt;
* Choose &#039;&#039;Debug &amp;gt; Active Debuggers &amp;gt; GDB/CDB Debugger: ARM OpenOCD&#039;&#039;.&lt;br /&gt;
* Start OpenOCD in a terminal. (Described above).&lt;br /&gt;
* Start debugging by pressing the red arrow (Run / continue) in the debugging toolbar.&lt;br /&gt;
&lt;br /&gt;
The steps are the same as the ones in [http://www.hackvandedam.nl/blog/?p=707 this tutorial &#039;&#039;&#039;with screenshots&#039;&#039;&#039;].&lt;br /&gt;
&lt;br /&gt;
=== stlink ===&lt;br /&gt;
&lt;br /&gt;
[https://github.com/texane/stlink stlink] is a command line tool for programming, inspecting and debugging the STM32 microcontrollers. It also used internally by OpenOCD (I think). - It comes with several small programs (st-flash, st-info, st-term, st-util) that can come in handy while working with the STM32 micros.&lt;br /&gt;
&lt;br /&gt;
There&#039;s a tutorial:&lt;br /&gt;
https://github.com/texane/stlink/blob/master/doc/tutorial/tutorial.pdf&lt;br /&gt;
&lt;br /&gt;
Some useful things I&#039;ve discovered:&lt;br /&gt;
&lt;br /&gt;
Just run st-util can Ctrl-C again to see all relevant uC properties:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
$ st-util&lt;br /&gt;
2016-01-29T13:06:25 INFO src/stlink-common.c: Loading device parameters....&lt;br /&gt;
2016-01-29T13:06:25 INFO src/stlink-common.c: Device connected is: F07x device, id 0x20016448&lt;br /&gt;
2016-01-29T13:06:25 INFO src/stlink-common.c: SRAM size: 0x4000 bytes (16 KiB), Flash: 0x10000 bytes (64 KiB) in pages of 2048 bytes&lt;br /&gt;
2016-01-29T13:06:25 INFO gdbserver/gdb-server.c: Chip ID is 00000448, Core ID is  0bb11477.&lt;br /&gt;
2016-01-29T13:06:25 INFO gdbserver/gdb-server.c: Target voltage is 3554 mV.&lt;br /&gt;
2016-01-29T13:06:25 INFO gdbserver/gdb-server.c: Listening at *:4242...&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Or with st-info:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
$ st-info &lt;br /&gt;
st-info --flash&lt;br /&gt;
st-info --sram&lt;br /&gt;
st-info --descr&lt;br /&gt;
st-info --pagesize&lt;br /&gt;
st-info --chipid&lt;br /&gt;
$ st-info --flash&lt;br /&gt;
0x10000&lt;br /&gt;
$ st-info --sram&lt;br /&gt;
0x4000&lt;br /&gt;
$ st-info --descr&lt;br /&gt;
F07x device&lt;br /&gt;
$ st-info --pagesize&lt;br /&gt;
0x800&lt;br /&gt;
$ st-info --chipid&lt;br /&gt;
0x0448&lt;br /&gt;
&lt;br /&gt;
$ echo `st-info --sram | xargs -I@ printf &amp;quot;%d/1024\n&amp;quot; @ | bc`kB RAM&lt;br /&gt;
16kB RAM&lt;br /&gt;
$ echo `st-info --flash | xargs -I@ printf &amp;quot;%d/1024\n&amp;quot; @ | bc`kB FLASH&lt;br /&gt;
64kB FLASH&lt;br /&gt;
&lt;br /&gt;
$ for a in sram flash pagesize; do echo `st-info --$a | xargs -I@ printf &amp;quot;%d/1024\n&amp;quot; @ | bc`kb $a; done&lt;br /&gt;
16kb sram&lt;br /&gt;
64kb flash&lt;br /&gt;
2kb pagesize&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Or simply:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
$ st-info --probe&lt;br /&gt;
Found 1 stlink programmers&lt;br /&gt;
 serial: 303030303030303030303031&lt;br /&gt;
openocd: &amp;quot;\x30\x30\x30\x30\x30\x30\x30\x30\x30\x30\x30\x31&amp;quot;&lt;br /&gt;
  flash: 131072 (pagesize: 256)&lt;br /&gt;
   sram: 16384&lt;br /&gt;
 chipid: 0x0416&lt;br /&gt;
  descr: L1 Med-density device&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Links ===&lt;br /&gt;
&lt;br /&gt;
==== Tools ====&lt;br /&gt;
* [https://gnuarmeclipse.github.io/ GNU ARM Eclipse]: [https://gnuarmeclipse.github.io/eclipse/workspace/preferences/ workspace_preferences], [http://gnuarmeclipse.github.io/toolchain/path/ toolchain_path], [http://gnuarmeclipse.github.io/eclipse/project/portability/ project_portability]&lt;br /&gt;
&lt;br /&gt;
==== Tutorials ====&lt;br /&gt;
* Great introduction: [http://www.triplespark.net/elec/pdev/arm/stm32.html Programming STM32 F2, F4 ARMs under Linux: A Tutorial from Scratch]&lt;br /&gt;
* STM32Cube to GNU ARM Eclipse tips: http://www.carminenoviello.com/en/2015/06/04/stm32-applications-eclipse-gcc-stcube/&lt;br /&gt;
* Micro Python on STM32F4-Discovery: http://gpio.kaltpost.de/?p=2082&lt;br /&gt;
* Logs: https://hackaday.io/project/4277/logs?page=2&lt;br /&gt;
* Code::Blocks tutorial: http://www.hackvandedam.nl/blog/?p=707&lt;br /&gt;
* Eclipse tutorial: http://www.carminenoviello.com/en/2015/06/04/stm32-applications-eclipse-gcc-stcube&lt;br /&gt;
* http://sigalrm.blogspot.ch/2013/12/using-ccm-memory-on-stm32.html&lt;br /&gt;
* http://stm32f4-discovery.com/2014/08/stm32f4-external-interrupts-tutorial/&lt;br /&gt;
* ...&lt;br /&gt;
&lt;br /&gt;
==== Projects / Demos / Code ====&lt;br /&gt;
* MrBlueXav&#039;s Synths: https://github.com/MrBlueXav&lt;br /&gt;
* cliffle&#039;s VGA stuff: https://github.com/cbiffle/m4vgalib-demos, http://cliffle.com/article/2015/06/05/introducing-glitch/&lt;br /&gt;
* ESPruino code: https://github.com/espruino/Espruino -&amp;gt; STM32F401CDU6&lt;br /&gt;
* STM32F4 Audio Codec Board: http://ebrombaugh.studionebula.com/synth/stm32f4_codec/&lt;br /&gt;
* ESPRUINO: http://www.espruino.com/ReferenceSTM32F4DISCOVERY&lt;br /&gt;
* micropython: https://github.com/micropython/micropython&lt;br /&gt;
* STM32F4 DIY: http://mikrocontroller.bplaced.net/wordpress/?page_id=1482&lt;br /&gt;
* STM32F4 overclocking: http://sigalrm.blogspot.ch/2014/01/overclocking-stm32f4.html&lt;br /&gt;
* thermal camera: http://www.theresistornetwork.com/2014/11/flir-lepton-thermal-imaging-sensor.html&lt;br /&gt;
* STM32F7: http://hackaday.com/2015/06/26/new-part-day-stm32f7-an-arm-cortex-m7/&lt;br /&gt;
* Karsten Schmidt: http://workshop.thi.ng/ [https://soundcloud.com/forthcharlie soundcloud] https://github.com/thi-ng/ws-ldn-4 https://github.com/thi-ng/ws-ldn-3 http://asm.thi.ng/&lt;br /&gt;
* Peridrummmm Demo: http://www.pouet.net/prod.php?which=59095 with sources: http://aka-san.halcy.de/revision2012/peridiummmm-src.zip&lt;br /&gt;
* Andy&#039;s Workshop: http://andybrown.me.uk/&lt;br /&gt;
* axoloti: http://axoloti.com/&lt;br /&gt;
&lt;br /&gt;
==== Libraries ====&lt;br /&gt;
* libopencm3 http://libopencm3.org/wiki/Main_Page&lt;br /&gt;
* list of libs: http://mikrocontroller.bplaced.net/wordpress/?page_id=2736&lt;br /&gt;
&lt;br /&gt;
==== OS ====&lt;br /&gt;
* FreeRTOS: http://www.freertos.org/index.html&lt;br /&gt;
* Embedded Linux on STM32: https://github.com/EmcraftSystems&lt;br /&gt;
* ChibiOS: http://www.chibios.org/dokuwiki/&lt;br /&gt;
&lt;br /&gt;
==== General ====&lt;br /&gt;
* ARM Related Books: http://www.arm.com/support/resources/arm-books/&lt;br /&gt;
* STM32 Overview http://www.st.com/web/en/catalog/mmc/FM141/SC1169?sc=stm32&lt;br /&gt;
* mbed https://en.wikipedia.org/wiki/Mbed&lt;br /&gt;
* CMSIS: http://www.keil.com/pack/doc/cmsis/Core/html/index.html&lt;br /&gt;
&lt;br /&gt;
== Hardware ==&lt;br /&gt;
&lt;br /&gt;
All about hardware and hardware tools for STM32 dev. Chips, programmers etc.&lt;br /&gt;
&lt;br /&gt;
=== ST-Link V2 Programmer ===&lt;br /&gt;
&lt;br /&gt;
There are two popular ST-Link V2 Progammers on the market. They have a different pinout but work both well like described above.&lt;br /&gt;
&lt;br /&gt;
[[File:ST-LinkV2_pinout_01.jpg]]&lt;br /&gt;
&lt;br /&gt;
Alternatively, STM32Discovery/[http://jeelabs.org/book/1547a/index.html Nucleo boards too can be used as SWD programmers].&lt;br /&gt;
&lt;br /&gt;
Luckily, only 4 pins have to be used to program and debug the target!&lt;br /&gt;
To find out more about this protocol, have a look into [http://www.arm.com/products/system-ip/debug-trace/coresight-soc-components/serial-wire-debug.php Serial Debug Wire (SWD)] as an alternative to JTAG.&lt;br /&gt;
&lt;br /&gt;
Connect to following pins of the programmer to the corresponding pins on the PCB:&lt;br /&gt;
&lt;br /&gt;
* V3V&lt;br /&gt;
* GND&lt;br /&gt;
* SWCLK&lt;br /&gt;
* SWDIO&lt;br /&gt;
&lt;br /&gt;
-&amp;gt; NRST can be important too on some STM32 chips!&lt;br /&gt;
&lt;br /&gt;
Remember: These are &#039;&#039;&#039;not&#039;&#039;&#039; the [http://www.st.com/web/catalog/tools/FM146/CL1984/SC724/SS1677/PF251168 official ST-Link V2 Programmers], sold by ST.&lt;br /&gt;
&lt;br /&gt;
== Projects ==&lt;br /&gt;
&lt;br /&gt;
STM32 based projects.&lt;br /&gt;
&lt;br /&gt;
=== STM32basic ===&lt;br /&gt;
&lt;br /&gt;
STM32basic is a test board to see how STM32 chips can be used in DIY circuits.&lt;br /&gt;
&lt;br /&gt;
==== STM32basic rev0.01 ====&lt;br /&gt;
&lt;br /&gt;
An initial list of tests:&lt;br /&gt;
&lt;br /&gt;
* JTAG: See how we can program the thing. Do we need all JTAG pins? Or only the SWD pins? What about reset? - Do the cheapo Chinese STLink V2 programmer really work?&lt;br /&gt;
* Basic I/O: LED and push button.&lt;br /&gt;
* U(S)ART: Check whether it&#039;s possible to hook up an FTDI to send/receive characters to/from the STM32basic?&lt;br /&gt;
* BOOT0/1: What about those boot modes?&lt;br /&gt;
* Power Usage : 3V3 Regulator: ..&lt;br /&gt;
&lt;br /&gt;
[[File:STM32basic_pcb1b.jpg]]&lt;br /&gt;
&lt;br /&gt;
Board at OSH Park:&amp;lt;br /&amp;gt;&lt;br /&gt;
https://oshpark.com/shared_projects/kCD7Yr0A&lt;br /&gt;
&lt;br /&gt;
KiCad project and everything else:&amp;lt;br /&amp;gt;&lt;br /&gt;
Remark: this has been made in hurry and is just a test:&amp;lt;br /&amp;gt;&lt;br /&gt;
http://0rel.com/prj/STM32basic/STM32basic_rev0.01.zip&lt;br /&gt;
&lt;br /&gt;
[[File:Stm32basic1.jpg]]&lt;br /&gt;
&lt;br /&gt;
So far, the tests have been working ok.&lt;br /&gt;
&lt;br /&gt;
* STLink V2 programmers seem to work fine, and only require 2 pins + VCC/GND! SWDIO and SWCLK, that&#039;s it! For programming and on-chip debugging.&lt;br /&gt;
* I/O works as well. External interrupts can be configured.&lt;br /&gt;
* UART works, but I have not yet tested it with a proper code. It was working with some echo snippet I&#039;ve found somewhere.&lt;br /&gt;
* Power usage is low. ~15 mA at 3.3 V.&lt;br /&gt;
* BOOT0 jumper has to be set (connected to ground) in order to run code... - Other boot modes have not been tested yet. More tests are needed there... What are the other available boot modes, what about those built-in boot loaders?&lt;br /&gt;
&lt;br /&gt;
However, the board has several flaws:&lt;br /&gt;
* 1.27 mm pin-pitch headers cannot be arranged like that (GPIOs). They need to be further apart to make sockets/headers fit.&lt;br /&gt;
* 3V3 LDO doesn&#039;t make much sense like this. Add add a buck/boost converter. Also remove 5V label.&lt;br /&gt;
* This BOOT0 jumper isn&#039;t nice like this...&lt;br /&gt;
* Remove unnecessary JTAG pins. SWD only.&lt;br /&gt;
* Remove unnecessary USART pins.&lt;br /&gt;
* Add crystal.&lt;br /&gt;
* Add USB plug.&lt;br /&gt;
&lt;br /&gt;
Probably, this will not be remade, since it was enough for a test. I&#039;d like to make a very basic USB touch device next.&lt;br /&gt;
&lt;br /&gt;
==== STM32basic Eclipse project ====&lt;br /&gt;
&lt;br /&gt;
Test project to see if GPIOs with External interrupts and semi hosting works. Sloppy and not cleaned up yet...&amp;lt;br /&amp;gt;&lt;br /&gt;
http://0rel.com/prj/STM32basic/testSTM32F072_interrupt_test0.zip&lt;br /&gt;
&lt;br /&gt;
Note: Eclipse projects can be imported in an existing or new workspace with: &#039;&#039;File &amp;gt; Import &amp;gt; General &amp;gt; Existing Projects into Workspace&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
=== todo ===&lt;br /&gt;
&lt;br /&gt;
* I2C peripherals&lt;br /&gt;
* I2S peripherals&lt;br /&gt;
* SPI peripherals&lt;br /&gt;
* touch&lt;br /&gt;
* usb&lt;br /&gt;
* external memory (sram, flash, eeprom...) -&amp;gt; RTOS / Linux / ChibiOS? (similar to this http://hforsten.com/making-embedded-linux-computer.html)?&lt;br /&gt;
.....&lt;/div&gt;</summary>
		<author><name>0rel</name></author>
	</entry>
	<entry>
		<id>https://wiki.sgmk-ssam.ch/index.php?title=STM32_dev&amp;diff=6576</id>
		<title>STM32 dev</title>
		<link rel="alternate" type="text/html" href="https://wiki.sgmk-ssam.ch/index.php?title=STM32_dev&amp;diff=6576"/>
		<updated>2016-10-15T19:39:23Z</updated>

		<summary type="html">&lt;p&gt;0rel: /* IDE: Eclipse SW4STM32 */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Overview ==&lt;br /&gt;
&lt;br /&gt;
Notes on STM32 microcontrollers and on how to get them working in DIY projects.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;/// this is a work in progress draft ///&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
== Software ==&lt;br /&gt;
&lt;br /&gt;
All about software tools for STM32 dev. Development environments, compilers, debuggers, IDEs etc.&lt;br /&gt;
&lt;br /&gt;
=== ARM toolchains ===&lt;br /&gt;
&lt;br /&gt;
==== gcc-arm-embedded Toolchain ====&lt;br /&gt;
&lt;br /&gt;
Install the GCC arm-none-eabi toolchain for your OS. On Arch Linux this can be done with the package manager:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
$ sudo pacman -S arm-none-eabi-gcc arm-none-eabi-gdb arm-none-eabi-binutils arm-none-eabi-newlib&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Alternatively, it can be built from scratch, to have all tools and their sources in one place.&lt;br /&gt;
&lt;br /&gt;
* Download the sources here: https://launchpad.net/gcc-arm-embedded/+download&lt;br /&gt;
* Install the &#039;&#039;common tools and libraries&#039;&#039; like described in the [https://launchpadlibrarian.net/231136652/How-to-build-toolchain.pdf documentation].&lt;br /&gt;
* Build the toolchain. - On my system, the following steps were required:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
$ cp gcc-arm-none-eabi-5_2-2015q4-20151219-src.tar.bz2 ~/toolchain&lt;br /&gt;
$ cd ~/toolchain&lt;br /&gt;
$ tar -xjf gcc-arm-none-eabi-5_2-2015q4-20151219-src.tar.bz2&lt;br /&gt;
$ cd ./gcc-arm-none-eabi-5_2-2015q4-20151219/src&lt;br /&gt;
$ find -name &#039;*.tar.*&#039; | xargs -I% tar -xf %&lt;br /&gt;
$ cd ..&lt;br /&gt;
$ ./build-prerequisites.sh --skip_steps=mingw32&lt;br /&gt;
$ ./build-toolchain.sh --skip_steps=mingw32,manual&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
Note that those &#039;&#039;skip_steps&#039;&#039; options were required in my case.&lt;br /&gt;
&lt;br /&gt;
==== Linaro Toolchain ====&lt;br /&gt;
&lt;br /&gt;
The [https://en.wikipedia.org/wiki/Linaro Linaro] toolchain seems to be famous as well.&lt;br /&gt;
&lt;br /&gt;
Install it with your package manager if available, or build it yourself:&amp;lt;br /&amp;gt;&lt;br /&gt;
https://wiki.linaro.org/WorkingGroups/ToolChain&amp;lt;br /&amp;gt;&lt;br /&gt;
https://wiki.linaro.org/WorkingGroups/ToolChain/FAQ&lt;br /&gt;
&lt;br /&gt;
==== devkitpro devkitARM toolchain ====&lt;br /&gt;
&lt;br /&gt;
Another gcc variant: http://devkitpro.org/&lt;br /&gt;
&lt;br /&gt;
Used in the homebrew scene for game consoles like the GP32, Nintendo (3)DS and GBA. It can [http://www.pouet.net/prod.php?which=59095 apparently] also be used for the STM32s as well! And generates probably more optimized binaries?&lt;br /&gt;
&lt;br /&gt;
(On Arch it can be installed from the AUR: https://aur.archlinux.org/packages/devkitarm-bin/ . But beware, the compiler, link, binutils have all the same name as the ones from the official GCC arm-none-eabi toolchain. So it&#039;s probably better to install it manually.)&lt;br /&gt;
&lt;br /&gt;
=== STM32CubeMX on Linux ===&lt;br /&gt;
&lt;br /&gt;
STM32CubeMX is a code generator for STM32 micros that can come in handy when you start a new project. It generates all the necessary init and HAL code, library and custom pin mux code for your specific MCU.&lt;br /&gt;
&lt;br /&gt;
Unfortunately, it comes as a Windows EXE and ST doesn&#039;t mention that it actually is a Java application. Luckily it can be installed on Linux by hand (thanks to 5V Joe&#039;s great note [http://fivevolt.blogspot.ch/2014/07/installing-stm32cubemx-on-linux.html there]):&lt;br /&gt;
&lt;br /&gt;
* Download [http://www.st.com/web/catalog/tools/FM147/CL1794/SC961/SS1743/PF259242?icmp=stm32cubemx_pron_prcube_feb2014&amp;amp;sc=stm32cube-pr STM32CubeMX].&lt;br /&gt;
* Install the application (tested in January 2016):&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
$ unzip SetupSTM32CubeMX-4.12.0.exe -d stm32cube&lt;br /&gt;
$ cd stm32cube&lt;br /&gt;
$ java -cp . com.izforge.izpack.installer.bootstrap.Installer&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
* Run:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
$ cd &amp;lt;install_dir&amp;gt;&lt;br /&gt;
$ unzip STM32CubeMX.exe&lt;br /&gt;
$ java -cp . com.st.microxplorer.maingui.STM32CubeMX&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== STM32CubeMX to Makefile ===&lt;br /&gt;
&lt;br /&gt;
For whatever reason, STM32CubeMX does not export plain GCC/Makefiles along with the initialization code. But instead, it supports an unpopular IDE called [http://www.st.com/web/catalog/tools/FM147/CL1794/SC961/SS1533/PF261797 SW4STM32], which is also based on free GNU tools. So after installing STM32CubeMX, these are the steps to get the GCC/Makefile project running:&lt;br /&gt;
&lt;br /&gt;
* Get this nice Python script by [http://www.ba0sh1.com/ Baoshi] to generate the Makefile for an exported SW4STM32 project:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
$ git clone https://github.com/baoshi/CubeMX2Makefile&lt;br /&gt;
$ cd CubeMX2Makefile&lt;br /&gt;
$ python2 CubeMX2Makefile.py &amp;lt;your_sw4stm32_prject_dir&amp;gt;&lt;br /&gt;
$ cd &amp;lt;your_sw4stm32_prject_dir&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* Fix a tiny bug in the generated Makefile (tested in January 2016). More can be read [http://www.ba0sh1.com/stm32cubemx-gcc-makefile/ here].&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
$ grep __weak Makefile &lt;br /&gt;
C_DEFS = -D__weak=&amp;quot;__attribute__\(\(weak\)\)&amp;quot; -D__packed=&amp;quot;__attribute__\(\(__packed__\)\)&amp;quot; -DUSE_HAL_DRIVER -DSTM32F072xB&lt;br /&gt;
$ sed -i &#039;s/\\(\\(weak\\)\\)/((weak))/g&#039; Makefile &lt;br /&gt;
$ sed -i &#039;s/\\(\\(packed\\)\\)/((packed))/g&#039; Makefile &lt;br /&gt;
$ grep __weak Makefile &lt;br /&gt;
C_DEFS = -D__weak=&amp;quot;__attribute__((weak))&amp;quot; -D__packed=&amp;quot;__attribute__\(\(__packed__\)\)&amp;quot; -DUSE_HAL_DRIVER -DSTM32F072xB&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* Then build the binary:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
$ make&lt;br /&gt;
(...)&lt;br /&gt;
arm-none-eabi-size build/STM32F072RBT6.elf&lt;br /&gt;
   text	   data	    bss	    dec	    hex	filename&lt;br /&gt;
   4568	     12	   1572	   6152	   1808	build/STM32F072RBT6.elf&lt;br /&gt;
arm-none-eabi-objcopy -O ihex build/STM32F072RBT6.elf build/STM32F072RBT6.hex&lt;br /&gt;
arm-none-eabi-objcopy -O binary -S build/STM32F072RBT6.elf build/STM32F072RBT6.bin	&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Flash ===&lt;br /&gt;
&lt;br /&gt;
Install OpenOCD and STLINK. On Arch Linux:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
sudo pacman -S stlink openocd&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now [http://openocd.org/ OpenOCD] and (arm-none-eabi-)gdb can be used to program and debug the MCU. All discovery boards also come with an ST-LINK/V2 programmer right built in speaking over USB to the host and over JTAG/[http://www.arm.com/products/system-ip/debug-trace/coresight-soc-components/serial-wire-debug.php SWD] to the target (note: only two pins are actually required for SWD debugging/flashing (SWDIO/SWCLK), but that for later (see also [[#Hardware]])). STM32 Discovery Boards should show up in the lsusb list like that:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
$ lsusb&lt;br /&gt;
(...)&lt;br /&gt;
Bus 003 Device 006: ID 0483:3748 STMicroelectronics ST-LINK/V2&lt;br /&gt;
(...)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
OpenOCD can now act as a &amp;quot;middleman&amp;quot; between the ST-LINK programmer and the user. As a server on the host, to which you can connect with telnet and GDB.&lt;br /&gt;
&lt;br /&gt;
To configure OpenOCD, put a configuration file called opencd.cfg into the project folder and start OpenOCD. While working on the project, let it run there in the foreground to see all the logs...&lt;br /&gt;
&lt;br /&gt;
For the [http://www.st.com/st-web-ui/static/active/jp/resource/technical/document/user_manual/DM00099401.pdf STM32 F072 Discovery] board this should work, for example:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
$ cd &amp;lt;project_directory&amp;gt;&lt;br /&gt;
$ echo &amp;quot;source [find board/stm32f0discovery.cfg]&amp;quot; &amp;gt; openocd.cfg&lt;br /&gt;
$ openocd&lt;br /&gt;
Open On-Chip Debugger 0.9.0 (2015-05-19-13:50)&lt;br /&gt;
Licensed under GNU GPL v2&lt;br /&gt;
For bug reports, read&lt;br /&gt;
	http://openocd.org/doc/doxygen/bugs.html&lt;br /&gt;
Info : The selected transport took over low-level target control. The results might differ compared to plain JTAG/SWD&lt;br /&gt;
adapter speed: 1000 kHz&lt;br /&gt;
adapter_nsrst_delay: 100&lt;br /&gt;
none separate&lt;br /&gt;
srst_only separate srst_nogate srst_open_drain connect_deassert_srst&lt;br /&gt;
Info : Unable to match requested speed 1000 kHz, using 950 kHz&lt;br /&gt;
Info : Unable to match requested speed 1000 kHz, using 950 kHz&lt;br /&gt;
Info : clock speed 950 kHz&lt;br /&gt;
Info : STLINK v2 JTAG v17 API v2 SWIM v0 VID 0x0483 PID 0x3748&lt;br /&gt;
Info : using stlink api v2&lt;br /&gt;
Info : Target voltage: 2.896454&lt;br /&gt;
Info : stm32f0x.cpu: hardware has 4 breakpoints, 2 watchpoints&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
(Don&#039;t worry about those warnings about the wrong clock speed for now...)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
In order to program the flash, connect to OpenOCD via telnet in another terminal:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
$ telnet 127.0.0.1 4444&lt;br /&gt;
Trying 127.0.0.1...&lt;br /&gt;
Connected to 127.0.0.1.&lt;br /&gt;
Escape character is &#039;^]&#039;.&lt;br /&gt;
Open On-Chip Debugger&lt;br /&gt;
&amp;gt; &lt;br /&gt;
&amp;gt; reset halt&lt;br /&gt;
target state: halted&lt;br /&gt;
target halted due to debug-request, current mode: Thread &lt;br /&gt;
xPSR: 0xc1000000 pc: 0x080014d0 msp: 0x20004000&lt;br /&gt;
&amp;gt; flash probe 0&lt;br /&gt;
device id = 0x20016448&lt;br /&gt;
flash size = 128kbytes&lt;br /&gt;
flash &#039;stm32f1x&#039; found at 0x08000000&lt;br /&gt;
&amp;gt; flash write_image erase build/STM32F072RBT6.elf&lt;br /&gt;
auto erase enabled&lt;br /&gt;
target state: halted&lt;br /&gt;
target halted due to breakpoint, current mode: Thread &lt;br /&gt;
xPSR: 0x61000000 pc: 0x2000003a msp: 0x20004000&lt;br /&gt;
wrote 6144 bytes from file build/STM32F072RBT6.elf in 0.503961s (11.906 KiB/s)&lt;br /&gt;
&amp;gt; reset run&lt;br /&gt;
&amp;gt; exit&lt;br /&gt;
Connection closed by foreign host.&lt;br /&gt;
$&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This should write the binary to the flash memory and start the program.&lt;br /&gt;
Of course, all those steps can be automated further and integrated into an IDE, but that&#039;s for later...&lt;br /&gt;
&lt;br /&gt;
To program the STM32F0Discovery board for example, this can be used to just flash the chip:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
$ openocd -f board/stm32f0discovery.cfg -c &amp;quot;program build/STM32F072RBT6.elf verify reset exit&amp;quot; &lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
To program a custom board for example with the STM32F0x chip, a command like this can be used:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
$ openocd -f interface/stlink-v2.cfg -f target/stm32f0x.cfg -c &amp;quot;program testSTM32F072_interrupt_test0.elf verify reset exit&amp;quot;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
To make things more convenient, add a new target &#039;&#039;flash&#039;&#039; to the Makefile with this command, and you can simply run &#039;&#039;make flash&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The exported main.c from STM32CubeMX was only slightly modified to let the user LEDs flash and react to the user pushbutton:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
******************************************************************************&lt;br /&gt;
* main.c *&lt;br /&gt;
******************************************************************************&lt;br /&gt;
&lt;br /&gt;
#include &amp;quot;stm32f0xx_hal.h&amp;quot;&lt;br /&gt;
&lt;br /&gt;
void SystemClock_Config(void);&lt;br /&gt;
static void MX_GPIO_Init(void);&lt;br /&gt;
&lt;br /&gt;
int main(void)&lt;br /&gt;
{&lt;br /&gt;
  /* Reset of all peripherals, Initializes the Flash interface and the Systick. */&lt;br /&gt;
  HAL_Init();&lt;br /&gt;
&lt;br /&gt;
  /* Configure the system clock */&lt;br /&gt;
  SystemClock_Config();&lt;br /&gt;
&lt;br /&gt;
  /* Initialize all configured peripherals */&lt;br /&gt;
  MX_GPIO_Init();&lt;br /&gt;
&lt;br /&gt;
  while (1)&lt;br /&gt;
  {&lt;br /&gt;
    uint32_t delay;&lt;br /&gt;
    if( HAL_GPIO_ReadPin( GPIOA, GPIO_PIN_0 ) == GPIO_PIN_SET )&lt;br /&gt;
      delay = 50;&lt;br /&gt;
    else&lt;br /&gt;
      delay = 250;&lt;br /&gt;
&lt;br /&gt;
    HAL_GPIO_TogglePin( GPIOC, GPIO_PIN_9 );&lt;br /&gt;
    HAL_Delay( delay );&lt;br /&gt;
    HAL_GPIO_TogglePin( GPIOC, GPIO_PIN_8 );&lt;br /&gt;
    HAL_Delay( delay );&lt;br /&gt;
    HAL_GPIO_TogglePin( GPIOC, GPIO_PIN_7 );&lt;br /&gt;
    HAL_Delay( delay );&lt;br /&gt;
    HAL_GPIO_TogglePin( GPIOC, GPIO_PIN_6 );&lt;br /&gt;
    HAL_Delay( delay );&lt;br /&gt;
&lt;br /&gt;
  }&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
/** System Clock Configuration&lt;br /&gt;
*/&lt;br /&gt;
void SystemClock_Config(void)&lt;br /&gt;
{&lt;br /&gt;
&lt;br /&gt;
  RCC_OscInitTypeDef RCC_OscInitStruct;&lt;br /&gt;
  RCC_ClkInitTypeDef RCC_ClkInitStruct;&lt;br /&gt;
&lt;br /&gt;
  RCC_OscInitStruct.OscillatorType = RCC_OSCILLATORTYPE_HSI;&lt;br /&gt;
  RCC_OscInitStruct.HSIState = RCC_HSI_ON;&lt;br /&gt;
  RCC_OscInitStruct.HSICalibrationValue = 16;&lt;br /&gt;
  RCC_OscInitStruct.PLL.PLLState = RCC_PLL_NONE;&lt;br /&gt;
  HAL_RCC_OscConfig(&amp;amp;RCC_OscInitStruct);&lt;br /&gt;
&lt;br /&gt;
  RCC_ClkInitStruct.ClockType = RCC_CLOCKTYPE_SYSCLK;&lt;br /&gt;
  RCC_ClkInitStruct.SYSCLKSource = RCC_SYSCLKSOURCE_HSI;&lt;br /&gt;
  RCC_ClkInitStruct.AHBCLKDivider = RCC_SYSCLK_DIV1;&lt;br /&gt;
  RCC_ClkInitStruct.APB1CLKDivider = RCC_HCLK_DIV1;&lt;br /&gt;
  HAL_RCC_ClockConfig(&amp;amp;RCC_ClkInitStruct, FLASH_LATENCY_0);&lt;br /&gt;
&lt;br /&gt;
  HAL_SYSTICK_Config(HAL_RCC_GetHCLKFreq()/1000);&lt;br /&gt;
&lt;br /&gt;
  HAL_SYSTICK_CLKSourceConfig(SYSTICK_CLKSOURCE_HCLK);&lt;br /&gt;
&lt;br /&gt;
  /* SysTick_IRQn interrupt configuration */&lt;br /&gt;
  HAL_NVIC_SetPriority(SysTick_IRQn, 0, 0);&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
/** Configure pins as&lt;br /&gt;
        * Analog&lt;br /&gt;
        * Input&lt;br /&gt;
        * Output&lt;br /&gt;
        * EVENT_OUT&lt;br /&gt;
        * EXTI&lt;br /&gt;
*/&lt;br /&gt;
void MX_GPIO_Init(void)&lt;br /&gt;
{&lt;br /&gt;
&lt;br /&gt;
  GPIO_InitTypeDef GPIO_InitStruct;&lt;br /&gt;
&lt;br /&gt;
  /* GPIO Ports Clock Enable */&lt;br /&gt;
  __GPIOA_CLK_ENABLE();&lt;br /&gt;
  __GPIOC_CLK_ENABLE();&lt;br /&gt;
&lt;br /&gt;
  /*Configure GPIO pin : PA0 */&lt;br /&gt;
  GPIO_InitStruct.Pin = GPIO_PIN_0;&lt;br /&gt;
  GPIO_InitStruct.Mode = GPIO_MODE_INPUT;&lt;br /&gt;
  GPIO_InitStruct.Pull = GPIO_NOPULL;&lt;br /&gt;
  HAL_GPIO_Init(GPIOA, &amp;amp;GPIO_InitStruct);&lt;br /&gt;
&lt;br /&gt;
  /*Configure GPIO pins : PC6 PC7 PC8 PC9 */&lt;br /&gt;
  GPIO_InitStruct.Pin = GPIO_PIN_6|GPIO_PIN_7|GPIO_PIN_8|GPIO_PIN_9;&lt;br /&gt;
  GPIO_InitStruct.Mode = GPIO_MODE_OUTPUT_PP;&lt;br /&gt;
  GPIO_InitStruct.Pull = GPIO_NOPULL;&lt;br /&gt;
  GPIO_InitStruct.Speed = GPIO_SPEED_LOW;&lt;br /&gt;
  HAL_GPIO_Init(GPIOC, &amp;amp;GPIO_InitStruct);&lt;br /&gt;
&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
(&lt;br /&gt;
Note that pins -- among various other things -- can be customized in the CubeMX editor. Reexporting code to an existing project is straight forward, and can be done easily while the old Makefile keeps valid for minor changes... - However, STM32CubeMX looks still quite unfinished to me. It&#039;s a nice concept, but where are all the ST libraries, for example for the [http://www.st.com/web/en/catalog/tools/FM147/CL1794/SC961/SS1743/LN1734/PF258658# touch functionality]? It still needs to be downloaded separately... and it comes in a bloody EXE file as well! *arghs*&lt;br /&gt;
&lt;br /&gt;
Unfortunately, things seem to be a bit confusing. If you&#039;re using a STM32F0, then probably need to take a look into the [http://www.st.com/web/catalog/tools/FM147/CL1794/SC961/SS1743/LN1897/PF260612?icmp=pf260612_pron_nb_jun2014&amp;amp;sc=stm32cubef0-pr STM32CubeF0] software bundle, which contains a more up-to-date TouchSensing Library... Hm.&lt;br /&gt;
&lt;br /&gt;
Also, note that most of the provided code by ST is only documented in the source files themselves... And there are at least two vastly differing versions of the basic functions out there, what makes copy/pasting/sharing a bit difficult. I even don&#039;t know if they continue working on this code base, or if they switch over to [https://www.mbed.com/en/ mbed]. That seems to be the focus of those newer [http://www.st.com/web/catalog/tools/FM116/SC959/SS1532/LN1847?sc=stm32nucleo Nucleo] evaluation boards.&lt;br /&gt;
)&lt;br /&gt;
&lt;br /&gt;
=== Debugging: GDB ===&lt;br /&gt;
&lt;br /&gt;
GDB can be used to debug the code right on the hardware. While OpenOCD is running, you can connect to the target like this and step through the program:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
$ arm-none-eabi-gdb -tui build/STM32F072RBT6.elf&lt;br /&gt;
(...)&lt;br /&gt;
Reading symbols from build/STM32F072RBT6.elf...done.&lt;br /&gt;
&lt;br /&gt;
(gdb) target remote :3333&lt;br /&gt;
Remote debugging using :3333&lt;br /&gt;
Python Exception &amp;lt;type &#039;exceptions.NameError&#039;&amp;gt; Installation error: gdb.execute_u&lt;br /&gt;
nwinders function is missing:&lt;br /&gt;
HAL_GetTick () at Drivers/STM32F0xx_HAL_Driver/Src/stm32f0xx_hal.c:298&lt;br /&gt;
&lt;br /&gt;
(gdb) c&lt;br /&gt;
Continuing.&lt;br /&gt;
&lt;br /&gt;
Program received signal SIGINT, Interrupt.&lt;br /&gt;
0x080002f6 in HAL_Delay (Python Exception &amp;lt;type &#039;exceptions.NameError&#039;&amp;gt; Installa&lt;br /&gt;
tion error: gdb.execute_unwinders function is missing:&lt;br /&gt;
Delay=250)&lt;br /&gt;
    at Drivers/STM32F0xx_HAL_Driver/Src/stm32f0xx_hal.c:317&lt;br /&gt;
&lt;br /&gt;
(gdb) break main.c:91&lt;br /&gt;
Breakpoint 1 at 0x8001392: file Src/main.c, line 91.&lt;br /&gt;
&lt;br /&gt;
(gdb) c&lt;br /&gt;
Continuing.&lt;br /&gt;
Note: automatically using hardware breakpoints for read-only addresses.&lt;br /&gt;
Python Exception &amp;lt;type &#039;exceptions.NameError&#039;&amp;gt; Installation error: gdb.execute_u&lt;br /&gt;
nwinders function is missing:&lt;br /&gt;
&lt;br /&gt;
Breakpoint 1, main () at Src/main.c:91&lt;br /&gt;
&lt;br /&gt;
(...)&lt;br /&gt;
(gdb) detach&lt;br /&gt;
(qdb) quit&lt;br /&gt;
$&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
(Note: the -tui option is really great to inspect the code... see [http://ftp.gnu.org/old-gnu/Manuals/gdb-5.1.1/html_chapter/gdb_19.html GDB Text User Interface])&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== IDE: Eclipse SW4STM32 ===&lt;br /&gt;
&lt;br /&gt;
GOOD NEWS: This officially supported Eclipse variant should work out of the box with STM32CubeMX generated project. You simply need to register on that site, and you&#039;ll get a software package that should work:&lt;br /&gt;
&lt;br /&gt;
[http://www.st.com/content/st_com/en/products/development-tools/software-development-tools/stm32-software-development-tools/stm32-ides/sw4stm32.html SW4STM32 - System Workbench for STM32: free IDE on Windows, Linux and OS X ]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
(Side note: I don&#039;t know how well it works when you have another Eclipse installed on your system... currently testing this out.)&lt;br /&gt;
&lt;br /&gt;
=== IDE: Eclipse with GNU ARM Eclipse plugin ===&lt;br /&gt;
&lt;br /&gt;
To use Eclipse as an IDE for the STM32s, just install Eclipse and a the GNU ARM Eclipse Plugin.&lt;br /&gt;
&lt;br /&gt;
* Eclipse IDE for C/C++ (CDT). This can be installed manually or with your package manager.&lt;br /&gt;
* Eclipse Plugin: [https://gnuarmeclipse.github.io/ GNU ARM Eclipse]. - This can be done in the Eclipse Marketplace (under &#039;&#039;Help &amp;gt; Eclipse Marketplace&#039;&#039; (use the default options)).&lt;br /&gt;
* Create a new Eclipse project with the GNU ARM Eclipse (Choose STM32Fxxx C/C++ Project in the Wizard)&lt;br /&gt;
&lt;br /&gt;
With some minor adjustments in the settings (OpenOCD), the basic Blinky example that comes with the plugin should work out of the box, with a STLink v2 programmer. Code completion etc. works fine too.&lt;br /&gt;
&lt;br /&gt;
(/todo: show every step)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
But there&#039;s quite annoying problem with this workflow!:&lt;br /&gt;
&lt;br /&gt;
http://www.carminenoviello.com/en/2015/06/04/stm32-applications-eclipse-gcc-stcube/:&lt;br /&gt;
&amp;lt;blockquote&amp;gt;&lt;br /&gt;
Unfortunately, the plug-in author has updated just the template for STM32-F4 family to the more recently STM32Cube-F4 HAL framework from ST (which still supports only commercial IDE.....), leaving the other templates still based on the old Standard Peripheral Library, which is no longer supported by ST and STM32CubeMX tool used in my tutorial. This causes my instructions to be wrong for processor families different from STM32-F4. &lt;br /&gt;
&amp;lt;/blockquote&amp;gt;&lt;br /&gt;
&lt;br /&gt;
So, several manual setup steps will be required to get started with your own STM32 project. To goal is to configure the project in STM32CubeMX, and use up-to-date HAL code, and not the deprecated Standard Peripheral Library.&lt;br /&gt;
&lt;br /&gt;
The GNU ARM Eclipse plugin is great, but doesn&#039;t create projects with up-to-date code. So we need to modify the manually created GNU ARM Eclipse project. - I used a custom STM32F072C8 board, and all steps below assum this hardware. The steps would be slightly different for other hardware.&lt;br /&gt;
&lt;br /&gt;
([http://www.carminenoviello.com/en/2015/06/04/stm32-applications-eclipse-gcc-stcube This tutorial] was helping here...)&lt;br /&gt;
&lt;br /&gt;
* First create a new &#039;C Project&#039; in your Eclipse workspace.&lt;br /&gt;
* In Wizard slide &#039;&#039;C Project&#039;&#039;: Choose Executable &amp;gt; &#039;&#039;Hello World ARM Cortex-M C/C++ Project&#039;&#039; and give it a name (e.g. testSTM32_00). This will generate a generic ARM project instead of an STM32Fxxx one. - Then hit &#039;&#039;Next&#039;&#039;.&lt;br /&gt;
* In Wizard slide &#039;&#039;Target processor settings&#039;&#039;: Configure the target processor: For the STM32F072C8: Change the defaults to Flash size (kB): 64, RAM size (kB): 16, Use system calls: Freestanding (no POSIX system calls), Trace output: None (no trace output). - Then hit &#039;&#039;Next&#039;&#039;.&lt;br /&gt;
* In Wizard slide &#039;&#039;Folders&#039;&#039;: Change Vendor CMSIS name to stm32f0xx. - Then hit next.&lt;br /&gt;
* In Wizard slide &#039;&#039;Select Configurations&#039;&#039;: Leave as is. - Then hit &#039;&#039;Next&#039;&#039;.&lt;br /&gt;
* In Wizard slide &#039;&#039;Cross GNU ARM Toolchain&#039;&#039;: Select &#039;&#039;GNU Tools for ARM Embedded Processors (arm-none-eabi-gcc)&#039;&#039; and either choose the global, system wide toolchain (probably in /usr/bin) or enter the path to your custom one. - Then hit &#039;&#039;Finish&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
This will create a generic ARM project, which should build without errors (hit Ctrl+B). &lt;br /&gt;
&lt;br /&gt;
Next, we need to add the vendor specific HAL code by ST generated with STM32CubeMX and/or downloaded in a more specific firmware package (STM32CubeF0, STM32CubeF4 etc.).&lt;br /&gt;
&lt;br /&gt;
...&lt;br /&gt;
So, after configuring a generic Eclipse project, we&#039;re ready to modify it.&lt;br /&gt;
&lt;br /&gt;
* Configure and export an EWARM project in [http://www.st.com/web/en/catalog/tools/PF259242 STM32CubeMX] (with default settings).&lt;br /&gt;
&lt;br /&gt;
* Extract the [http://www.st.com/web/en/catalog/tools/PF260612 STM32CubeF0] archive. ([http://www.st.com/web/en/catalog/tools/PF260820 STM32CubeF1], [http://www.st.com/web/en/catalog/tools/PF260266 STM32CubeF2], [http://www.st.com/web/en/catalog/tools/PF260613 STMCubeF3], [http://www.st.com/web/en/catalog/tools/PF259243 STMCubeF4]).&lt;br /&gt;
&lt;br /&gt;
As a starting point, here&#039;s a bash script, that modifies the previously created Eclipse project:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
#!/usr/bin/env bash&lt;br /&gt;
&lt;br /&gt;
set -e&lt;br /&gt;
&lt;br /&gt;
#echo &amp;quot;Press CTRL+C to proceed.&amp;quot;&lt;br /&gt;
#trap &amp;quot;pkill -f &#039;sleep 1h&#039;&amp;quot; INT&lt;br /&gt;
#trap &amp;quot;set +x ; sleep 1h ; set -x&amp;quot; DEBUG&lt;br /&gt;
&lt;br /&gt;
# MODIFY THIS!&lt;br /&gt;
ECLIPSE_PROJECT=/run/media/rel/prc/code/workspace_testSTM32_01/testSTM32_00&lt;br /&gt;
STM32CUBEF0=/home/rel/src/STM32Cube_FW_F0_V1.4.0&lt;br /&gt;
STM32CUBEMX=/home/rel/Desktop/test_stm32cubemx_ewarm&lt;br /&gt;
&lt;br /&gt;
echo --------------------------------------------------------------------------------&lt;br /&gt;
echo Eclipse Project Initializer for STM32F072 Dev&lt;br /&gt;
echo --------------------------------------------------------------------------------&lt;br /&gt;
&lt;br /&gt;
echo&lt;br /&gt;
echo The script is using the following paths:&lt;br /&gt;
echo&lt;br /&gt;
echo Eclipse Project:&lt;br /&gt;
echo $ECLIPSE_PROJECT&lt;br /&gt;
echo&lt;br /&gt;
echo STM32Cube:&lt;br /&gt;
echo $STM32CUBEF0&lt;br /&gt;
echo&lt;br /&gt;
echo STM32CubeMX:&lt;br /&gt;
echo $STM32CUBEMX&lt;br /&gt;
&lt;br /&gt;
echo&lt;br /&gt;
echo -n &amp;quot;Do you want to proceed? [ENTER]&amp;quot;&lt;br /&gt;
read&lt;br /&gt;
&lt;br /&gt;
echo&lt;br /&gt;
echo Deleting files from eclipse project:&lt;br /&gt;
rm -fv $ECLIPSE_PROJECT/src/main.c&lt;br /&gt;
rm -fv $ECLIPSE_PROJECT/src/Timer.c&lt;br /&gt;
rm -fv $ECLIPSE_PROJECT/include/Timer.h&lt;br /&gt;
&lt;br /&gt;
rm -fv $ECLIPSE_PROJECT/system/include/cmsis/stm32f0xx.h&lt;br /&gt;
rm -fv $ECLIPSE_PROJECT/system/include/cmsis/system_stm32f0xx.h&lt;br /&gt;
&lt;br /&gt;
rm -fv $ECLIPSE_PROJECT/system/src/cmsis/system_stm32f0xx.c&lt;br /&gt;
rm -fv $ECLIPSE_PROJECT/system/src/cmsis/vectors_stm32f0xx.c&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
echo&lt;br /&gt;
echo Copying: ST HAL:&lt;br /&gt;
cp -rfv $STM32CUBEF0/Drivers/STM32F0xx_HAL_Driver/Src/* \&lt;br /&gt;
$ECLIPSE_PROJECT/system/src/stm32f0xx&lt;br /&gt;
&lt;br /&gt;
cp -rfv $STM32CUBEF0/Drivers/STM32F0xx_HAL_Driver/Inc/* \&lt;br /&gt;
$ECLIPSE_PROJECT/system/include/stm32f0xx&lt;br /&gt;
&lt;br /&gt;
cp -rfv $STM32CUBEF0/Drivers/CMSIS/Device/ST/STM32F0xx/Include/* \&lt;br /&gt;
$ECLIPSE_PROJECT/system/include/cmsis&lt;br /&gt;
&lt;br /&gt;
cp -fv $STM32CUBEF0/Drivers/CMSIS/Device/ST/STM32F0xx/Source/Templates/gcc/startup_stm32f072xb.s \&lt;br /&gt;
$ECLIPSE_PROJECT/system/src/cmsis/startup_stm32f072xb.S&lt;br /&gt;
&lt;br /&gt;
cp -fv $STM32CUBEF0/Drivers/CMSIS/Device/ST/STM32F0xx/Source/Templates/system_stm32f0xx.c \&lt;br /&gt;
$ECLIPSE_PROJECT/system/src/cmsis&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
# echo Copying: example project from STM32CubeF0:&lt;br /&gt;
#cp $STM32CUBEF0/Projects/STM32F072B-Discovery/Examples/GPIO/GPIO_IOToggle/Inc/* \&lt;br /&gt;
#$ECLIPSE_PROJECT/include&lt;br /&gt;
&lt;br /&gt;
#cp $STM32CUBEF0/Projects/STM32F072B-Discovery/Examples/GPIO/GPIO_IOToggle/Src/main.c \&lt;br /&gt;
#$ECLIPSE_PROJECT/src&lt;br /&gt;
&lt;br /&gt;
#cp $STM32CUBEF0/Projects/STM32F072B-Discovery/Examples/GPIO/GPIO_IOToggle/Src/stm32f0xx_it.c \&lt;br /&gt;
#$ECLIPSE_PROJECT/src&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
echo&lt;br /&gt;
echo Copying: example project from STM32CubeMX:&lt;br /&gt;
cp $STM32CUBEMX/Src/* $ECLIPSE_PROJECT/src&lt;br /&gt;
cp $STM32CUBEMX/Inc/* $ECLIPSE_PROJECT/include&lt;br /&gt;
&lt;br /&gt;
echo&lt;br /&gt;
echo Modifiying/fixing the memory map:&lt;br /&gt;
echo $ECLIPSE_PROJECT/ldscripts/mem.ld&lt;br /&gt;
sed -i &#039;s/FLASH (rx) : ORIGIN = 0x00000000/FLASH (rx) : ORIGIN = 0x08000000/g&#039; $ECLIPSE_PROJECT/ldscripts/mem.ld&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
echo&lt;br /&gt;
echo SUCCESS&lt;br /&gt;
echo&lt;br /&gt;
&lt;br /&gt;
echo&lt;br /&gt;
echo Now, exclude the following file from the Eclipse project manually:&lt;br /&gt;
ls $ECLIPSE_PROJECT/system/src/stm32f0xx/stm32f0xx_hal_msp_template.c&lt;br /&gt;
&lt;br /&gt;
echo&lt;br /&gt;
echo And add the following preprocessor constants to the C/C++ compiler settings in Eclipse:&lt;br /&gt;
echo USE_HAL_DRIVER&lt;br /&gt;
echo STM32F072xB&lt;br /&gt;
&lt;br /&gt;
echo&lt;br /&gt;
echo &amp;quot;And add the following config options to the GDB OpenOCD Debugging settings (in Run Configurations):&amp;quot;&lt;br /&gt;
echo &amp;quot;-f interface/stlink-v2.cfg -f target/stm32f0x.cfg&amp;quot;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This script needs to be modified according to your needs! (Currently is working for the STM32F072C8, and contains fixed paths! - Note that there minor inconsistencies in some of these ST projects. For example, all the provided STM32F072xB* files by ST work for both types of chips -- STM32F072x8 and STM32F072xB.)&lt;br /&gt;
&lt;br /&gt;
Like described in the script above, some minor manual changes need to be made in Eclipse after running the script.&lt;br /&gt;
&lt;br /&gt;
This should now be a good basis to start a new STM32 project.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Note that the GNU ARM Eclipse plugin always generates a Makefile for every project configuration (Debug / Release). It can be found in &amp;lt;project_folder&amp;gt;/Debug pr &amp;lt;project_folder&amp;gt;/Release respectively.&lt;br /&gt;
&lt;br /&gt;
==== Semihosting ====&lt;br /&gt;
&lt;br /&gt;
http://infocenter.arm.com/help/index.jsp?topic=/com.arm.doc.dui0471c/Bgbjjgij.html:&lt;br /&gt;
&amp;lt;blockquote&amp;gt;&lt;br /&gt;
What is semihosting?&lt;br /&gt;
&lt;br /&gt;
Semihosting is a mechanism that enables code running on an ARM target to communicate and use the Input/Output facilities on a host computer that is running a debugger.&lt;br /&gt;
&lt;br /&gt;
Examples of these facilities include keyboard input, screen output, and disk I/O.&lt;br /&gt;
&amp;lt;/blockquote&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The GNU ARM Eclipse plugin comes with a really bare-bone implementation of some semihosting print functions that can be used to print logs to the console right in Eclipse (over GDB, without using any additional serial/UART connection whatsoever).&lt;br /&gt;
&lt;br /&gt;
Since I&#039;d always create a project without Semihosting enabled in the GNU ARM Eclipse wizard, you can still easily enable it later on:&lt;br /&gt;
&lt;br /&gt;
The easiest way I&#039;ve found so far, is by defining those Preprocessor constants in the C/C++ Project settings (Projects &amp;gt; Properties &amp;gt; C/C++ Build &amp;gt; Settings &amp;gt; Cross ARM GNU C/C++ Compiler &amp;gt; Preprocessor):&lt;br /&gt;
* TRACE&lt;br /&gt;
* OS_USE_TRACE_SEMIHOSTING_STDOUT&lt;br /&gt;
&lt;br /&gt;
And then, by using the following function calls in your code to log stuff to the Eclipse console right away:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
trace_initialize(); // in fact not required&lt;br /&gt;
// (...)&lt;br /&gt;
static int i = 0;&lt;br /&gt;
trace_puts( &amp;quot;hello&amp;quot; );&lt;br /&gt;
trace_printf( &amp;quot;nr %d\n&amp;quot;, i++ );&lt;br /&gt;
HAL_Delay( 1000 );  &lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
These functions were implemented by the author of GNU ARM Eclipse [https://github.com/ilg-ul Liviu Ionescu], and can be looked up in these files:&lt;br /&gt;
* &amp;lt;eclipse_project&amp;gt;/system/include/arm/semihosting.h&lt;br /&gt;
* &amp;lt;eclipse_project&amp;gt;/system/include/diag/Trace.h&lt;br /&gt;
* &amp;lt;eclipse_project&amp;gt;/system/src/diag/Trace.c&lt;br /&gt;
* &amp;lt;eclipse_project&amp;gt;/system/src/diag/trace_impl.c&lt;br /&gt;
&lt;br /&gt;
An interesting comment in &#039;&#039;trace_impl.c:133&#039;&#039; says:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
// Semihosting is the other output channel that can be used for the trace&lt;br /&gt;
// messages. It comes in two flavours: STDOUT and DEBUG. The STDOUT channel&lt;br /&gt;
// is the equivalent of the stdout in POSIX and in most cases it is forwarded&lt;br /&gt;
// to the GDB server stdout stream. The debug channel is a separate&lt;br /&gt;
// channel. STDOUT is buffered, so nothing is displayed until a \n;&lt;br /&gt;
// DEBUG is not buffered, but can be slow.&lt;br /&gt;
//&lt;br /&gt;
// Choosing between semihosting stdout and debug depends on the capabilities&lt;br /&gt;
// of your GDB server, and also on specific needs. It is recommended to test&lt;br /&gt;
// DEBUG first, and if too slow, try STDOUT.&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Note that semihosting needs to be enabled in your Eclipse run configuration (it is by default), in the Startup tab &amp;gt; Enable ARM semihosting. This will tell GDB to use semihosting. Without enabling, calls to those trace_* functions will throw some kind of exception... and make the processor halt. I couldn&#039;t find out much yet about how this feature really works, somehow it uses a special BKPT instruction...&lt;br /&gt;
&lt;br /&gt;
Semihosting (OS_USE_TRACE_SEMIHOSTING_STDOUT) can also be used in &amp;quot;Release&amp;quot; builds, since the semihosted calls don&#039;t rely on debug symbols.&lt;br /&gt;
&lt;br /&gt;
=== IDE: Code::Blocks ===&lt;br /&gt;
&lt;br /&gt;
My favorite cross-platform IDE for C/C++ is Code::Blocks. - And luckily, it also works well for ARM development! After twiddling around with those confusing Eclipse settings, I&#039;ve almost forgot to try out and setup Code::Blocks.&lt;br /&gt;
&lt;br /&gt;
The steps required are bit unintuitive, but building and debugging projects with full auto-complete and indexer support works now.&lt;br /&gt;
&lt;br /&gt;
The advantages over using Eclipse:&lt;br /&gt;
* Faster GUI.&lt;br /&gt;
* Works with STM32CubeMX generated code.&lt;br /&gt;
* Uses just a plain/manually editable Makefile to build the project.&lt;br /&gt;
* Familiar C/C++ settings and more *transparent* project handling -&amp;gt; Edit + debug. Nothing more. Everything can be done by hand on a console too. No mysterious hidden helpers...&lt;br /&gt;
&lt;br /&gt;
I&#039;m still evaluating this workflow... But to get things up and running, you can do this:&lt;br /&gt;
&lt;br /&gt;
(Assuming you already have a working Makefile based project, e.g. [http://wiki.sgmk-ssam.ch/wiki/STM32_dev#STM32CubeMX_to_Makefile created with STM32CubeMX, like described above]).&lt;br /&gt;
&lt;br /&gt;
* Open Code::Blocks and create an &#039;&#039;&#039;empty&#039;&#039;&#039; project (&#039;&#039;File &amp;gt; New &amp;gt; Project &amp;gt; Empty project&#039;&#039;).&lt;br /&gt;
* Give it a name in the Wizard, and choose the &#039;&#039;GNU GCC Compiler for ARM&#039;&#039;, and save it. &lt;br /&gt;
* Copy all content of the Makefile project over to Code::Blocks project folder.&lt;br /&gt;
* Import all required source files into the Code::Blocks workspace (right click -&amp;gt; &#039;&#039;Add files recursively...&#039;&#039;). &lt;br /&gt;
* Check &#039;&#039;Project &amp;gt; Properties &amp;gt; Project settings &amp;gt; Makefile: This is a custom Makefile&#039;&#039;.&lt;br /&gt;
* Adjust the build settings in &#039;&#039;Project &amp;gt; Build options &amp;gt; &amp;quot;Make commands&amp;quot;&#039;&#039;. - This might either require you to change the Makefile (i.e. add Debug/Release targets), or the commands. - For simplicity&#039;s sake, just ignore those $make, $makefile variables and overwrite them with your actual commands (i.e.&#039;&#039;$make -f $makefile $target&#039;&#039; -&amp;gt; &#039;&#039;make all&#039;&#039;).&lt;br /&gt;
* &#039;&#039;Build&#039;&#039; the project and check in the &#039;&#039;Build log&#039;&#039; if there where any errors/warnings.&lt;br /&gt;
&lt;br /&gt;
So, if this is working now, try to edit a source file and see if those really useful auto-complete and jump to declaration/implementation features are working. - One caveat of using an external Makefile is that the IDE doesn&#039;t know the current settings. So, for example, #defines are not available, and syntax highlighting will not update automatically... So it might be worth it add settings manually at some point.&lt;br /&gt;
&lt;br /&gt;
Now, to get the flashing and debugging working, try this:&lt;br /&gt;
&lt;br /&gt;
* Go to the &#039;&#039;Settings &amp;gt; Debugger&#039;&#039; Settings.&lt;br /&gt;
* Add a new GDB debugger setting (hit &#039;&#039;Create Config&#039;&#039; and call it &#039;&#039;ARM OpenOCD&#039;&#039; for example).&lt;br /&gt;
* Change the &#039;&#039;Executable path&#039;&#039; according to your toolchains location, and check &#039;Do *not* run the debugee&#039;.&lt;br /&gt;
* Go to &#039;&#039;Projects &amp;gt; Properties &amp;gt; Debugger&#039;&#039;.&lt;br /&gt;
** Change the &amp;lt;Project&amp;gt; &#039;&#039;Remote connection&#039;&#039; settings to IP: 127.0.0.1 / Port: 3333.&lt;br /&gt;
** Go to the &amp;lt;Project&amp;gt; &#039;&#039;Additional GDB commands&#039;&#039; tab. And enter those commands into the &#039;&#039;After connection&#039;&#039; box (change filename!):&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
monitor halt&lt;br /&gt;
load ./build/test.elf&lt;br /&gt;
file ./build/test.elf&lt;br /&gt;
monitor sleep 1000&lt;br /&gt;
monitor reset&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
To not run the program automatically, remove the last two commands. Then you need to &#039;&#039;Start / Continue&#039;&#039; the program twice, but you&#039;ll catch the first breakpoint you&#039;ve set!&lt;br /&gt;
* Choose &#039;&#039;Debug &amp;gt; Active Debuggers &amp;gt; GDB/CDB Debugger: ARM OpenOCD&#039;&#039;.&lt;br /&gt;
* Start OpenOCD in a terminal. (Described above).&lt;br /&gt;
* Start debugging by pressing the red arrow (Run / continue) in the debugging toolbar.&lt;br /&gt;
&lt;br /&gt;
The steps are the same as the ones in [http://www.hackvandedam.nl/blog/?p=707 this tutorial &#039;&#039;&#039;with screenshots&#039;&#039;&#039;].&lt;br /&gt;
&lt;br /&gt;
=== stlink ===&lt;br /&gt;
&lt;br /&gt;
[https://github.com/texane/stlink stlink] is a command line tool for programming, inspecting and debugging the STM32 microcontrollers. It also used internally by OpenOCD (I think). - It comes with several small programs (st-flash, st-info, st-term, st-util) that can come in handy while working with the STM32 micros.&lt;br /&gt;
&lt;br /&gt;
There&#039;s a tutorial:&lt;br /&gt;
https://github.com/texane/stlink/blob/master/doc/tutorial/tutorial.pdf&lt;br /&gt;
&lt;br /&gt;
Some useful things I&#039;ve discovered:&lt;br /&gt;
&lt;br /&gt;
Just run st-util can Ctrl-C again to see all relevant uC properties:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
$ st-util&lt;br /&gt;
2016-01-29T13:06:25 INFO src/stlink-common.c: Loading device parameters....&lt;br /&gt;
2016-01-29T13:06:25 INFO src/stlink-common.c: Device connected is: F07x device, id 0x20016448&lt;br /&gt;
2016-01-29T13:06:25 INFO src/stlink-common.c: SRAM size: 0x4000 bytes (16 KiB), Flash: 0x10000 bytes (64 KiB) in pages of 2048 bytes&lt;br /&gt;
2016-01-29T13:06:25 INFO gdbserver/gdb-server.c: Chip ID is 00000448, Core ID is  0bb11477.&lt;br /&gt;
2016-01-29T13:06:25 INFO gdbserver/gdb-server.c: Target voltage is 3554 mV.&lt;br /&gt;
2016-01-29T13:06:25 INFO gdbserver/gdb-server.c: Listening at *:4242...&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Or with st-info:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
$ st-info &lt;br /&gt;
st-info --flash&lt;br /&gt;
st-info --sram&lt;br /&gt;
st-info --descr&lt;br /&gt;
st-info --pagesize&lt;br /&gt;
st-info --chipid&lt;br /&gt;
$ st-info --flash&lt;br /&gt;
0x10000&lt;br /&gt;
$ st-info --sram&lt;br /&gt;
0x4000&lt;br /&gt;
$ st-info --descr&lt;br /&gt;
F07x device&lt;br /&gt;
$ st-info --pagesize&lt;br /&gt;
0x800&lt;br /&gt;
$ st-info --chipid&lt;br /&gt;
0x0448&lt;br /&gt;
&lt;br /&gt;
$ echo `st-info --sram | xargs -I@ printf &amp;quot;%d/1024\n&amp;quot; @ | bc`kB RAM&lt;br /&gt;
16kB RAM&lt;br /&gt;
$ echo `st-info --flash | xargs -I@ printf &amp;quot;%d/1024\n&amp;quot; @ | bc`kB FLASH&lt;br /&gt;
64kB FLASH&lt;br /&gt;
&lt;br /&gt;
$ for a in sram flash pagesize; do echo `st-info --$a | xargs -I@ printf &amp;quot;%d/1024\n&amp;quot; @ | bc`kb $a; done&lt;br /&gt;
16kb sram&lt;br /&gt;
64kb flash&lt;br /&gt;
2kb pagesize&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Or simply:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
$ st-info --probe&lt;br /&gt;
Found 1 stlink programmers&lt;br /&gt;
 serial: 303030303030303030303031&lt;br /&gt;
openocd: &amp;quot;\x30\x30\x30\x30\x30\x30\x30\x30\x30\x30\x30\x31&amp;quot;&lt;br /&gt;
  flash: 131072 (pagesize: 256)&lt;br /&gt;
   sram: 16384&lt;br /&gt;
 chipid: 0x0416&lt;br /&gt;
  descr: L1 Med-density device&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Links ===&lt;br /&gt;
&lt;br /&gt;
==== Tools ====&lt;br /&gt;
* [https://gnuarmeclipse.github.io/ GNU ARM Eclipse]: [https://gnuarmeclipse.github.io/eclipse/workspace/preferences/ workspace_preferences], [http://gnuarmeclipse.github.io/toolchain/path/ toolchain_path], [http://gnuarmeclipse.github.io/eclipse/project/portability/ project_portability]&lt;br /&gt;
&lt;br /&gt;
==== Tutorials ====&lt;br /&gt;
* Great introduction: [http://www.triplespark.net/elec/pdev/arm/stm32.html Programming STM32 F2, F4 ARMs under Linux: A Tutorial from Scratch]&lt;br /&gt;
* STM32Cube to GNU ARM Eclipse tips: http://www.carminenoviello.com/en/2015/06/04/stm32-applications-eclipse-gcc-stcube/&lt;br /&gt;
* Micro Python on STM32F4-Discovery: http://gpio.kaltpost.de/?p=2082&lt;br /&gt;
* Logs: https://hackaday.io/project/4277/logs?page=2&lt;br /&gt;
* Code::Blocks tutorial: http://www.hackvandedam.nl/blog/?p=707&lt;br /&gt;
* Eclipse tutorial: http://www.carminenoviello.com/en/2015/06/04/stm32-applications-eclipse-gcc-stcube&lt;br /&gt;
* http://sigalrm.blogspot.ch/2013/12/using-ccm-memory-on-stm32.html&lt;br /&gt;
* http://stm32f4-discovery.com/2014/08/stm32f4-external-interrupts-tutorial/&lt;br /&gt;
* ...&lt;br /&gt;
&lt;br /&gt;
==== Projects / Demos / Code ====&lt;br /&gt;
* MrBlueXav&#039;s Synths: https://github.com/MrBlueXav&lt;br /&gt;
* cliffle&#039;s VGA stuff: https://github.com/cbiffle/m4vgalib-demos, http://cliffle.com/article/2015/06/05/introducing-glitch/&lt;br /&gt;
* ESPruino code: https://github.com/espruino/Espruino -&amp;gt; STM32F401CDU6&lt;br /&gt;
* STM32F4 Audio Codec Board: http://ebrombaugh.studionebula.com/synth/stm32f4_codec/&lt;br /&gt;
* ESPRUINO: http://www.espruino.com/ReferenceSTM32F4DISCOVERY&lt;br /&gt;
* micropython: https://github.com/micropython/micropython&lt;br /&gt;
* STM32F4 DIY: http://mikrocontroller.bplaced.net/wordpress/?page_id=1482&lt;br /&gt;
* STM32F4 overclocking: http://sigalrm.blogspot.ch/2014/01/overclocking-stm32f4.html&lt;br /&gt;
* thermal camera: http://www.theresistornetwork.com/2014/11/flir-lepton-thermal-imaging-sensor.html&lt;br /&gt;
* STM32F7: http://hackaday.com/2015/06/26/new-part-day-stm32f7-an-arm-cortex-m7/&lt;br /&gt;
* Karsten Schmidt: http://workshop.thi.ng/ [https://soundcloud.com/forthcharlie soundcloud] https://github.com/thi-ng/ws-ldn-4 https://github.com/thi-ng/ws-ldn-3 http://asm.thi.ng/&lt;br /&gt;
* Peridrummmm Demo: http://www.pouet.net/prod.php?which=59095 with sources: http://aka-san.halcy.de/revision2012/peridiummmm-src.zip&lt;br /&gt;
* Andy&#039;s Workshop: http://andybrown.me.uk/&lt;br /&gt;
* axoloti: http://axoloti.com/&lt;br /&gt;
&lt;br /&gt;
==== Libraries ====&lt;br /&gt;
* libopencm3 http://libopencm3.org/wiki/Main_Page&lt;br /&gt;
* list of libs: http://mikrocontroller.bplaced.net/wordpress/?page_id=2736&lt;br /&gt;
&lt;br /&gt;
==== OS ====&lt;br /&gt;
* FreeRTOS: http://www.freertos.org/index.html&lt;br /&gt;
* Embedded Linux on STM32: https://github.com/EmcraftSystems&lt;br /&gt;
* ChibiOS: http://www.chibios.org/dokuwiki/&lt;br /&gt;
&lt;br /&gt;
==== General ====&lt;br /&gt;
* ARM Related Books: http://www.arm.com/support/resources/arm-books/&lt;br /&gt;
* STM32 Overview http://www.st.com/web/en/catalog/mmc/FM141/SC1169?sc=stm32&lt;br /&gt;
* mbed https://en.wikipedia.org/wiki/Mbed&lt;br /&gt;
* CMSIS: http://www.keil.com/pack/doc/cmsis/Core/html/index.html&lt;br /&gt;
&lt;br /&gt;
== Hardware ==&lt;br /&gt;
&lt;br /&gt;
All about hardware and hardware tools for STM32 dev. Chips, programmers etc.&lt;br /&gt;
&lt;br /&gt;
=== ST-Link V2 Programmer ===&lt;br /&gt;
&lt;br /&gt;
There are two popular ST-Link V2 Progammers on the market. They have a different pinout but work both well like described above.&lt;br /&gt;
&lt;br /&gt;
[[File:ST-LinkV2_pinout_01.jpg]]&lt;br /&gt;
&lt;br /&gt;
Alternatively, STM32Discovery/[http://jeelabs.org/book/1547a/index.html Nucleo boards too can be used as SWD programmers].&lt;br /&gt;
&lt;br /&gt;
Luckily, only 4 pins have to be used to program and debug the target!&lt;br /&gt;
To find out more about this protocol, have a look into [http://www.arm.com/products/system-ip/debug-trace/coresight-soc-components/serial-wire-debug.php Serial Debug Wire (SWD)] as an alternative to JTAG.&lt;br /&gt;
&lt;br /&gt;
Connect to following pins of the programmer to the corresponding pins on the PCB:&lt;br /&gt;
&lt;br /&gt;
* V3V&lt;br /&gt;
* GND&lt;br /&gt;
* SWCLK&lt;br /&gt;
* SWDIO&lt;br /&gt;
&lt;br /&gt;
-&amp;gt; NRST can be important too on some STM32 chips!&lt;br /&gt;
&lt;br /&gt;
Remember: These are &#039;&#039;&#039;not&#039;&#039;&#039; the [http://www.st.com/web/catalog/tools/FM146/CL1984/SC724/SS1677/PF251168 official ST-Link V2 Programmers], sold by ST.&lt;br /&gt;
&lt;br /&gt;
== Projects ==&lt;br /&gt;
&lt;br /&gt;
STM32 based projects.&lt;br /&gt;
&lt;br /&gt;
=== STM32basic ===&lt;br /&gt;
&lt;br /&gt;
STM32basic is a test board to see how STM32 chips can be used in DIY circuits.&lt;br /&gt;
&lt;br /&gt;
==== STM32basic rev0.01 ====&lt;br /&gt;
&lt;br /&gt;
An initial list of tests:&lt;br /&gt;
&lt;br /&gt;
* JTAG: See how we can program the thing. Do we need all JTAG pins? Or only the SWD pins? What about reset? - Do the cheapo Chinese STLink V2 programmer really work?&lt;br /&gt;
* Basic I/O: LED and push button.&lt;br /&gt;
* U(S)ART: Check whether it&#039;s possible to hook up an FTDI to send/receive characters to/from the STM32basic?&lt;br /&gt;
* BOOT0/1: What about those boot modes?&lt;br /&gt;
* Power Usage : 3V3 Regulator: ..&lt;br /&gt;
&lt;br /&gt;
[[File:STM32basic_pcb1b.jpg]]&lt;br /&gt;
&lt;br /&gt;
Board at OSH Park:&amp;lt;br /&amp;gt;&lt;br /&gt;
https://oshpark.com/shared_projects/kCD7Yr0A&lt;br /&gt;
&lt;br /&gt;
KiCad project and everything else:&amp;lt;br /&amp;gt;&lt;br /&gt;
Remark: this has been made in hurry and is just a test:&amp;lt;br /&amp;gt;&lt;br /&gt;
http://0rel.com/prj/STM32basic/STM32basic_rev0.01.zip&lt;br /&gt;
&lt;br /&gt;
[[File:Stm32basic1.jpg]]&lt;br /&gt;
&lt;br /&gt;
So far, the tests have been working ok.&lt;br /&gt;
&lt;br /&gt;
* STLink V2 programmers seem to work fine, and only require 2 pins + VCC/GND! SWDIO and SWCLK, that&#039;s it! For programming and on-chip debugging.&lt;br /&gt;
* I/O works as well. External interrupts can be configured.&lt;br /&gt;
* UART works, but I have not yet tested it with a proper code. It was working with some echo snippet I&#039;ve found somewhere.&lt;br /&gt;
* Power usage is low. ~15 mA at 3.3 V.&lt;br /&gt;
* BOOT0 jumper has to be set (connected to ground) in order to run code... - Other boot modes have not been tested yet. More tests are needed there... What are the other available boot modes, what about those built-in boot loaders?&lt;br /&gt;
&lt;br /&gt;
However, the board has several flaws:&lt;br /&gt;
* 1.27 mm pin-pitch headers cannot be arranged like that (GPIOs). They need to be further apart to make sockets/headers fit.&lt;br /&gt;
* 3V3 LDO doesn&#039;t make much sense like this. Add add a buck/boost converter. Also remove 5V label.&lt;br /&gt;
* This BOOT0 jumper isn&#039;t nice like this...&lt;br /&gt;
* Remove unnecessary JTAG pins. SWD only.&lt;br /&gt;
* Remove unnecessary USART pins.&lt;br /&gt;
* Add crystal.&lt;br /&gt;
* Add USB plug.&lt;br /&gt;
&lt;br /&gt;
Probably, this will not be remade, since it was enough for a test. I&#039;d like to make a very basic USB touch device next.&lt;br /&gt;
&lt;br /&gt;
==== STM32basic Eclipse project ====&lt;br /&gt;
&lt;br /&gt;
Test project to see if GPIOs with External interrupts and semi hosting works. Sloppy and not cleaned up yet...&amp;lt;br /&amp;gt;&lt;br /&gt;
http://0rel.com/prj/STM32basic/testSTM32F072_interrupt_test0.zip&lt;br /&gt;
&lt;br /&gt;
Note: Eclipse projects can be imported in an existing or new workspace with: &#039;&#039;File &amp;gt; Import &amp;gt; General &amp;gt; Existing Projects into Workspace&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
=== todo ===&lt;br /&gt;
&lt;br /&gt;
* I2C peripherals&lt;br /&gt;
* I2S peripherals&lt;br /&gt;
* SPI peripherals&lt;br /&gt;
* touch&lt;br /&gt;
* usb&lt;br /&gt;
* external memory (sram, flash, eeprom...) -&amp;gt; RTOS / Linux / ChibiOS? (similar to this http://hforsten.com/making-embedded-linux-computer.html)?&lt;br /&gt;
.....&lt;/div&gt;</summary>
		<author><name>0rel</name></author>
	</entry>
	<entry>
		<id>https://wiki.sgmk-ssam.ch/index.php?title=STM32_dev&amp;diff=6575</id>
		<title>STM32 dev</title>
		<link rel="alternate" type="text/html" href="https://wiki.sgmk-ssam.ch/index.php?title=STM32_dev&amp;diff=6575"/>
		<updated>2016-10-15T18:21:42Z</updated>

		<summary type="html">&lt;p&gt;0rel: /* stlink */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Overview ==&lt;br /&gt;
&lt;br /&gt;
Notes on STM32 microcontrollers and on how to get them working in DIY projects.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;/// this is a work in progress draft ///&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
== Software ==&lt;br /&gt;
&lt;br /&gt;
All about software tools for STM32 dev. Development environments, compilers, debuggers, IDEs etc.&lt;br /&gt;
&lt;br /&gt;
=== ARM toolchains ===&lt;br /&gt;
&lt;br /&gt;
==== gcc-arm-embedded Toolchain ====&lt;br /&gt;
&lt;br /&gt;
Install the GCC arm-none-eabi toolchain for your OS. On Arch Linux this can be done with the package manager:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
$ sudo pacman -S arm-none-eabi-gcc arm-none-eabi-gdb arm-none-eabi-binutils arm-none-eabi-newlib&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Alternatively, it can be built from scratch, to have all tools and their sources in one place.&lt;br /&gt;
&lt;br /&gt;
* Download the sources here: https://launchpad.net/gcc-arm-embedded/+download&lt;br /&gt;
* Install the &#039;&#039;common tools and libraries&#039;&#039; like described in the [https://launchpadlibrarian.net/231136652/How-to-build-toolchain.pdf documentation].&lt;br /&gt;
* Build the toolchain. - On my system, the following steps were required:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
$ cp gcc-arm-none-eabi-5_2-2015q4-20151219-src.tar.bz2 ~/toolchain&lt;br /&gt;
$ cd ~/toolchain&lt;br /&gt;
$ tar -xjf gcc-arm-none-eabi-5_2-2015q4-20151219-src.tar.bz2&lt;br /&gt;
$ cd ./gcc-arm-none-eabi-5_2-2015q4-20151219/src&lt;br /&gt;
$ find -name &#039;*.tar.*&#039; | xargs -I% tar -xf %&lt;br /&gt;
$ cd ..&lt;br /&gt;
$ ./build-prerequisites.sh --skip_steps=mingw32&lt;br /&gt;
$ ./build-toolchain.sh --skip_steps=mingw32,manual&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
Note that those &#039;&#039;skip_steps&#039;&#039; options were required in my case.&lt;br /&gt;
&lt;br /&gt;
==== Linaro Toolchain ====&lt;br /&gt;
&lt;br /&gt;
The [https://en.wikipedia.org/wiki/Linaro Linaro] toolchain seems to be famous as well.&lt;br /&gt;
&lt;br /&gt;
Install it with your package manager if available, or build it yourself:&amp;lt;br /&amp;gt;&lt;br /&gt;
https://wiki.linaro.org/WorkingGroups/ToolChain&amp;lt;br /&amp;gt;&lt;br /&gt;
https://wiki.linaro.org/WorkingGroups/ToolChain/FAQ&lt;br /&gt;
&lt;br /&gt;
==== devkitpro devkitARM toolchain ====&lt;br /&gt;
&lt;br /&gt;
Another gcc variant: http://devkitpro.org/&lt;br /&gt;
&lt;br /&gt;
Used in the homebrew scene for game consoles like the GP32, Nintendo (3)DS and GBA. It can [http://www.pouet.net/prod.php?which=59095 apparently] also be used for the STM32s as well! And generates probably more optimized binaries?&lt;br /&gt;
&lt;br /&gt;
(On Arch it can be installed from the AUR: https://aur.archlinux.org/packages/devkitarm-bin/ . But beware, the compiler, link, binutils have all the same name as the ones from the official GCC arm-none-eabi toolchain. So it&#039;s probably better to install it manually.)&lt;br /&gt;
&lt;br /&gt;
=== STM32CubeMX on Linux ===&lt;br /&gt;
&lt;br /&gt;
STM32CubeMX is a code generator for STM32 micros that can come in handy when you start a new project. It generates all the necessary init and HAL code, library and custom pin mux code for your specific MCU.&lt;br /&gt;
&lt;br /&gt;
Unfortunately, it comes as a Windows EXE and ST doesn&#039;t mention that it actually is a Java application. Luckily it can be installed on Linux by hand (thanks to 5V Joe&#039;s great note [http://fivevolt.blogspot.ch/2014/07/installing-stm32cubemx-on-linux.html there]):&lt;br /&gt;
&lt;br /&gt;
* Download [http://www.st.com/web/catalog/tools/FM147/CL1794/SC961/SS1743/PF259242?icmp=stm32cubemx_pron_prcube_feb2014&amp;amp;sc=stm32cube-pr STM32CubeMX].&lt;br /&gt;
* Install the application (tested in January 2016):&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
$ unzip SetupSTM32CubeMX-4.12.0.exe -d stm32cube&lt;br /&gt;
$ cd stm32cube&lt;br /&gt;
$ java -cp . com.izforge.izpack.installer.bootstrap.Installer&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
* Run:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
$ cd &amp;lt;install_dir&amp;gt;&lt;br /&gt;
$ unzip STM32CubeMX.exe&lt;br /&gt;
$ java -cp . com.st.microxplorer.maingui.STM32CubeMX&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== STM32CubeMX to Makefile ===&lt;br /&gt;
&lt;br /&gt;
For whatever reason, STM32CubeMX does not export plain GCC/Makefiles along with the initialization code. But instead, it supports an unpopular IDE called [http://www.st.com/web/catalog/tools/FM147/CL1794/SC961/SS1533/PF261797 SW4STM32], which is also based on free GNU tools. So after installing STM32CubeMX, these are the steps to get the GCC/Makefile project running:&lt;br /&gt;
&lt;br /&gt;
* Get this nice Python script by [http://www.ba0sh1.com/ Baoshi] to generate the Makefile for an exported SW4STM32 project:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
$ git clone https://github.com/baoshi/CubeMX2Makefile&lt;br /&gt;
$ cd CubeMX2Makefile&lt;br /&gt;
$ python2 CubeMX2Makefile.py &amp;lt;your_sw4stm32_prject_dir&amp;gt;&lt;br /&gt;
$ cd &amp;lt;your_sw4stm32_prject_dir&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* Fix a tiny bug in the generated Makefile (tested in January 2016). More can be read [http://www.ba0sh1.com/stm32cubemx-gcc-makefile/ here].&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
$ grep __weak Makefile &lt;br /&gt;
C_DEFS = -D__weak=&amp;quot;__attribute__\(\(weak\)\)&amp;quot; -D__packed=&amp;quot;__attribute__\(\(__packed__\)\)&amp;quot; -DUSE_HAL_DRIVER -DSTM32F072xB&lt;br /&gt;
$ sed -i &#039;s/\\(\\(weak\\)\\)/((weak))/g&#039; Makefile &lt;br /&gt;
$ sed -i &#039;s/\\(\\(packed\\)\\)/((packed))/g&#039; Makefile &lt;br /&gt;
$ grep __weak Makefile &lt;br /&gt;
C_DEFS = -D__weak=&amp;quot;__attribute__((weak))&amp;quot; -D__packed=&amp;quot;__attribute__\(\(__packed__\)\)&amp;quot; -DUSE_HAL_DRIVER -DSTM32F072xB&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* Then build the binary:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
$ make&lt;br /&gt;
(...)&lt;br /&gt;
arm-none-eabi-size build/STM32F072RBT6.elf&lt;br /&gt;
   text	   data	    bss	    dec	    hex	filename&lt;br /&gt;
   4568	     12	   1572	   6152	   1808	build/STM32F072RBT6.elf&lt;br /&gt;
arm-none-eabi-objcopy -O ihex build/STM32F072RBT6.elf build/STM32F072RBT6.hex&lt;br /&gt;
arm-none-eabi-objcopy -O binary -S build/STM32F072RBT6.elf build/STM32F072RBT6.bin	&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Flash ===&lt;br /&gt;
&lt;br /&gt;
Install OpenOCD and STLINK. On Arch Linux:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
sudo pacman -S stlink openocd&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now [http://openocd.org/ OpenOCD] and (arm-none-eabi-)gdb can be used to program and debug the MCU. All discovery boards also come with an ST-LINK/V2 programmer right built in speaking over USB to the host and over JTAG/[http://www.arm.com/products/system-ip/debug-trace/coresight-soc-components/serial-wire-debug.php SWD] to the target (note: only two pins are actually required for SWD debugging/flashing (SWDIO/SWCLK), but that for later (see also [[#Hardware]])). STM32 Discovery Boards should show up in the lsusb list like that:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
$ lsusb&lt;br /&gt;
(...)&lt;br /&gt;
Bus 003 Device 006: ID 0483:3748 STMicroelectronics ST-LINK/V2&lt;br /&gt;
(...)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
OpenOCD can now act as a &amp;quot;middleman&amp;quot; between the ST-LINK programmer and the user. As a server on the host, to which you can connect with telnet and GDB.&lt;br /&gt;
&lt;br /&gt;
To configure OpenOCD, put a configuration file called opencd.cfg into the project folder and start OpenOCD. While working on the project, let it run there in the foreground to see all the logs...&lt;br /&gt;
&lt;br /&gt;
For the [http://www.st.com/st-web-ui/static/active/jp/resource/technical/document/user_manual/DM00099401.pdf STM32 F072 Discovery] board this should work, for example:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
$ cd &amp;lt;project_directory&amp;gt;&lt;br /&gt;
$ echo &amp;quot;source [find board/stm32f0discovery.cfg]&amp;quot; &amp;gt; openocd.cfg&lt;br /&gt;
$ openocd&lt;br /&gt;
Open On-Chip Debugger 0.9.0 (2015-05-19-13:50)&lt;br /&gt;
Licensed under GNU GPL v2&lt;br /&gt;
For bug reports, read&lt;br /&gt;
	http://openocd.org/doc/doxygen/bugs.html&lt;br /&gt;
Info : The selected transport took over low-level target control. The results might differ compared to plain JTAG/SWD&lt;br /&gt;
adapter speed: 1000 kHz&lt;br /&gt;
adapter_nsrst_delay: 100&lt;br /&gt;
none separate&lt;br /&gt;
srst_only separate srst_nogate srst_open_drain connect_deassert_srst&lt;br /&gt;
Info : Unable to match requested speed 1000 kHz, using 950 kHz&lt;br /&gt;
Info : Unable to match requested speed 1000 kHz, using 950 kHz&lt;br /&gt;
Info : clock speed 950 kHz&lt;br /&gt;
Info : STLINK v2 JTAG v17 API v2 SWIM v0 VID 0x0483 PID 0x3748&lt;br /&gt;
Info : using stlink api v2&lt;br /&gt;
Info : Target voltage: 2.896454&lt;br /&gt;
Info : stm32f0x.cpu: hardware has 4 breakpoints, 2 watchpoints&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
(Don&#039;t worry about those warnings about the wrong clock speed for now...)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
In order to program the flash, connect to OpenOCD via telnet in another terminal:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
$ telnet 127.0.0.1 4444&lt;br /&gt;
Trying 127.0.0.1...&lt;br /&gt;
Connected to 127.0.0.1.&lt;br /&gt;
Escape character is &#039;^]&#039;.&lt;br /&gt;
Open On-Chip Debugger&lt;br /&gt;
&amp;gt; &lt;br /&gt;
&amp;gt; reset halt&lt;br /&gt;
target state: halted&lt;br /&gt;
target halted due to debug-request, current mode: Thread &lt;br /&gt;
xPSR: 0xc1000000 pc: 0x080014d0 msp: 0x20004000&lt;br /&gt;
&amp;gt; flash probe 0&lt;br /&gt;
device id = 0x20016448&lt;br /&gt;
flash size = 128kbytes&lt;br /&gt;
flash &#039;stm32f1x&#039; found at 0x08000000&lt;br /&gt;
&amp;gt; flash write_image erase build/STM32F072RBT6.elf&lt;br /&gt;
auto erase enabled&lt;br /&gt;
target state: halted&lt;br /&gt;
target halted due to breakpoint, current mode: Thread &lt;br /&gt;
xPSR: 0x61000000 pc: 0x2000003a msp: 0x20004000&lt;br /&gt;
wrote 6144 bytes from file build/STM32F072RBT6.elf in 0.503961s (11.906 KiB/s)&lt;br /&gt;
&amp;gt; reset run&lt;br /&gt;
&amp;gt; exit&lt;br /&gt;
Connection closed by foreign host.&lt;br /&gt;
$&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This should write the binary to the flash memory and start the program.&lt;br /&gt;
Of course, all those steps can be automated further and integrated into an IDE, but that&#039;s for later...&lt;br /&gt;
&lt;br /&gt;
To program the STM32F0Discovery board for example, this can be used to just flash the chip:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
$ openocd -f board/stm32f0discovery.cfg -c &amp;quot;program build/STM32F072RBT6.elf verify reset exit&amp;quot; &lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
To program a custom board for example with the STM32F0x chip, a command like this can be used:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
$ openocd -f interface/stlink-v2.cfg -f target/stm32f0x.cfg -c &amp;quot;program testSTM32F072_interrupt_test0.elf verify reset exit&amp;quot;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
To make things more convenient, add a new target &#039;&#039;flash&#039;&#039; to the Makefile with this command, and you can simply run &#039;&#039;make flash&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The exported main.c from STM32CubeMX was only slightly modified to let the user LEDs flash and react to the user pushbutton:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
******************************************************************************&lt;br /&gt;
* main.c *&lt;br /&gt;
******************************************************************************&lt;br /&gt;
&lt;br /&gt;
#include &amp;quot;stm32f0xx_hal.h&amp;quot;&lt;br /&gt;
&lt;br /&gt;
void SystemClock_Config(void);&lt;br /&gt;
static void MX_GPIO_Init(void);&lt;br /&gt;
&lt;br /&gt;
int main(void)&lt;br /&gt;
{&lt;br /&gt;
  /* Reset of all peripherals, Initializes the Flash interface and the Systick. */&lt;br /&gt;
  HAL_Init();&lt;br /&gt;
&lt;br /&gt;
  /* Configure the system clock */&lt;br /&gt;
  SystemClock_Config();&lt;br /&gt;
&lt;br /&gt;
  /* Initialize all configured peripherals */&lt;br /&gt;
  MX_GPIO_Init();&lt;br /&gt;
&lt;br /&gt;
  while (1)&lt;br /&gt;
  {&lt;br /&gt;
    uint32_t delay;&lt;br /&gt;
    if( HAL_GPIO_ReadPin( GPIOA, GPIO_PIN_0 ) == GPIO_PIN_SET )&lt;br /&gt;
      delay = 50;&lt;br /&gt;
    else&lt;br /&gt;
      delay = 250;&lt;br /&gt;
&lt;br /&gt;
    HAL_GPIO_TogglePin( GPIOC, GPIO_PIN_9 );&lt;br /&gt;
    HAL_Delay( delay );&lt;br /&gt;
    HAL_GPIO_TogglePin( GPIOC, GPIO_PIN_8 );&lt;br /&gt;
    HAL_Delay( delay );&lt;br /&gt;
    HAL_GPIO_TogglePin( GPIOC, GPIO_PIN_7 );&lt;br /&gt;
    HAL_Delay( delay );&lt;br /&gt;
    HAL_GPIO_TogglePin( GPIOC, GPIO_PIN_6 );&lt;br /&gt;
    HAL_Delay( delay );&lt;br /&gt;
&lt;br /&gt;
  }&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
/** System Clock Configuration&lt;br /&gt;
*/&lt;br /&gt;
void SystemClock_Config(void)&lt;br /&gt;
{&lt;br /&gt;
&lt;br /&gt;
  RCC_OscInitTypeDef RCC_OscInitStruct;&lt;br /&gt;
  RCC_ClkInitTypeDef RCC_ClkInitStruct;&lt;br /&gt;
&lt;br /&gt;
  RCC_OscInitStruct.OscillatorType = RCC_OSCILLATORTYPE_HSI;&lt;br /&gt;
  RCC_OscInitStruct.HSIState = RCC_HSI_ON;&lt;br /&gt;
  RCC_OscInitStruct.HSICalibrationValue = 16;&lt;br /&gt;
  RCC_OscInitStruct.PLL.PLLState = RCC_PLL_NONE;&lt;br /&gt;
  HAL_RCC_OscConfig(&amp;amp;RCC_OscInitStruct);&lt;br /&gt;
&lt;br /&gt;
  RCC_ClkInitStruct.ClockType = RCC_CLOCKTYPE_SYSCLK;&lt;br /&gt;
  RCC_ClkInitStruct.SYSCLKSource = RCC_SYSCLKSOURCE_HSI;&lt;br /&gt;
  RCC_ClkInitStruct.AHBCLKDivider = RCC_SYSCLK_DIV1;&lt;br /&gt;
  RCC_ClkInitStruct.APB1CLKDivider = RCC_HCLK_DIV1;&lt;br /&gt;
  HAL_RCC_ClockConfig(&amp;amp;RCC_ClkInitStruct, FLASH_LATENCY_0);&lt;br /&gt;
&lt;br /&gt;
  HAL_SYSTICK_Config(HAL_RCC_GetHCLKFreq()/1000);&lt;br /&gt;
&lt;br /&gt;
  HAL_SYSTICK_CLKSourceConfig(SYSTICK_CLKSOURCE_HCLK);&lt;br /&gt;
&lt;br /&gt;
  /* SysTick_IRQn interrupt configuration */&lt;br /&gt;
  HAL_NVIC_SetPriority(SysTick_IRQn, 0, 0);&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
/** Configure pins as&lt;br /&gt;
        * Analog&lt;br /&gt;
        * Input&lt;br /&gt;
        * Output&lt;br /&gt;
        * EVENT_OUT&lt;br /&gt;
        * EXTI&lt;br /&gt;
*/&lt;br /&gt;
void MX_GPIO_Init(void)&lt;br /&gt;
{&lt;br /&gt;
&lt;br /&gt;
  GPIO_InitTypeDef GPIO_InitStruct;&lt;br /&gt;
&lt;br /&gt;
  /* GPIO Ports Clock Enable */&lt;br /&gt;
  __GPIOA_CLK_ENABLE();&lt;br /&gt;
  __GPIOC_CLK_ENABLE();&lt;br /&gt;
&lt;br /&gt;
  /*Configure GPIO pin : PA0 */&lt;br /&gt;
  GPIO_InitStruct.Pin = GPIO_PIN_0;&lt;br /&gt;
  GPIO_InitStruct.Mode = GPIO_MODE_INPUT;&lt;br /&gt;
  GPIO_InitStruct.Pull = GPIO_NOPULL;&lt;br /&gt;
  HAL_GPIO_Init(GPIOA, &amp;amp;GPIO_InitStruct);&lt;br /&gt;
&lt;br /&gt;
  /*Configure GPIO pins : PC6 PC7 PC8 PC9 */&lt;br /&gt;
  GPIO_InitStruct.Pin = GPIO_PIN_6|GPIO_PIN_7|GPIO_PIN_8|GPIO_PIN_9;&lt;br /&gt;
  GPIO_InitStruct.Mode = GPIO_MODE_OUTPUT_PP;&lt;br /&gt;
  GPIO_InitStruct.Pull = GPIO_NOPULL;&lt;br /&gt;
  GPIO_InitStruct.Speed = GPIO_SPEED_LOW;&lt;br /&gt;
  HAL_GPIO_Init(GPIOC, &amp;amp;GPIO_InitStruct);&lt;br /&gt;
&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
(&lt;br /&gt;
Note that pins -- among various other things -- can be customized in the CubeMX editor. Reexporting code to an existing project is straight forward, and can be done easily while the old Makefile keeps valid for minor changes... - However, STM32CubeMX looks still quite unfinished to me. It&#039;s a nice concept, but where are all the ST libraries, for example for the [http://www.st.com/web/en/catalog/tools/FM147/CL1794/SC961/SS1743/LN1734/PF258658# touch functionality]? It still needs to be downloaded separately... and it comes in a bloody EXE file as well! *arghs*&lt;br /&gt;
&lt;br /&gt;
Unfortunately, things seem to be a bit confusing. If you&#039;re using a STM32F0, then probably need to take a look into the [http://www.st.com/web/catalog/tools/FM147/CL1794/SC961/SS1743/LN1897/PF260612?icmp=pf260612_pron_nb_jun2014&amp;amp;sc=stm32cubef0-pr STM32CubeF0] software bundle, which contains a more up-to-date TouchSensing Library... Hm.&lt;br /&gt;
&lt;br /&gt;
Also, note that most of the provided code by ST is only documented in the source files themselves... And there are at least two vastly differing versions of the basic functions out there, what makes copy/pasting/sharing a bit difficult. I even don&#039;t know if they continue working on this code base, or if they switch over to [https://www.mbed.com/en/ mbed]. That seems to be the focus of those newer [http://www.st.com/web/catalog/tools/FM116/SC959/SS1532/LN1847?sc=stm32nucleo Nucleo] evaluation boards.&lt;br /&gt;
)&lt;br /&gt;
&lt;br /&gt;
=== Debugging: GDB ===&lt;br /&gt;
&lt;br /&gt;
GDB can be used to debug the code right on the hardware. While OpenOCD is running, you can connect to the target like this and step through the program:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
$ arm-none-eabi-gdb -tui build/STM32F072RBT6.elf&lt;br /&gt;
(...)&lt;br /&gt;
Reading symbols from build/STM32F072RBT6.elf...done.&lt;br /&gt;
&lt;br /&gt;
(gdb) target remote :3333&lt;br /&gt;
Remote debugging using :3333&lt;br /&gt;
Python Exception &amp;lt;type &#039;exceptions.NameError&#039;&amp;gt; Installation error: gdb.execute_u&lt;br /&gt;
nwinders function is missing:&lt;br /&gt;
HAL_GetTick () at Drivers/STM32F0xx_HAL_Driver/Src/stm32f0xx_hal.c:298&lt;br /&gt;
&lt;br /&gt;
(gdb) c&lt;br /&gt;
Continuing.&lt;br /&gt;
&lt;br /&gt;
Program received signal SIGINT, Interrupt.&lt;br /&gt;
0x080002f6 in HAL_Delay (Python Exception &amp;lt;type &#039;exceptions.NameError&#039;&amp;gt; Installa&lt;br /&gt;
tion error: gdb.execute_unwinders function is missing:&lt;br /&gt;
Delay=250)&lt;br /&gt;
    at Drivers/STM32F0xx_HAL_Driver/Src/stm32f0xx_hal.c:317&lt;br /&gt;
&lt;br /&gt;
(gdb) break main.c:91&lt;br /&gt;
Breakpoint 1 at 0x8001392: file Src/main.c, line 91.&lt;br /&gt;
&lt;br /&gt;
(gdb) c&lt;br /&gt;
Continuing.&lt;br /&gt;
Note: automatically using hardware breakpoints for read-only addresses.&lt;br /&gt;
Python Exception &amp;lt;type &#039;exceptions.NameError&#039;&amp;gt; Installation error: gdb.execute_u&lt;br /&gt;
nwinders function is missing:&lt;br /&gt;
&lt;br /&gt;
Breakpoint 1, main () at Src/main.c:91&lt;br /&gt;
&lt;br /&gt;
(...)&lt;br /&gt;
(gdb) detach&lt;br /&gt;
(qdb) quit&lt;br /&gt;
$&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
(Note: the -tui option is really great to inspect the code... see [http://ftp.gnu.org/old-gnu/Manuals/gdb-5.1.1/html_chapter/gdb_19.html GDB Text User Interface])&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== IDE: Eclipse SW4STM32 ===&lt;br /&gt;
&lt;br /&gt;
GOOD NEWS: This officially supported Eclipse variant works out of the box with STM32CubeMX generated project! You simply need to register on that site, and you&#039;ll get a software package that should work:&lt;br /&gt;
&lt;br /&gt;
[http://www.st.com/content/st_com/en/products/development-tools/software-development-tools/stm32-software-development-tools/stm32-ides/sw4stm32.html SW4STM32 - System Workbench for STM32: free IDE on Windows, Linux and OS X ]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
(Side note: I don&#039;t know how well it works when you have another Eclipse installed on your system... currently testing this out.)&lt;br /&gt;
&lt;br /&gt;
=== IDE: Eclipse with GNU ARM Eclipse plugin ===&lt;br /&gt;
&lt;br /&gt;
To use Eclipse as an IDE for the STM32s, just install Eclipse and a the GNU ARM Eclipse Plugin.&lt;br /&gt;
&lt;br /&gt;
* Eclipse IDE for C/C++ (CDT). This can be installed manually or with your package manager.&lt;br /&gt;
* Eclipse Plugin: [https://gnuarmeclipse.github.io/ GNU ARM Eclipse]. - This can be done in the Eclipse Marketplace (under &#039;&#039;Help &amp;gt; Eclipse Marketplace&#039;&#039; (use the default options)).&lt;br /&gt;
* Create a new Eclipse project with the GNU ARM Eclipse (Choose STM32Fxxx C/C++ Project in the Wizard)&lt;br /&gt;
&lt;br /&gt;
With some minor adjustments in the settings (OpenOCD), the basic Blinky example that comes with the plugin should work out of the box, with a STLink v2 programmer. Code completion etc. works fine too.&lt;br /&gt;
&lt;br /&gt;
(/todo: show every step)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
But there&#039;s quite annoying problem with this workflow!:&lt;br /&gt;
&lt;br /&gt;
http://www.carminenoviello.com/en/2015/06/04/stm32-applications-eclipse-gcc-stcube/:&lt;br /&gt;
&amp;lt;blockquote&amp;gt;&lt;br /&gt;
Unfortunately, the plug-in author has updated just the template for STM32-F4 family to the more recently STM32Cube-F4 HAL framework from ST (which still supports only commercial IDE.....), leaving the other templates still based on the old Standard Peripheral Library, which is no longer supported by ST and STM32CubeMX tool used in my tutorial. This causes my instructions to be wrong for processor families different from STM32-F4. &lt;br /&gt;
&amp;lt;/blockquote&amp;gt;&lt;br /&gt;
&lt;br /&gt;
So, several manual setup steps will be required to get started with your own STM32 project. To goal is to configure the project in STM32CubeMX, and use up-to-date HAL code, and not the deprecated Standard Peripheral Library.&lt;br /&gt;
&lt;br /&gt;
The GNU ARM Eclipse plugin is great, but doesn&#039;t create projects with up-to-date code. So we need to modify the manually created GNU ARM Eclipse project. - I used a custom STM32F072C8 board, and all steps below assum this hardware. The steps would be slightly different for other hardware.&lt;br /&gt;
&lt;br /&gt;
([http://www.carminenoviello.com/en/2015/06/04/stm32-applications-eclipse-gcc-stcube This tutorial] was helping here...)&lt;br /&gt;
&lt;br /&gt;
* First create a new &#039;C Project&#039; in your Eclipse workspace.&lt;br /&gt;
* In Wizard slide &#039;&#039;C Project&#039;&#039;: Choose Executable &amp;gt; &#039;&#039;Hello World ARM Cortex-M C/C++ Project&#039;&#039; and give it a name (e.g. testSTM32_00). This will generate a generic ARM project instead of an STM32Fxxx one. - Then hit &#039;&#039;Next&#039;&#039;.&lt;br /&gt;
* In Wizard slide &#039;&#039;Target processor settings&#039;&#039;: Configure the target processor: For the STM32F072C8: Change the defaults to Flash size (kB): 64, RAM size (kB): 16, Use system calls: Freestanding (no POSIX system calls), Trace output: None (no trace output). - Then hit &#039;&#039;Next&#039;&#039;.&lt;br /&gt;
* In Wizard slide &#039;&#039;Folders&#039;&#039;: Change Vendor CMSIS name to stm32f0xx. - Then hit next.&lt;br /&gt;
* In Wizard slide &#039;&#039;Select Configurations&#039;&#039;: Leave as is. - Then hit &#039;&#039;Next&#039;&#039;.&lt;br /&gt;
* In Wizard slide &#039;&#039;Cross GNU ARM Toolchain&#039;&#039;: Select &#039;&#039;GNU Tools for ARM Embedded Processors (arm-none-eabi-gcc)&#039;&#039; and either choose the global, system wide toolchain (probably in /usr/bin) or enter the path to your custom one. - Then hit &#039;&#039;Finish&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
This will create a generic ARM project, which should build without errors (hit Ctrl+B). &lt;br /&gt;
&lt;br /&gt;
Next, we need to add the vendor specific HAL code by ST generated with STM32CubeMX and/or downloaded in a more specific firmware package (STM32CubeF0, STM32CubeF4 etc.).&lt;br /&gt;
&lt;br /&gt;
...&lt;br /&gt;
So, after configuring a generic Eclipse project, we&#039;re ready to modify it.&lt;br /&gt;
&lt;br /&gt;
* Configure and export an EWARM project in [http://www.st.com/web/en/catalog/tools/PF259242 STM32CubeMX] (with default settings).&lt;br /&gt;
&lt;br /&gt;
* Extract the [http://www.st.com/web/en/catalog/tools/PF260612 STM32CubeF0] archive. ([http://www.st.com/web/en/catalog/tools/PF260820 STM32CubeF1], [http://www.st.com/web/en/catalog/tools/PF260266 STM32CubeF2], [http://www.st.com/web/en/catalog/tools/PF260613 STMCubeF3], [http://www.st.com/web/en/catalog/tools/PF259243 STMCubeF4]).&lt;br /&gt;
&lt;br /&gt;
As a starting point, here&#039;s a bash script, that modifies the previously created Eclipse project:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
#!/usr/bin/env bash&lt;br /&gt;
&lt;br /&gt;
set -e&lt;br /&gt;
&lt;br /&gt;
#echo &amp;quot;Press CTRL+C to proceed.&amp;quot;&lt;br /&gt;
#trap &amp;quot;pkill -f &#039;sleep 1h&#039;&amp;quot; INT&lt;br /&gt;
#trap &amp;quot;set +x ; sleep 1h ; set -x&amp;quot; DEBUG&lt;br /&gt;
&lt;br /&gt;
# MODIFY THIS!&lt;br /&gt;
ECLIPSE_PROJECT=/run/media/rel/prc/code/workspace_testSTM32_01/testSTM32_00&lt;br /&gt;
STM32CUBEF0=/home/rel/src/STM32Cube_FW_F0_V1.4.0&lt;br /&gt;
STM32CUBEMX=/home/rel/Desktop/test_stm32cubemx_ewarm&lt;br /&gt;
&lt;br /&gt;
echo --------------------------------------------------------------------------------&lt;br /&gt;
echo Eclipse Project Initializer for STM32F072 Dev&lt;br /&gt;
echo --------------------------------------------------------------------------------&lt;br /&gt;
&lt;br /&gt;
echo&lt;br /&gt;
echo The script is using the following paths:&lt;br /&gt;
echo&lt;br /&gt;
echo Eclipse Project:&lt;br /&gt;
echo $ECLIPSE_PROJECT&lt;br /&gt;
echo&lt;br /&gt;
echo STM32Cube:&lt;br /&gt;
echo $STM32CUBEF0&lt;br /&gt;
echo&lt;br /&gt;
echo STM32CubeMX:&lt;br /&gt;
echo $STM32CUBEMX&lt;br /&gt;
&lt;br /&gt;
echo&lt;br /&gt;
echo -n &amp;quot;Do you want to proceed? [ENTER]&amp;quot;&lt;br /&gt;
read&lt;br /&gt;
&lt;br /&gt;
echo&lt;br /&gt;
echo Deleting files from eclipse project:&lt;br /&gt;
rm -fv $ECLIPSE_PROJECT/src/main.c&lt;br /&gt;
rm -fv $ECLIPSE_PROJECT/src/Timer.c&lt;br /&gt;
rm -fv $ECLIPSE_PROJECT/include/Timer.h&lt;br /&gt;
&lt;br /&gt;
rm -fv $ECLIPSE_PROJECT/system/include/cmsis/stm32f0xx.h&lt;br /&gt;
rm -fv $ECLIPSE_PROJECT/system/include/cmsis/system_stm32f0xx.h&lt;br /&gt;
&lt;br /&gt;
rm -fv $ECLIPSE_PROJECT/system/src/cmsis/system_stm32f0xx.c&lt;br /&gt;
rm -fv $ECLIPSE_PROJECT/system/src/cmsis/vectors_stm32f0xx.c&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
echo&lt;br /&gt;
echo Copying: ST HAL:&lt;br /&gt;
cp -rfv $STM32CUBEF0/Drivers/STM32F0xx_HAL_Driver/Src/* \&lt;br /&gt;
$ECLIPSE_PROJECT/system/src/stm32f0xx&lt;br /&gt;
&lt;br /&gt;
cp -rfv $STM32CUBEF0/Drivers/STM32F0xx_HAL_Driver/Inc/* \&lt;br /&gt;
$ECLIPSE_PROJECT/system/include/stm32f0xx&lt;br /&gt;
&lt;br /&gt;
cp -rfv $STM32CUBEF0/Drivers/CMSIS/Device/ST/STM32F0xx/Include/* \&lt;br /&gt;
$ECLIPSE_PROJECT/system/include/cmsis&lt;br /&gt;
&lt;br /&gt;
cp -fv $STM32CUBEF0/Drivers/CMSIS/Device/ST/STM32F0xx/Source/Templates/gcc/startup_stm32f072xb.s \&lt;br /&gt;
$ECLIPSE_PROJECT/system/src/cmsis/startup_stm32f072xb.S&lt;br /&gt;
&lt;br /&gt;
cp -fv $STM32CUBEF0/Drivers/CMSIS/Device/ST/STM32F0xx/Source/Templates/system_stm32f0xx.c \&lt;br /&gt;
$ECLIPSE_PROJECT/system/src/cmsis&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
# echo Copying: example project from STM32CubeF0:&lt;br /&gt;
#cp $STM32CUBEF0/Projects/STM32F072B-Discovery/Examples/GPIO/GPIO_IOToggle/Inc/* \&lt;br /&gt;
#$ECLIPSE_PROJECT/include&lt;br /&gt;
&lt;br /&gt;
#cp $STM32CUBEF0/Projects/STM32F072B-Discovery/Examples/GPIO/GPIO_IOToggle/Src/main.c \&lt;br /&gt;
#$ECLIPSE_PROJECT/src&lt;br /&gt;
&lt;br /&gt;
#cp $STM32CUBEF0/Projects/STM32F072B-Discovery/Examples/GPIO/GPIO_IOToggle/Src/stm32f0xx_it.c \&lt;br /&gt;
#$ECLIPSE_PROJECT/src&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
echo&lt;br /&gt;
echo Copying: example project from STM32CubeMX:&lt;br /&gt;
cp $STM32CUBEMX/Src/* $ECLIPSE_PROJECT/src&lt;br /&gt;
cp $STM32CUBEMX/Inc/* $ECLIPSE_PROJECT/include&lt;br /&gt;
&lt;br /&gt;
echo&lt;br /&gt;
echo Modifiying/fixing the memory map:&lt;br /&gt;
echo $ECLIPSE_PROJECT/ldscripts/mem.ld&lt;br /&gt;
sed -i &#039;s/FLASH (rx) : ORIGIN = 0x00000000/FLASH (rx) : ORIGIN = 0x08000000/g&#039; $ECLIPSE_PROJECT/ldscripts/mem.ld&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
echo&lt;br /&gt;
echo SUCCESS&lt;br /&gt;
echo&lt;br /&gt;
&lt;br /&gt;
echo&lt;br /&gt;
echo Now, exclude the following file from the Eclipse project manually:&lt;br /&gt;
ls $ECLIPSE_PROJECT/system/src/stm32f0xx/stm32f0xx_hal_msp_template.c&lt;br /&gt;
&lt;br /&gt;
echo&lt;br /&gt;
echo And add the following preprocessor constants to the C/C++ compiler settings in Eclipse:&lt;br /&gt;
echo USE_HAL_DRIVER&lt;br /&gt;
echo STM32F072xB&lt;br /&gt;
&lt;br /&gt;
echo&lt;br /&gt;
echo &amp;quot;And add the following config options to the GDB OpenOCD Debugging settings (in Run Configurations):&amp;quot;&lt;br /&gt;
echo &amp;quot;-f interface/stlink-v2.cfg -f target/stm32f0x.cfg&amp;quot;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This script needs to be modified according to your needs! (Currently is working for the STM32F072C8, and contains fixed paths! - Note that there minor inconsistencies in some of these ST projects. For example, all the provided STM32F072xB* files by ST work for both types of chips -- STM32F072x8 and STM32F072xB.)&lt;br /&gt;
&lt;br /&gt;
Like described in the script above, some minor manual changes need to be made in Eclipse after running the script.&lt;br /&gt;
&lt;br /&gt;
This should now be a good basis to start a new STM32 project.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Note that the GNU ARM Eclipse plugin always generates a Makefile for every project configuration (Debug / Release). It can be found in &amp;lt;project_folder&amp;gt;/Debug pr &amp;lt;project_folder&amp;gt;/Release respectively.&lt;br /&gt;
&lt;br /&gt;
==== Semihosting ====&lt;br /&gt;
&lt;br /&gt;
http://infocenter.arm.com/help/index.jsp?topic=/com.arm.doc.dui0471c/Bgbjjgij.html:&lt;br /&gt;
&amp;lt;blockquote&amp;gt;&lt;br /&gt;
What is semihosting?&lt;br /&gt;
&lt;br /&gt;
Semihosting is a mechanism that enables code running on an ARM target to communicate and use the Input/Output facilities on a host computer that is running a debugger.&lt;br /&gt;
&lt;br /&gt;
Examples of these facilities include keyboard input, screen output, and disk I/O.&lt;br /&gt;
&amp;lt;/blockquote&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The GNU ARM Eclipse plugin comes with a really bare-bone implementation of some semihosting print functions that can be used to print logs to the console right in Eclipse (over GDB, without using any additional serial/UART connection whatsoever).&lt;br /&gt;
&lt;br /&gt;
Since I&#039;d always create a project without Semihosting enabled in the GNU ARM Eclipse wizard, you can still easily enable it later on:&lt;br /&gt;
&lt;br /&gt;
The easiest way I&#039;ve found so far, is by defining those Preprocessor constants in the C/C++ Project settings (Projects &amp;gt; Properties &amp;gt; C/C++ Build &amp;gt; Settings &amp;gt; Cross ARM GNU C/C++ Compiler &amp;gt; Preprocessor):&lt;br /&gt;
* TRACE&lt;br /&gt;
* OS_USE_TRACE_SEMIHOSTING_STDOUT&lt;br /&gt;
&lt;br /&gt;
And then, by using the following function calls in your code to log stuff to the Eclipse console right away:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
trace_initialize(); // in fact not required&lt;br /&gt;
// (...)&lt;br /&gt;
static int i = 0;&lt;br /&gt;
trace_puts( &amp;quot;hello&amp;quot; );&lt;br /&gt;
trace_printf( &amp;quot;nr %d\n&amp;quot;, i++ );&lt;br /&gt;
HAL_Delay( 1000 );  &lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
These functions were implemented by the author of GNU ARM Eclipse [https://github.com/ilg-ul Liviu Ionescu], and can be looked up in these files:&lt;br /&gt;
* &amp;lt;eclipse_project&amp;gt;/system/include/arm/semihosting.h&lt;br /&gt;
* &amp;lt;eclipse_project&amp;gt;/system/include/diag/Trace.h&lt;br /&gt;
* &amp;lt;eclipse_project&amp;gt;/system/src/diag/Trace.c&lt;br /&gt;
* &amp;lt;eclipse_project&amp;gt;/system/src/diag/trace_impl.c&lt;br /&gt;
&lt;br /&gt;
An interesting comment in &#039;&#039;trace_impl.c:133&#039;&#039; says:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
// Semihosting is the other output channel that can be used for the trace&lt;br /&gt;
// messages. It comes in two flavours: STDOUT and DEBUG. The STDOUT channel&lt;br /&gt;
// is the equivalent of the stdout in POSIX and in most cases it is forwarded&lt;br /&gt;
// to the GDB server stdout stream. The debug channel is a separate&lt;br /&gt;
// channel. STDOUT is buffered, so nothing is displayed until a \n;&lt;br /&gt;
// DEBUG is not buffered, but can be slow.&lt;br /&gt;
//&lt;br /&gt;
// Choosing between semihosting stdout and debug depends on the capabilities&lt;br /&gt;
// of your GDB server, and also on specific needs. It is recommended to test&lt;br /&gt;
// DEBUG first, and if too slow, try STDOUT.&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Note that semihosting needs to be enabled in your Eclipse run configuration (it is by default), in the Startup tab &amp;gt; Enable ARM semihosting. This will tell GDB to use semihosting. Without enabling, calls to those trace_* functions will throw some kind of exception... and make the processor halt. I couldn&#039;t find out much yet about how this feature really works, somehow it uses a special BKPT instruction...&lt;br /&gt;
&lt;br /&gt;
Semihosting (OS_USE_TRACE_SEMIHOSTING_STDOUT) can also be used in &amp;quot;Release&amp;quot; builds, since the semihosted calls don&#039;t rely on debug symbols.&lt;br /&gt;
&lt;br /&gt;
=== IDE: Code::Blocks ===&lt;br /&gt;
&lt;br /&gt;
My favorite cross-platform IDE for C/C++ is Code::Blocks. - And luckily, it also works well for ARM development! After twiddling around with those confusing Eclipse settings, I&#039;ve almost forgot to try out and setup Code::Blocks.&lt;br /&gt;
&lt;br /&gt;
The steps required are bit unintuitive, but building and debugging projects with full auto-complete and indexer support works now.&lt;br /&gt;
&lt;br /&gt;
The advantages over using Eclipse:&lt;br /&gt;
* Faster GUI.&lt;br /&gt;
* Works with STM32CubeMX generated code.&lt;br /&gt;
* Uses just a plain/manually editable Makefile to build the project.&lt;br /&gt;
* Familiar C/C++ settings and more *transparent* project handling -&amp;gt; Edit + debug. Nothing more. Everything can be done by hand on a console too. No mysterious hidden helpers...&lt;br /&gt;
&lt;br /&gt;
I&#039;m still evaluating this workflow... But to get things up and running, you can do this:&lt;br /&gt;
&lt;br /&gt;
(Assuming you already have a working Makefile based project, e.g. [http://wiki.sgmk-ssam.ch/wiki/STM32_dev#STM32CubeMX_to_Makefile created with STM32CubeMX, like described above]).&lt;br /&gt;
&lt;br /&gt;
* Open Code::Blocks and create an &#039;&#039;&#039;empty&#039;&#039;&#039; project (&#039;&#039;File &amp;gt; New &amp;gt; Project &amp;gt; Empty project&#039;&#039;).&lt;br /&gt;
* Give it a name in the Wizard, and choose the &#039;&#039;GNU GCC Compiler for ARM&#039;&#039;, and save it. &lt;br /&gt;
* Copy all content of the Makefile project over to Code::Blocks project folder.&lt;br /&gt;
* Import all required source files into the Code::Blocks workspace (right click -&amp;gt; &#039;&#039;Add files recursively...&#039;&#039;). &lt;br /&gt;
* Check &#039;&#039;Project &amp;gt; Properties &amp;gt; Project settings &amp;gt; Makefile: This is a custom Makefile&#039;&#039;.&lt;br /&gt;
* Adjust the build settings in &#039;&#039;Project &amp;gt; Build options &amp;gt; &amp;quot;Make commands&amp;quot;&#039;&#039;. - This might either require you to change the Makefile (i.e. add Debug/Release targets), or the commands. - For simplicity&#039;s sake, just ignore those $make, $makefile variables and overwrite them with your actual commands (i.e.&#039;&#039;$make -f $makefile $target&#039;&#039; -&amp;gt; &#039;&#039;make all&#039;&#039;).&lt;br /&gt;
* &#039;&#039;Build&#039;&#039; the project and check in the &#039;&#039;Build log&#039;&#039; if there where any errors/warnings.&lt;br /&gt;
&lt;br /&gt;
So, if this is working now, try to edit a source file and see if those really useful auto-complete and jump to declaration/implementation features are working. - One caveat of using an external Makefile is that the IDE doesn&#039;t know the current settings. So, for example, #defines are not available, and syntax highlighting will not update automatically... So it might be worth it add settings manually at some point.&lt;br /&gt;
&lt;br /&gt;
Now, to get the flashing and debugging working, try this:&lt;br /&gt;
&lt;br /&gt;
* Go to the &#039;&#039;Settings &amp;gt; Debugger&#039;&#039; Settings.&lt;br /&gt;
* Add a new GDB debugger setting (hit &#039;&#039;Create Config&#039;&#039; and call it &#039;&#039;ARM OpenOCD&#039;&#039; for example).&lt;br /&gt;
* Change the &#039;&#039;Executable path&#039;&#039; according to your toolchains location, and check &#039;Do *not* run the debugee&#039;.&lt;br /&gt;
* Go to &#039;&#039;Projects &amp;gt; Properties &amp;gt; Debugger&#039;&#039;.&lt;br /&gt;
** Change the &amp;lt;Project&amp;gt; &#039;&#039;Remote connection&#039;&#039; settings to IP: 127.0.0.1 / Port: 3333.&lt;br /&gt;
** Go to the &amp;lt;Project&amp;gt; &#039;&#039;Additional GDB commands&#039;&#039; tab. And enter those commands into the &#039;&#039;After connection&#039;&#039; box (change filename!):&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
monitor halt&lt;br /&gt;
load ./build/test.elf&lt;br /&gt;
file ./build/test.elf&lt;br /&gt;
monitor sleep 1000&lt;br /&gt;
monitor reset&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
To not run the program automatically, remove the last two commands. Then you need to &#039;&#039;Start / Continue&#039;&#039; the program twice, but you&#039;ll catch the first breakpoint you&#039;ve set!&lt;br /&gt;
* Choose &#039;&#039;Debug &amp;gt; Active Debuggers &amp;gt; GDB/CDB Debugger: ARM OpenOCD&#039;&#039;.&lt;br /&gt;
* Start OpenOCD in a terminal. (Described above).&lt;br /&gt;
* Start debugging by pressing the red arrow (Run / continue) in the debugging toolbar.&lt;br /&gt;
&lt;br /&gt;
The steps are the same as the ones in [http://www.hackvandedam.nl/blog/?p=707 this tutorial &#039;&#039;&#039;with screenshots&#039;&#039;&#039;].&lt;br /&gt;
&lt;br /&gt;
=== stlink ===&lt;br /&gt;
&lt;br /&gt;
[https://github.com/texane/stlink stlink] is a command line tool for programming, inspecting and debugging the STM32 microcontrollers. It also used internally by OpenOCD (I think). - It comes with several small programs (st-flash, st-info, st-term, st-util) that can come in handy while working with the STM32 micros.&lt;br /&gt;
&lt;br /&gt;
There&#039;s a tutorial:&lt;br /&gt;
https://github.com/texane/stlink/blob/master/doc/tutorial/tutorial.pdf&lt;br /&gt;
&lt;br /&gt;
Some useful things I&#039;ve discovered:&lt;br /&gt;
&lt;br /&gt;
Just run st-util can Ctrl-C again to see all relevant uC properties:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
$ st-util&lt;br /&gt;
2016-01-29T13:06:25 INFO src/stlink-common.c: Loading device parameters....&lt;br /&gt;
2016-01-29T13:06:25 INFO src/stlink-common.c: Device connected is: F07x device, id 0x20016448&lt;br /&gt;
2016-01-29T13:06:25 INFO src/stlink-common.c: SRAM size: 0x4000 bytes (16 KiB), Flash: 0x10000 bytes (64 KiB) in pages of 2048 bytes&lt;br /&gt;
2016-01-29T13:06:25 INFO gdbserver/gdb-server.c: Chip ID is 00000448, Core ID is  0bb11477.&lt;br /&gt;
2016-01-29T13:06:25 INFO gdbserver/gdb-server.c: Target voltage is 3554 mV.&lt;br /&gt;
2016-01-29T13:06:25 INFO gdbserver/gdb-server.c: Listening at *:4242...&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Or with st-info:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
$ st-info &lt;br /&gt;
st-info --flash&lt;br /&gt;
st-info --sram&lt;br /&gt;
st-info --descr&lt;br /&gt;
st-info --pagesize&lt;br /&gt;
st-info --chipid&lt;br /&gt;
$ st-info --flash&lt;br /&gt;
0x10000&lt;br /&gt;
$ st-info --sram&lt;br /&gt;
0x4000&lt;br /&gt;
$ st-info --descr&lt;br /&gt;
F07x device&lt;br /&gt;
$ st-info --pagesize&lt;br /&gt;
0x800&lt;br /&gt;
$ st-info --chipid&lt;br /&gt;
0x0448&lt;br /&gt;
&lt;br /&gt;
$ echo `st-info --sram | xargs -I@ printf &amp;quot;%d/1024\n&amp;quot; @ | bc`kB RAM&lt;br /&gt;
16kB RAM&lt;br /&gt;
$ echo `st-info --flash | xargs -I@ printf &amp;quot;%d/1024\n&amp;quot; @ | bc`kB FLASH&lt;br /&gt;
64kB FLASH&lt;br /&gt;
&lt;br /&gt;
$ for a in sram flash pagesize; do echo `st-info --$a | xargs -I@ printf &amp;quot;%d/1024\n&amp;quot; @ | bc`kb $a; done&lt;br /&gt;
16kb sram&lt;br /&gt;
64kb flash&lt;br /&gt;
2kb pagesize&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Or simply:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
$ st-info --probe&lt;br /&gt;
Found 1 stlink programmers&lt;br /&gt;
 serial: 303030303030303030303031&lt;br /&gt;
openocd: &amp;quot;\x30\x30\x30\x30\x30\x30\x30\x30\x30\x30\x30\x31&amp;quot;&lt;br /&gt;
  flash: 131072 (pagesize: 256)&lt;br /&gt;
   sram: 16384&lt;br /&gt;
 chipid: 0x0416&lt;br /&gt;
  descr: L1 Med-density device&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Links ===&lt;br /&gt;
&lt;br /&gt;
==== Tools ====&lt;br /&gt;
* [https://gnuarmeclipse.github.io/ GNU ARM Eclipse]: [https://gnuarmeclipse.github.io/eclipse/workspace/preferences/ workspace_preferences], [http://gnuarmeclipse.github.io/toolchain/path/ toolchain_path], [http://gnuarmeclipse.github.io/eclipse/project/portability/ project_portability]&lt;br /&gt;
&lt;br /&gt;
==== Tutorials ====&lt;br /&gt;
* Great introduction: [http://www.triplespark.net/elec/pdev/arm/stm32.html Programming STM32 F2, F4 ARMs under Linux: A Tutorial from Scratch]&lt;br /&gt;
* STM32Cube to GNU ARM Eclipse tips: http://www.carminenoviello.com/en/2015/06/04/stm32-applications-eclipse-gcc-stcube/&lt;br /&gt;
* Micro Python on STM32F4-Discovery: http://gpio.kaltpost.de/?p=2082&lt;br /&gt;
* Logs: https://hackaday.io/project/4277/logs?page=2&lt;br /&gt;
* Code::Blocks tutorial: http://www.hackvandedam.nl/blog/?p=707&lt;br /&gt;
* Eclipse tutorial: http://www.carminenoviello.com/en/2015/06/04/stm32-applications-eclipse-gcc-stcube&lt;br /&gt;
* http://sigalrm.blogspot.ch/2013/12/using-ccm-memory-on-stm32.html&lt;br /&gt;
* http://stm32f4-discovery.com/2014/08/stm32f4-external-interrupts-tutorial/&lt;br /&gt;
* ...&lt;br /&gt;
&lt;br /&gt;
==== Projects / Demos / Code ====&lt;br /&gt;
* MrBlueXav&#039;s Synths: https://github.com/MrBlueXav&lt;br /&gt;
* cliffle&#039;s VGA stuff: https://github.com/cbiffle/m4vgalib-demos, http://cliffle.com/article/2015/06/05/introducing-glitch/&lt;br /&gt;
* ESPruino code: https://github.com/espruino/Espruino -&amp;gt; STM32F401CDU6&lt;br /&gt;
* STM32F4 Audio Codec Board: http://ebrombaugh.studionebula.com/synth/stm32f4_codec/&lt;br /&gt;
* ESPRUINO: http://www.espruino.com/ReferenceSTM32F4DISCOVERY&lt;br /&gt;
* micropython: https://github.com/micropython/micropython&lt;br /&gt;
* STM32F4 DIY: http://mikrocontroller.bplaced.net/wordpress/?page_id=1482&lt;br /&gt;
* STM32F4 overclocking: http://sigalrm.blogspot.ch/2014/01/overclocking-stm32f4.html&lt;br /&gt;
* thermal camera: http://www.theresistornetwork.com/2014/11/flir-lepton-thermal-imaging-sensor.html&lt;br /&gt;
* STM32F7: http://hackaday.com/2015/06/26/new-part-day-stm32f7-an-arm-cortex-m7/&lt;br /&gt;
* Karsten Schmidt: http://workshop.thi.ng/ [https://soundcloud.com/forthcharlie soundcloud] https://github.com/thi-ng/ws-ldn-4 https://github.com/thi-ng/ws-ldn-3 http://asm.thi.ng/&lt;br /&gt;
* Peridrummmm Demo: http://www.pouet.net/prod.php?which=59095 with sources: http://aka-san.halcy.de/revision2012/peridiummmm-src.zip&lt;br /&gt;
* Andy&#039;s Workshop: http://andybrown.me.uk/&lt;br /&gt;
* axoloti: http://axoloti.com/&lt;br /&gt;
&lt;br /&gt;
==== Libraries ====&lt;br /&gt;
* libopencm3 http://libopencm3.org/wiki/Main_Page&lt;br /&gt;
* list of libs: http://mikrocontroller.bplaced.net/wordpress/?page_id=2736&lt;br /&gt;
&lt;br /&gt;
==== OS ====&lt;br /&gt;
* FreeRTOS: http://www.freertos.org/index.html&lt;br /&gt;
* Embedded Linux on STM32: https://github.com/EmcraftSystems&lt;br /&gt;
* ChibiOS: http://www.chibios.org/dokuwiki/&lt;br /&gt;
&lt;br /&gt;
==== General ====&lt;br /&gt;
* ARM Related Books: http://www.arm.com/support/resources/arm-books/&lt;br /&gt;
* STM32 Overview http://www.st.com/web/en/catalog/mmc/FM141/SC1169?sc=stm32&lt;br /&gt;
* mbed https://en.wikipedia.org/wiki/Mbed&lt;br /&gt;
* CMSIS: http://www.keil.com/pack/doc/cmsis/Core/html/index.html&lt;br /&gt;
&lt;br /&gt;
== Hardware ==&lt;br /&gt;
&lt;br /&gt;
All about hardware and hardware tools for STM32 dev. Chips, programmers etc.&lt;br /&gt;
&lt;br /&gt;
=== ST-Link V2 Programmer ===&lt;br /&gt;
&lt;br /&gt;
There are two popular ST-Link V2 Progammers on the market. They have a different pinout but work both well like described above.&lt;br /&gt;
&lt;br /&gt;
[[File:ST-LinkV2_pinout_01.jpg]]&lt;br /&gt;
&lt;br /&gt;
Alternatively, STM32Discovery/[http://jeelabs.org/book/1547a/index.html Nucleo boards too can be used as SWD programmers].&lt;br /&gt;
&lt;br /&gt;
Luckily, only 4 pins have to be used to program and debug the target!&lt;br /&gt;
To find out more about this protocol, have a look into [http://www.arm.com/products/system-ip/debug-trace/coresight-soc-components/serial-wire-debug.php Serial Debug Wire (SWD)] as an alternative to JTAG.&lt;br /&gt;
&lt;br /&gt;
Connect to following pins of the programmer to the corresponding pins on the PCB:&lt;br /&gt;
&lt;br /&gt;
* V3V&lt;br /&gt;
* GND&lt;br /&gt;
* SWCLK&lt;br /&gt;
* SWDIO&lt;br /&gt;
&lt;br /&gt;
-&amp;gt; NRST can be important too on some STM32 chips!&lt;br /&gt;
&lt;br /&gt;
Remember: These are &#039;&#039;&#039;not&#039;&#039;&#039; the [http://www.st.com/web/catalog/tools/FM146/CL1984/SC724/SS1677/PF251168 official ST-Link V2 Programmers], sold by ST.&lt;br /&gt;
&lt;br /&gt;
== Projects ==&lt;br /&gt;
&lt;br /&gt;
STM32 based projects.&lt;br /&gt;
&lt;br /&gt;
=== STM32basic ===&lt;br /&gt;
&lt;br /&gt;
STM32basic is a test board to see how STM32 chips can be used in DIY circuits.&lt;br /&gt;
&lt;br /&gt;
==== STM32basic rev0.01 ====&lt;br /&gt;
&lt;br /&gt;
An initial list of tests:&lt;br /&gt;
&lt;br /&gt;
* JTAG: See how we can program the thing. Do we need all JTAG pins? Or only the SWD pins? What about reset? - Do the cheapo Chinese STLink V2 programmer really work?&lt;br /&gt;
* Basic I/O: LED and push button.&lt;br /&gt;
* U(S)ART: Check whether it&#039;s possible to hook up an FTDI to send/receive characters to/from the STM32basic?&lt;br /&gt;
* BOOT0/1: What about those boot modes?&lt;br /&gt;
* Power Usage : 3V3 Regulator: ..&lt;br /&gt;
&lt;br /&gt;
[[File:STM32basic_pcb1b.jpg]]&lt;br /&gt;
&lt;br /&gt;
Board at OSH Park:&amp;lt;br /&amp;gt;&lt;br /&gt;
https://oshpark.com/shared_projects/kCD7Yr0A&lt;br /&gt;
&lt;br /&gt;
KiCad project and everything else:&amp;lt;br /&amp;gt;&lt;br /&gt;
Remark: this has been made in hurry and is just a test:&amp;lt;br /&amp;gt;&lt;br /&gt;
http://0rel.com/prj/STM32basic/STM32basic_rev0.01.zip&lt;br /&gt;
&lt;br /&gt;
[[File:Stm32basic1.jpg]]&lt;br /&gt;
&lt;br /&gt;
So far, the tests have been working ok.&lt;br /&gt;
&lt;br /&gt;
* STLink V2 programmers seem to work fine, and only require 2 pins + VCC/GND! SWDIO and SWCLK, that&#039;s it! For programming and on-chip debugging.&lt;br /&gt;
* I/O works as well. External interrupts can be configured.&lt;br /&gt;
* UART works, but I have not yet tested it with a proper code. It was working with some echo snippet I&#039;ve found somewhere.&lt;br /&gt;
* Power usage is low. ~15 mA at 3.3 V.&lt;br /&gt;
* BOOT0 jumper has to be set (connected to ground) in order to run code... - Other boot modes have not been tested yet. More tests are needed there... What are the other available boot modes, what about those built-in boot loaders?&lt;br /&gt;
&lt;br /&gt;
However, the board has several flaws:&lt;br /&gt;
* 1.27 mm pin-pitch headers cannot be arranged like that (GPIOs). They need to be further apart to make sockets/headers fit.&lt;br /&gt;
* 3V3 LDO doesn&#039;t make much sense like this. Add add a buck/boost converter. Also remove 5V label.&lt;br /&gt;
* This BOOT0 jumper isn&#039;t nice like this...&lt;br /&gt;
* Remove unnecessary JTAG pins. SWD only.&lt;br /&gt;
* Remove unnecessary USART pins.&lt;br /&gt;
* Add crystal.&lt;br /&gt;
* Add USB plug.&lt;br /&gt;
&lt;br /&gt;
Probably, this will not be remade, since it was enough for a test. I&#039;d like to make a very basic USB touch device next.&lt;br /&gt;
&lt;br /&gt;
==== STM32basic Eclipse project ====&lt;br /&gt;
&lt;br /&gt;
Test project to see if GPIOs with External interrupts and semi hosting works. Sloppy and not cleaned up yet...&amp;lt;br /&amp;gt;&lt;br /&gt;
http://0rel.com/prj/STM32basic/testSTM32F072_interrupt_test0.zip&lt;br /&gt;
&lt;br /&gt;
Note: Eclipse projects can be imported in an existing or new workspace with: &#039;&#039;File &amp;gt; Import &amp;gt; General &amp;gt; Existing Projects into Workspace&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
=== todo ===&lt;br /&gt;
&lt;br /&gt;
* I2C peripherals&lt;br /&gt;
* I2S peripherals&lt;br /&gt;
* SPI peripherals&lt;br /&gt;
* touch&lt;br /&gt;
* usb&lt;br /&gt;
* external memory (sram, flash, eeprom...) -&amp;gt; RTOS / Linux / ChibiOS? (similar to this http://hforsten.com/making-embedded-linux-computer.html)?&lt;br /&gt;
.....&lt;/div&gt;</summary>
		<author><name>0rel</name></author>
	</entry>
	<entry>
		<id>https://wiki.sgmk-ssam.ch/index.php?title=STM32_dev&amp;diff=6574</id>
		<title>STM32 dev</title>
		<link rel="alternate" type="text/html" href="https://wiki.sgmk-ssam.ch/index.php?title=STM32_dev&amp;diff=6574"/>
		<updated>2016-10-15T18:21:26Z</updated>

		<summary type="html">&lt;p&gt;0rel: /* stlink */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Overview ==&lt;br /&gt;
&lt;br /&gt;
Notes on STM32 microcontrollers and on how to get them working in DIY projects.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;/// this is a work in progress draft ///&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
== Software ==&lt;br /&gt;
&lt;br /&gt;
All about software tools for STM32 dev. Development environments, compilers, debuggers, IDEs etc.&lt;br /&gt;
&lt;br /&gt;
=== ARM toolchains ===&lt;br /&gt;
&lt;br /&gt;
==== gcc-arm-embedded Toolchain ====&lt;br /&gt;
&lt;br /&gt;
Install the GCC arm-none-eabi toolchain for your OS. On Arch Linux this can be done with the package manager:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
$ sudo pacman -S arm-none-eabi-gcc arm-none-eabi-gdb arm-none-eabi-binutils arm-none-eabi-newlib&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Alternatively, it can be built from scratch, to have all tools and their sources in one place.&lt;br /&gt;
&lt;br /&gt;
* Download the sources here: https://launchpad.net/gcc-arm-embedded/+download&lt;br /&gt;
* Install the &#039;&#039;common tools and libraries&#039;&#039; like described in the [https://launchpadlibrarian.net/231136652/How-to-build-toolchain.pdf documentation].&lt;br /&gt;
* Build the toolchain. - On my system, the following steps were required:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
$ cp gcc-arm-none-eabi-5_2-2015q4-20151219-src.tar.bz2 ~/toolchain&lt;br /&gt;
$ cd ~/toolchain&lt;br /&gt;
$ tar -xjf gcc-arm-none-eabi-5_2-2015q4-20151219-src.tar.bz2&lt;br /&gt;
$ cd ./gcc-arm-none-eabi-5_2-2015q4-20151219/src&lt;br /&gt;
$ find -name &#039;*.tar.*&#039; | xargs -I% tar -xf %&lt;br /&gt;
$ cd ..&lt;br /&gt;
$ ./build-prerequisites.sh --skip_steps=mingw32&lt;br /&gt;
$ ./build-toolchain.sh --skip_steps=mingw32,manual&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
Note that those &#039;&#039;skip_steps&#039;&#039; options were required in my case.&lt;br /&gt;
&lt;br /&gt;
==== Linaro Toolchain ====&lt;br /&gt;
&lt;br /&gt;
The [https://en.wikipedia.org/wiki/Linaro Linaro] toolchain seems to be famous as well.&lt;br /&gt;
&lt;br /&gt;
Install it with your package manager if available, or build it yourself:&amp;lt;br /&amp;gt;&lt;br /&gt;
https://wiki.linaro.org/WorkingGroups/ToolChain&amp;lt;br /&amp;gt;&lt;br /&gt;
https://wiki.linaro.org/WorkingGroups/ToolChain/FAQ&lt;br /&gt;
&lt;br /&gt;
==== devkitpro devkitARM toolchain ====&lt;br /&gt;
&lt;br /&gt;
Another gcc variant: http://devkitpro.org/&lt;br /&gt;
&lt;br /&gt;
Used in the homebrew scene for game consoles like the GP32, Nintendo (3)DS and GBA. It can [http://www.pouet.net/prod.php?which=59095 apparently] also be used for the STM32s as well! And generates probably more optimized binaries?&lt;br /&gt;
&lt;br /&gt;
(On Arch it can be installed from the AUR: https://aur.archlinux.org/packages/devkitarm-bin/ . But beware, the compiler, link, binutils have all the same name as the ones from the official GCC arm-none-eabi toolchain. So it&#039;s probably better to install it manually.)&lt;br /&gt;
&lt;br /&gt;
=== STM32CubeMX on Linux ===&lt;br /&gt;
&lt;br /&gt;
STM32CubeMX is a code generator for STM32 micros that can come in handy when you start a new project. It generates all the necessary init and HAL code, library and custom pin mux code for your specific MCU.&lt;br /&gt;
&lt;br /&gt;
Unfortunately, it comes as a Windows EXE and ST doesn&#039;t mention that it actually is a Java application. Luckily it can be installed on Linux by hand (thanks to 5V Joe&#039;s great note [http://fivevolt.blogspot.ch/2014/07/installing-stm32cubemx-on-linux.html there]):&lt;br /&gt;
&lt;br /&gt;
* Download [http://www.st.com/web/catalog/tools/FM147/CL1794/SC961/SS1743/PF259242?icmp=stm32cubemx_pron_prcube_feb2014&amp;amp;sc=stm32cube-pr STM32CubeMX].&lt;br /&gt;
* Install the application (tested in January 2016):&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
$ unzip SetupSTM32CubeMX-4.12.0.exe -d stm32cube&lt;br /&gt;
$ cd stm32cube&lt;br /&gt;
$ java -cp . com.izforge.izpack.installer.bootstrap.Installer&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
* Run:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
$ cd &amp;lt;install_dir&amp;gt;&lt;br /&gt;
$ unzip STM32CubeMX.exe&lt;br /&gt;
$ java -cp . com.st.microxplorer.maingui.STM32CubeMX&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== STM32CubeMX to Makefile ===&lt;br /&gt;
&lt;br /&gt;
For whatever reason, STM32CubeMX does not export plain GCC/Makefiles along with the initialization code. But instead, it supports an unpopular IDE called [http://www.st.com/web/catalog/tools/FM147/CL1794/SC961/SS1533/PF261797 SW4STM32], which is also based on free GNU tools. So after installing STM32CubeMX, these are the steps to get the GCC/Makefile project running:&lt;br /&gt;
&lt;br /&gt;
* Get this nice Python script by [http://www.ba0sh1.com/ Baoshi] to generate the Makefile for an exported SW4STM32 project:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
$ git clone https://github.com/baoshi/CubeMX2Makefile&lt;br /&gt;
$ cd CubeMX2Makefile&lt;br /&gt;
$ python2 CubeMX2Makefile.py &amp;lt;your_sw4stm32_prject_dir&amp;gt;&lt;br /&gt;
$ cd &amp;lt;your_sw4stm32_prject_dir&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* Fix a tiny bug in the generated Makefile (tested in January 2016). More can be read [http://www.ba0sh1.com/stm32cubemx-gcc-makefile/ here].&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
$ grep __weak Makefile &lt;br /&gt;
C_DEFS = -D__weak=&amp;quot;__attribute__\(\(weak\)\)&amp;quot; -D__packed=&amp;quot;__attribute__\(\(__packed__\)\)&amp;quot; -DUSE_HAL_DRIVER -DSTM32F072xB&lt;br /&gt;
$ sed -i &#039;s/\\(\\(weak\\)\\)/((weak))/g&#039; Makefile &lt;br /&gt;
$ sed -i &#039;s/\\(\\(packed\\)\\)/((packed))/g&#039; Makefile &lt;br /&gt;
$ grep __weak Makefile &lt;br /&gt;
C_DEFS = -D__weak=&amp;quot;__attribute__((weak))&amp;quot; -D__packed=&amp;quot;__attribute__\(\(__packed__\)\)&amp;quot; -DUSE_HAL_DRIVER -DSTM32F072xB&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* Then build the binary:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
$ make&lt;br /&gt;
(...)&lt;br /&gt;
arm-none-eabi-size build/STM32F072RBT6.elf&lt;br /&gt;
   text	   data	    bss	    dec	    hex	filename&lt;br /&gt;
   4568	     12	   1572	   6152	   1808	build/STM32F072RBT6.elf&lt;br /&gt;
arm-none-eabi-objcopy -O ihex build/STM32F072RBT6.elf build/STM32F072RBT6.hex&lt;br /&gt;
arm-none-eabi-objcopy -O binary -S build/STM32F072RBT6.elf build/STM32F072RBT6.bin	&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Flash ===&lt;br /&gt;
&lt;br /&gt;
Install OpenOCD and STLINK. On Arch Linux:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
sudo pacman -S stlink openocd&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now [http://openocd.org/ OpenOCD] and (arm-none-eabi-)gdb can be used to program and debug the MCU. All discovery boards also come with an ST-LINK/V2 programmer right built in speaking over USB to the host and over JTAG/[http://www.arm.com/products/system-ip/debug-trace/coresight-soc-components/serial-wire-debug.php SWD] to the target (note: only two pins are actually required for SWD debugging/flashing (SWDIO/SWCLK), but that for later (see also [[#Hardware]])). STM32 Discovery Boards should show up in the lsusb list like that:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
$ lsusb&lt;br /&gt;
(...)&lt;br /&gt;
Bus 003 Device 006: ID 0483:3748 STMicroelectronics ST-LINK/V2&lt;br /&gt;
(...)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
OpenOCD can now act as a &amp;quot;middleman&amp;quot; between the ST-LINK programmer and the user. As a server on the host, to which you can connect with telnet and GDB.&lt;br /&gt;
&lt;br /&gt;
To configure OpenOCD, put a configuration file called opencd.cfg into the project folder and start OpenOCD. While working on the project, let it run there in the foreground to see all the logs...&lt;br /&gt;
&lt;br /&gt;
For the [http://www.st.com/st-web-ui/static/active/jp/resource/technical/document/user_manual/DM00099401.pdf STM32 F072 Discovery] board this should work, for example:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
$ cd &amp;lt;project_directory&amp;gt;&lt;br /&gt;
$ echo &amp;quot;source [find board/stm32f0discovery.cfg]&amp;quot; &amp;gt; openocd.cfg&lt;br /&gt;
$ openocd&lt;br /&gt;
Open On-Chip Debugger 0.9.0 (2015-05-19-13:50)&lt;br /&gt;
Licensed under GNU GPL v2&lt;br /&gt;
For bug reports, read&lt;br /&gt;
	http://openocd.org/doc/doxygen/bugs.html&lt;br /&gt;
Info : The selected transport took over low-level target control. The results might differ compared to plain JTAG/SWD&lt;br /&gt;
adapter speed: 1000 kHz&lt;br /&gt;
adapter_nsrst_delay: 100&lt;br /&gt;
none separate&lt;br /&gt;
srst_only separate srst_nogate srst_open_drain connect_deassert_srst&lt;br /&gt;
Info : Unable to match requested speed 1000 kHz, using 950 kHz&lt;br /&gt;
Info : Unable to match requested speed 1000 kHz, using 950 kHz&lt;br /&gt;
Info : clock speed 950 kHz&lt;br /&gt;
Info : STLINK v2 JTAG v17 API v2 SWIM v0 VID 0x0483 PID 0x3748&lt;br /&gt;
Info : using stlink api v2&lt;br /&gt;
Info : Target voltage: 2.896454&lt;br /&gt;
Info : stm32f0x.cpu: hardware has 4 breakpoints, 2 watchpoints&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
(Don&#039;t worry about those warnings about the wrong clock speed for now...)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
In order to program the flash, connect to OpenOCD via telnet in another terminal:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
$ telnet 127.0.0.1 4444&lt;br /&gt;
Trying 127.0.0.1...&lt;br /&gt;
Connected to 127.0.0.1.&lt;br /&gt;
Escape character is &#039;^]&#039;.&lt;br /&gt;
Open On-Chip Debugger&lt;br /&gt;
&amp;gt; &lt;br /&gt;
&amp;gt; reset halt&lt;br /&gt;
target state: halted&lt;br /&gt;
target halted due to debug-request, current mode: Thread &lt;br /&gt;
xPSR: 0xc1000000 pc: 0x080014d0 msp: 0x20004000&lt;br /&gt;
&amp;gt; flash probe 0&lt;br /&gt;
device id = 0x20016448&lt;br /&gt;
flash size = 128kbytes&lt;br /&gt;
flash &#039;stm32f1x&#039; found at 0x08000000&lt;br /&gt;
&amp;gt; flash write_image erase build/STM32F072RBT6.elf&lt;br /&gt;
auto erase enabled&lt;br /&gt;
target state: halted&lt;br /&gt;
target halted due to breakpoint, current mode: Thread &lt;br /&gt;
xPSR: 0x61000000 pc: 0x2000003a msp: 0x20004000&lt;br /&gt;
wrote 6144 bytes from file build/STM32F072RBT6.elf in 0.503961s (11.906 KiB/s)&lt;br /&gt;
&amp;gt; reset run&lt;br /&gt;
&amp;gt; exit&lt;br /&gt;
Connection closed by foreign host.&lt;br /&gt;
$&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This should write the binary to the flash memory and start the program.&lt;br /&gt;
Of course, all those steps can be automated further and integrated into an IDE, but that&#039;s for later...&lt;br /&gt;
&lt;br /&gt;
To program the STM32F0Discovery board for example, this can be used to just flash the chip:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
$ openocd -f board/stm32f0discovery.cfg -c &amp;quot;program build/STM32F072RBT6.elf verify reset exit&amp;quot; &lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
To program a custom board for example with the STM32F0x chip, a command like this can be used:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
$ openocd -f interface/stlink-v2.cfg -f target/stm32f0x.cfg -c &amp;quot;program testSTM32F072_interrupt_test0.elf verify reset exit&amp;quot;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
To make things more convenient, add a new target &#039;&#039;flash&#039;&#039; to the Makefile with this command, and you can simply run &#039;&#039;make flash&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The exported main.c from STM32CubeMX was only slightly modified to let the user LEDs flash and react to the user pushbutton:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
******************************************************************************&lt;br /&gt;
* main.c *&lt;br /&gt;
******************************************************************************&lt;br /&gt;
&lt;br /&gt;
#include &amp;quot;stm32f0xx_hal.h&amp;quot;&lt;br /&gt;
&lt;br /&gt;
void SystemClock_Config(void);&lt;br /&gt;
static void MX_GPIO_Init(void);&lt;br /&gt;
&lt;br /&gt;
int main(void)&lt;br /&gt;
{&lt;br /&gt;
  /* Reset of all peripherals, Initializes the Flash interface and the Systick. */&lt;br /&gt;
  HAL_Init();&lt;br /&gt;
&lt;br /&gt;
  /* Configure the system clock */&lt;br /&gt;
  SystemClock_Config();&lt;br /&gt;
&lt;br /&gt;
  /* Initialize all configured peripherals */&lt;br /&gt;
  MX_GPIO_Init();&lt;br /&gt;
&lt;br /&gt;
  while (1)&lt;br /&gt;
  {&lt;br /&gt;
    uint32_t delay;&lt;br /&gt;
    if( HAL_GPIO_ReadPin( GPIOA, GPIO_PIN_0 ) == GPIO_PIN_SET )&lt;br /&gt;
      delay = 50;&lt;br /&gt;
    else&lt;br /&gt;
      delay = 250;&lt;br /&gt;
&lt;br /&gt;
    HAL_GPIO_TogglePin( GPIOC, GPIO_PIN_9 );&lt;br /&gt;
    HAL_Delay( delay );&lt;br /&gt;
    HAL_GPIO_TogglePin( GPIOC, GPIO_PIN_8 );&lt;br /&gt;
    HAL_Delay( delay );&lt;br /&gt;
    HAL_GPIO_TogglePin( GPIOC, GPIO_PIN_7 );&lt;br /&gt;
    HAL_Delay( delay );&lt;br /&gt;
    HAL_GPIO_TogglePin( GPIOC, GPIO_PIN_6 );&lt;br /&gt;
    HAL_Delay( delay );&lt;br /&gt;
&lt;br /&gt;
  }&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
/** System Clock Configuration&lt;br /&gt;
*/&lt;br /&gt;
void SystemClock_Config(void)&lt;br /&gt;
{&lt;br /&gt;
&lt;br /&gt;
  RCC_OscInitTypeDef RCC_OscInitStruct;&lt;br /&gt;
  RCC_ClkInitTypeDef RCC_ClkInitStruct;&lt;br /&gt;
&lt;br /&gt;
  RCC_OscInitStruct.OscillatorType = RCC_OSCILLATORTYPE_HSI;&lt;br /&gt;
  RCC_OscInitStruct.HSIState = RCC_HSI_ON;&lt;br /&gt;
  RCC_OscInitStruct.HSICalibrationValue = 16;&lt;br /&gt;
  RCC_OscInitStruct.PLL.PLLState = RCC_PLL_NONE;&lt;br /&gt;
  HAL_RCC_OscConfig(&amp;amp;RCC_OscInitStruct);&lt;br /&gt;
&lt;br /&gt;
  RCC_ClkInitStruct.ClockType = RCC_CLOCKTYPE_SYSCLK;&lt;br /&gt;
  RCC_ClkInitStruct.SYSCLKSource = RCC_SYSCLKSOURCE_HSI;&lt;br /&gt;
  RCC_ClkInitStruct.AHBCLKDivider = RCC_SYSCLK_DIV1;&lt;br /&gt;
  RCC_ClkInitStruct.APB1CLKDivider = RCC_HCLK_DIV1;&lt;br /&gt;
  HAL_RCC_ClockConfig(&amp;amp;RCC_ClkInitStruct, FLASH_LATENCY_0);&lt;br /&gt;
&lt;br /&gt;
  HAL_SYSTICK_Config(HAL_RCC_GetHCLKFreq()/1000);&lt;br /&gt;
&lt;br /&gt;
  HAL_SYSTICK_CLKSourceConfig(SYSTICK_CLKSOURCE_HCLK);&lt;br /&gt;
&lt;br /&gt;
  /* SysTick_IRQn interrupt configuration */&lt;br /&gt;
  HAL_NVIC_SetPriority(SysTick_IRQn, 0, 0);&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
/** Configure pins as&lt;br /&gt;
        * Analog&lt;br /&gt;
        * Input&lt;br /&gt;
        * Output&lt;br /&gt;
        * EVENT_OUT&lt;br /&gt;
        * EXTI&lt;br /&gt;
*/&lt;br /&gt;
void MX_GPIO_Init(void)&lt;br /&gt;
{&lt;br /&gt;
&lt;br /&gt;
  GPIO_InitTypeDef GPIO_InitStruct;&lt;br /&gt;
&lt;br /&gt;
  /* GPIO Ports Clock Enable */&lt;br /&gt;
  __GPIOA_CLK_ENABLE();&lt;br /&gt;
  __GPIOC_CLK_ENABLE();&lt;br /&gt;
&lt;br /&gt;
  /*Configure GPIO pin : PA0 */&lt;br /&gt;
  GPIO_InitStruct.Pin = GPIO_PIN_0;&lt;br /&gt;
  GPIO_InitStruct.Mode = GPIO_MODE_INPUT;&lt;br /&gt;
  GPIO_InitStruct.Pull = GPIO_NOPULL;&lt;br /&gt;
  HAL_GPIO_Init(GPIOA, &amp;amp;GPIO_InitStruct);&lt;br /&gt;
&lt;br /&gt;
  /*Configure GPIO pins : PC6 PC7 PC8 PC9 */&lt;br /&gt;
  GPIO_InitStruct.Pin = GPIO_PIN_6|GPIO_PIN_7|GPIO_PIN_8|GPIO_PIN_9;&lt;br /&gt;
  GPIO_InitStruct.Mode = GPIO_MODE_OUTPUT_PP;&lt;br /&gt;
  GPIO_InitStruct.Pull = GPIO_NOPULL;&lt;br /&gt;
  GPIO_InitStruct.Speed = GPIO_SPEED_LOW;&lt;br /&gt;
  HAL_GPIO_Init(GPIOC, &amp;amp;GPIO_InitStruct);&lt;br /&gt;
&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
(&lt;br /&gt;
Note that pins -- among various other things -- can be customized in the CubeMX editor. Reexporting code to an existing project is straight forward, and can be done easily while the old Makefile keeps valid for minor changes... - However, STM32CubeMX looks still quite unfinished to me. It&#039;s a nice concept, but where are all the ST libraries, for example for the [http://www.st.com/web/en/catalog/tools/FM147/CL1794/SC961/SS1743/LN1734/PF258658# touch functionality]? It still needs to be downloaded separately... and it comes in a bloody EXE file as well! *arghs*&lt;br /&gt;
&lt;br /&gt;
Unfortunately, things seem to be a bit confusing. If you&#039;re using a STM32F0, then probably need to take a look into the [http://www.st.com/web/catalog/tools/FM147/CL1794/SC961/SS1743/LN1897/PF260612?icmp=pf260612_pron_nb_jun2014&amp;amp;sc=stm32cubef0-pr STM32CubeF0] software bundle, which contains a more up-to-date TouchSensing Library... Hm.&lt;br /&gt;
&lt;br /&gt;
Also, note that most of the provided code by ST is only documented in the source files themselves... And there are at least two vastly differing versions of the basic functions out there, what makes copy/pasting/sharing a bit difficult. I even don&#039;t know if they continue working on this code base, or if they switch over to [https://www.mbed.com/en/ mbed]. That seems to be the focus of those newer [http://www.st.com/web/catalog/tools/FM116/SC959/SS1532/LN1847?sc=stm32nucleo Nucleo] evaluation boards.&lt;br /&gt;
)&lt;br /&gt;
&lt;br /&gt;
=== Debugging: GDB ===&lt;br /&gt;
&lt;br /&gt;
GDB can be used to debug the code right on the hardware. While OpenOCD is running, you can connect to the target like this and step through the program:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
$ arm-none-eabi-gdb -tui build/STM32F072RBT6.elf&lt;br /&gt;
(...)&lt;br /&gt;
Reading symbols from build/STM32F072RBT6.elf...done.&lt;br /&gt;
&lt;br /&gt;
(gdb) target remote :3333&lt;br /&gt;
Remote debugging using :3333&lt;br /&gt;
Python Exception &amp;lt;type &#039;exceptions.NameError&#039;&amp;gt; Installation error: gdb.execute_u&lt;br /&gt;
nwinders function is missing:&lt;br /&gt;
HAL_GetTick () at Drivers/STM32F0xx_HAL_Driver/Src/stm32f0xx_hal.c:298&lt;br /&gt;
&lt;br /&gt;
(gdb) c&lt;br /&gt;
Continuing.&lt;br /&gt;
&lt;br /&gt;
Program received signal SIGINT, Interrupt.&lt;br /&gt;
0x080002f6 in HAL_Delay (Python Exception &amp;lt;type &#039;exceptions.NameError&#039;&amp;gt; Installa&lt;br /&gt;
tion error: gdb.execute_unwinders function is missing:&lt;br /&gt;
Delay=250)&lt;br /&gt;
    at Drivers/STM32F0xx_HAL_Driver/Src/stm32f0xx_hal.c:317&lt;br /&gt;
&lt;br /&gt;
(gdb) break main.c:91&lt;br /&gt;
Breakpoint 1 at 0x8001392: file Src/main.c, line 91.&lt;br /&gt;
&lt;br /&gt;
(gdb) c&lt;br /&gt;
Continuing.&lt;br /&gt;
Note: automatically using hardware breakpoints for read-only addresses.&lt;br /&gt;
Python Exception &amp;lt;type &#039;exceptions.NameError&#039;&amp;gt; Installation error: gdb.execute_u&lt;br /&gt;
nwinders function is missing:&lt;br /&gt;
&lt;br /&gt;
Breakpoint 1, main () at Src/main.c:91&lt;br /&gt;
&lt;br /&gt;
(...)&lt;br /&gt;
(gdb) detach&lt;br /&gt;
(qdb) quit&lt;br /&gt;
$&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
(Note: the -tui option is really great to inspect the code... see [http://ftp.gnu.org/old-gnu/Manuals/gdb-5.1.1/html_chapter/gdb_19.html GDB Text User Interface])&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== IDE: Eclipse SW4STM32 ===&lt;br /&gt;
&lt;br /&gt;
GOOD NEWS: This officially supported Eclipse variant works out of the box with STM32CubeMX generated project! You simply need to register on that site, and you&#039;ll get a software package that should work:&lt;br /&gt;
&lt;br /&gt;
[http://www.st.com/content/st_com/en/products/development-tools/software-development-tools/stm32-software-development-tools/stm32-ides/sw4stm32.html SW4STM32 - System Workbench for STM32: free IDE on Windows, Linux and OS X ]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
(Side note: I don&#039;t know how well it works when you have another Eclipse installed on your system... currently testing this out.)&lt;br /&gt;
&lt;br /&gt;
=== IDE: Eclipse with GNU ARM Eclipse plugin ===&lt;br /&gt;
&lt;br /&gt;
To use Eclipse as an IDE for the STM32s, just install Eclipse and a the GNU ARM Eclipse Plugin.&lt;br /&gt;
&lt;br /&gt;
* Eclipse IDE for C/C++ (CDT). This can be installed manually or with your package manager.&lt;br /&gt;
* Eclipse Plugin: [https://gnuarmeclipse.github.io/ GNU ARM Eclipse]. - This can be done in the Eclipse Marketplace (under &#039;&#039;Help &amp;gt; Eclipse Marketplace&#039;&#039; (use the default options)).&lt;br /&gt;
* Create a new Eclipse project with the GNU ARM Eclipse (Choose STM32Fxxx C/C++ Project in the Wizard)&lt;br /&gt;
&lt;br /&gt;
With some minor adjustments in the settings (OpenOCD), the basic Blinky example that comes with the plugin should work out of the box, with a STLink v2 programmer. Code completion etc. works fine too.&lt;br /&gt;
&lt;br /&gt;
(/todo: show every step)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
But there&#039;s quite annoying problem with this workflow!:&lt;br /&gt;
&lt;br /&gt;
http://www.carminenoviello.com/en/2015/06/04/stm32-applications-eclipse-gcc-stcube/:&lt;br /&gt;
&amp;lt;blockquote&amp;gt;&lt;br /&gt;
Unfortunately, the plug-in author has updated just the template for STM32-F4 family to the more recently STM32Cube-F4 HAL framework from ST (which still supports only commercial IDE.....), leaving the other templates still based on the old Standard Peripheral Library, which is no longer supported by ST and STM32CubeMX tool used in my tutorial. This causes my instructions to be wrong for processor families different from STM32-F4. &lt;br /&gt;
&amp;lt;/blockquote&amp;gt;&lt;br /&gt;
&lt;br /&gt;
So, several manual setup steps will be required to get started with your own STM32 project. To goal is to configure the project in STM32CubeMX, and use up-to-date HAL code, and not the deprecated Standard Peripheral Library.&lt;br /&gt;
&lt;br /&gt;
The GNU ARM Eclipse plugin is great, but doesn&#039;t create projects with up-to-date code. So we need to modify the manually created GNU ARM Eclipse project. - I used a custom STM32F072C8 board, and all steps below assum this hardware. The steps would be slightly different for other hardware.&lt;br /&gt;
&lt;br /&gt;
([http://www.carminenoviello.com/en/2015/06/04/stm32-applications-eclipse-gcc-stcube This tutorial] was helping here...)&lt;br /&gt;
&lt;br /&gt;
* First create a new &#039;C Project&#039; in your Eclipse workspace.&lt;br /&gt;
* In Wizard slide &#039;&#039;C Project&#039;&#039;: Choose Executable &amp;gt; &#039;&#039;Hello World ARM Cortex-M C/C++ Project&#039;&#039; and give it a name (e.g. testSTM32_00). This will generate a generic ARM project instead of an STM32Fxxx one. - Then hit &#039;&#039;Next&#039;&#039;.&lt;br /&gt;
* In Wizard slide &#039;&#039;Target processor settings&#039;&#039;: Configure the target processor: For the STM32F072C8: Change the defaults to Flash size (kB): 64, RAM size (kB): 16, Use system calls: Freestanding (no POSIX system calls), Trace output: None (no trace output). - Then hit &#039;&#039;Next&#039;&#039;.&lt;br /&gt;
* In Wizard slide &#039;&#039;Folders&#039;&#039;: Change Vendor CMSIS name to stm32f0xx. - Then hit next.&lt;br /&gt;
* In Wizard slide &#039;&#039;Select Configurations&#039;&#039;: Leave as is. - Then hit &#039;&#039;Next&#039;&#039;.&lt;br /&gt;
* In Wizard slide &#039;&#039;Cross GNU ARM Toolchain&#039;&#039;: Select &#039;&#039;GNU Tools for ARM Embedded Processors (arm-none-eabi-gcc)&#039;&#039; and either choose the global, system wide toolchain (probably in /usr/bin) or enter the path to your custom one. - Then hit &#039;&#039;Finish&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
This will create a generic ARM project, which should build without errors (hit Ctrl+B). &lt;br /&gt;
&lt;br /&gt;
Next, we need to add the vendor specific HAL code by ST generated with STM32CubeMX and/or downloaded in a more specific firmware package (STM32CubeF0, STM32CubeF4 etc.).&lt;br /&gt;
&lt;br /&gt;
...&lt;br /&gt;
So, after configuring a generic Eclipse project, we&#039;re ready to modify it.&lt;br /&gt;
&lt;br /&gt;
* Configure and export an EWARM project in [http://www.st.com/web/en/catalog/tools/PF259242 STM32CubeMX] (with default settings).&lt;br /&gt;
&lt;br /&gt;
* Extract the [http://www.st.com/web/en/catalog/tools/PF260612 STM32CubeF0] archive. ([http://www.st.com/web/en/catalog/tools/PF260820 STM32CubeF1], [http://www.st.com/web/en/catalog/tools/PF260266 STM32CubeF2], [http://www.st.com/web/en/catalog/tools/PF260613 STMCubeF3], [http://www.st.com/web/en/catalog/tools/PF259243 STMCubeF4]).&lt;br /&gt;
&lt;br /&gt;
As a starting point, here&#039;s a bash script, that modifies the previously created Eclipse project:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
#!/usr/bin/env bash&lt;br /&gt;
&lt;br /&gt;
set -e&lt;br /&gt;
&lt;br /&gt;
#echo &amp;quot;Press CTRL+C to proceed.&amp;quot;&lt;br /&gt;
#trap &amp;quot;pkill -f &#039;sleep 1h&#039;&amp;quot; INT&lt;br /&gt;
#trap &amp;quot;set +x ; sleep 1h ; set -x&amp;quot; DEBUG&lt;br /&gt;
&lt;br /&gt;
# MODIFY THIS!&lt;br /&gt;
ECLIPSE_PROJECT=/run/media/rel/prc/code/workspace_testSTM32_01/testSTM32_00&lt;br /&gt;
STM32CUBEF0=/home/rel/src/STM32Cube_FW_F0_V1.4.0&lt;br /&gt;
STM32CUBEMX=/home/rel/Desktop/test_stm32cubemx_ewarm&lt;br /&gt;
&lt;br /&gt;
echo --------------------------------------------------------------------------------&lt;br /&gt;
echo Eclipse Project Initializer for STM32F072 Dev&lt;br /&gt;
echo --------------------------------------------------------------------------------&lt;br /&gt;
&lt;br /&gt;
echo&lt;br /&gt;
echo The script is using the following paths:&lt;br /&gt;
echo&lt;br /&gt;
echo Eclipse Project:&lt;br /&gt;
echo $ECLIPSE_PROJECT&lt;br /&gt;
echo&lt;br /&gt;
echo STM32Cube:&lt;br /&gt;
echo $STM32CUBEF0&lt;br /&gt;
echo&lt;br /&gt;
echo STM32CubeMX:&lt;br /&gt;
echo $STM32CUBEMX&lt;br /&gt;
&lt;br /&gt;
echo&lt;br /&gt;
echo -n &amp;quot;Do you want to proceed? [ENTER]&amp;quot;&lt;br /&gt;
read&lt;br /&gt;
&lt;br /&gt;
echo&lt;br /&gt;
echo Deleting files from eclipse project:&lt;br /&gt;
rm -fv $ECLIPSE_PROJECT/src/main.c&lt;br /&gt;
rm -fv $ECLIPSE_PROJECT/src/Timer.c&lt;br /&gt;
rm -fv $ECLIPSE_PROJECT/include/Timer.h&lt;br /&gt;
&lt;br /&gt;
rm -fv $ECLIPSE_PROJECT/system/include/cmsis/stm32f0xx.h&lt;br /&gt;
rm -fv $ECLIPSE_PROJECT/system/include/cmsis/system_stm32f0xx.h&lt;br /&gt;
&lt;br /&gt;
rm -fv $ECLIPSE_PROJECT/system/src/cmsis/system_stm32f0xx.c&lt;br /&gt;
rm -fv $ECLIPSE_PROJECT/system/src/cmsis/vectors_stm32f0xx.c&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
echo&lt;br /&gt;
echo Copying: ST HAL:&lt;br /&gt;
cp -rfv $STM32CUBEF0/Drivers/STM32F0xx_HAL_Driver/Src/* \&lt;br /&gt;
$ECLIPSE_PROJECT/system/src/stm32f0xx&lt;br /&gt;
&lt;br /&gt;
cp -rfv $STM32CUBEF0/Drivers/STM32F0xx_HAL_Driver/Inc/* \&lt;br /&gt;
$ECLIPSE_PROJECT/system/include/stm32f0xx&lt;br /&gt;
&lt;br /&gt;
cp -rfv $STM32CUBEF0/Drivers/CMSIS/Device/ST/STM32F0xx/Include/* \&lt;br /&gt;
$ECLIPSE_PROJECT/system/include/cmsis&lt;br /&gt;
&lt;br /&gt;
cp -fv $STM32CUBEF0/Drivers/CMSIS/Device/ST/STM32F0xx/Source/Templates/gcc/startup_stm32f072xb.s \&lt;br /&gt;
$ECLIPSE_PROJECT/system/src/cmsis/startup_stm32f072xb.S&lt;br /&gt;
&lt;br /&gt;
cp -fv $STM32CUBEF0/Drivers/CMSIS/Device/ST/STM32F0xx/Source/Templates/system_stm32f0xx.c \&lt;br /&gt;
$ECLIPSE_PROJECT/system/src/cmsis&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
# echo Copying: example project from STM32CubeF0:&lt;br /&gt;
#cp $STM32CUBEF0/Projects/STM32F072B-Discovery/Examples/GPIO/GPIO_IOToggle/Inc/* \&lt;br /&gt;
#$ECLIPSE_PROJECT/include&lt;br /&gt;
&lt;br /&gt;
#cp $STM32CUBEF0/Projects/STM32F072B-Discovery/Examples/GPIO/GPIO_IOToggle/Src/main.c \&lt;br /&gt;
#$ECLIPSE_PROJECT/src&lt;br /&gt;
&lt;br /&gt;
#cp $STM32CUBEF0/Projects/STM32F072B-Discovery/Examples/GPIO/GPIO_IOToggle/Src/stm32f0xx_it.c \&lt;br /&gt;
#$ECLIPSE_PROJECT/src&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
echo&lt;br /&gt;
echo Copying: example project from STM32CubeMX:&lt;br /&gt;
cp $STM32CUBEMX/Src/* $ECLIPSE_PROJECT/src&lt;br /&gt;
cp $STM32CUBEMX/Inc/* $ECLIPSE_PROJECT/include&lt;br /&gt;
&lt;br /&gt;
echo&lt;br /&gt;
echo Modifiying/fixing the memory map:&lt;br /&gt;
echo $ECLIPSE_PROJECT/ldscripts/mem.ld&lt;br /&gt;
sed -i &#039;s/FLASH (rx) : ORIGIN = 0x00000000/FLASH (rx) : ORIGIN = 0x08000000/g&#039; $ECLIPSE_PROJECT/ldscripts/mem.ld&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
echo&lt;br /&gt;
echo SUCCESS&lt;br /&gt;
echo&lt;br /&gt;
&lt;br /&gt;
echo&lt;br /&gt;
echo Now, exclude the following file from the Eclipse project manually:&lt;br /&gt;
ls $ECLIPSE_PROJECT/system/src/stm32f0xx/stm32f0xx_hal_msp_template.c&lt;br /&gt;
&lt;br /&gt;
echo&lt;br /&gt;
echo And add the following preprocessor constants to the C/C++ compiler settings in Eclipse:&lt;br /&gt;
echo USE_HAL_DRIVER&lt;br /&gt;
echo STM32F072xB&lt;br /&gt;
&lt;br /&gt;
echo&lt;br /&gt;
echo &amp;quot;And add the following config options to the GDB OpenOCD Debugging settings (in Run Configurations):&amp;quot;&lt;br /&gt;
echo &amp;quot;-f interface/stlink-v2.cfg -f target/stm32f0x.cfg&amp;quot;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This script needs to be modified according to your needs! (Currently is working for the STM32F072C8, and contains fixed paths! - Note that there minor inconsistencies in some of these ST projects. For example, all the provided STM32F072xB* files by ST work for both types of chips -- STM32F072x8 and STM32F072xB.)&lt;br /&gt;
&lt;br /&gt;
Like described in the script above, some minor manual changes need to be made in Eclipse after running the script.&lt;br /&gt;
&lt;br /&gt;
This should now be a good basis to start a new STM32 project.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Note that the GNU ARM Eclipse plugin always generates a Makefile for every project configuration (Debug / Release). It can be found in &amp;lt;project_folder&amp;gt;/Debug pr &amp;lt;project_folder&amp;gt;/Release respectively.&lt;br /&gt;
&lt;br /&gt;
==== Semihosting ====&lt;br /&gt;
&lt;br /&gt;
http://infocenter.arm.com/help/index.jsp?topic=/com.arm.doc.dui0471c/Bgbjjgij.html:&lt;br /&gt;
&amp;lt;blockquote&amp;gt;&lt;br /&gt;
What is semihosting?&lt;br /&gt;
&lt;br /&gt;
Semihosting is a mechanism that enables code running on an ARM target to communicate and use the Input/Output facilities on a host computer that is running a debugger.&lt;br /&gt;
&lt;br /&gt;
Examples of these facilities include keyboard input, screen output, and disk I/O.&lt;br /&gt;
&amp;lt;/blockquote&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The GNU ARM Eclipse plugin comes with a really bare-bone implementation of some semihosting print functions that can be used to print logs to the console right in Eclipse (over GDB, without using any additional serial/UART connection whatsoever).&lt;br /&gt;
&lt;br /&gt;
Since I&#039;d always create a project without Semihosting enabled in the GNU ARM Eclipse wizard, you can still easily enable it later on:&lt;br /&gt;
&lt;br /&gt;
The easiest way I&#039;ve found so far, is by defining those Preprocessor constants in the C/C++ Project settings (Projects &amp;gt; Properties &amp;gt; C/C++ Build &amp;gt; Settings &amp;gt; Cross ARM GNU C/C++ Compiler &amp;gt; Preprocessor):&lt;br /&gt;
* TRACE&lt;br /&gt;
* OS_USE_TRACE_SEMIHOSTING_STDOUT&lt;br /&gt;
&lt;br /&gt;
And then, by using the following function calls in your code to log stuff to the Eclipse console right away:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
trace_initialize(); // in fact not required&lt;br /&gt;
// (...)&lt;br /&gt;
static int i = 0;&lt;br /&gt;
trace_puts( &amp;quot;hello&amp;quot; );&lt;br /&gt;
trace_printf( &amp;quot;nr %d\n&amp;quot;, i++ );&lt;br /&gt;
HAL_Delay( 1000 );  &lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
These functions were implemented by the author of GNU ARM Eclipse [https://github.com/ilg-ul Liviu Ionescu], and can be looked up in these files:&lt;br /&gt;
* &amp;lt;eclipse_project&amp;gt;/system/include/arm/semihosting.h&lt;br /&gt;
* &amp;lt;eclipse_project&amp;gt;/system/include/diag/Trace.h&lt;br /&gt;
* &amp;lt;eclipse_project&amp;gt;/system/src/diag/Trace.c&lt;br /&gt;
* &amp;lt;eclipse_project&amp;gt;/system/src/diag/trace_impl.c&lt;br /&gt;
&lt;br /&gt;
An interesting comment in &#039;&#039;trace_impl.c:133&#039;&#039; says:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
// Semihosting is the other output channel that can be used for the trace&lt;br /&gt;
// messages. It comes in two flavours: STDOUT and DEBUG. The STDOUT channel&lt;br /&gt;
// is the equivalent of the stdout in POSIX and in most cases it is forwarded&lt;br /&gt;
// to the GDB server stdout stream. The debug channel is a separate&lt;br /&gt;
// channel. STDOUT is buffered, so nothing is displayed until a \n;&lt;br /&gt;
// DEBUG is not buffered, but can be slow.&lt;br /&gt;
//&lt;br /&gt;
// Choosing between semihosting stdout and debug depends on the capabilities&lt;br /&gt;
// of your GDB server, and also on specific needs. It is recommended to test&lt;br /&gt;
// DEBUG first, and if too slow, try STDOUT.&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Note that semihosting needs to be enabled in your Eclipse run configuration (it is by default), in the Startup tab &amp;gt; Enable ARM semihosting. This will tell GDB to use semihosting. Without enabling, calls to those trace_* functions will throw some kind of exception... and make the processor halt. I couldn&#039;t find out much yet about how this feature really works, somehow it uses a special BKPT instruction...&lt;br /&gt;
&lt;br /&gt;
Semihosting (OS_USE_TRACE_SEMIHOSTING_STDOUT) can also be used in &amp;quot;Release&amp;quot; builds, since the semihosted calls don&#039;t rely on debug symbols.&lt;br /&gt;
&lt;br /&gt;
=== IDE: Code::Blocks ===&lt;br /&gt;
&lt;br /&gt;
My favorite cross-platform IDE for C/C++ is Code::Blocks. - And luckily, it also works well for ARM development! After twiddling around with those confusing Eclipse settings, I&#039;ve almost forgot to try out and setup Code::Blocks.&lt;br /&gt;
&lt;br /&gt;
The steps required are bit unintuitive, but building and debugging projects with full auto-complete and indexer support works now.&lt;br /&gt;
&lt;br /&gt;
The advantages over using Eclipse:&lt;br /&gt;
* Faster GUI.&lt;br /&gt;
* Works with STM32CubeMX generated code.&lt;br /&gt;
* Uses just a plain/manually editable Makefile to build the project.&lt;br /&gt;
* Familiar C/C++ settings and more *transparent* project handling -&amp;gt; Edit + debug. Nothing more. Everything can be done by hand on a console too. No mysterious hidden helpers...&lt;br /&gt;
&lt;br /&gt;
I&#039;m still evaluating this workflow... But to get things up and running, you can do this:&lt;br /&gt;
&lt;br /&gt;
(Assuming you already have a working Makefile based project, e.g. [http://wiki.sgmk-ssam.ch/wiki/STM32_dev#STM32CubeMX_to_Makefile created with STM32CubeMX, like described above]).&lt;br /&gt;
&lt;br /&gt;
* Open Code::Blocks and create an &#039;&#039;&#039;empty&#039;&#039;&#039; project (&#039;&#039;File &amp;gt; New &amp;gt; Project &amp;gt; Empty project&#039;&#039;).&lt;br /&gt;
* Give it a name in the Wizard, and choose the &#039;&#039;GNU GCC Compiler for ARM&#039;&#039;, and save it. &lt;br /&gt;
* Copy all content of the Makefile project over to Code::Blocks project folder.&lt;br /&gt;
* Import all required source files into the Code::Blocks workspace (right click -&amp;gt; &#039;&#039;Add files recursively...&#039;&#039;). &lt;br /&gt;
* Check &#039;&#039;Project &amp;gt; Properties &amp;gt; Project settings &amp;gt; Makefile: This is a custom Makefile&#039;&#039;.&lt;br /&gt;
* Adjust the build settings in &#039;&#039;Project &amp;gt; Build options &amp;gt; &amp;quot;Make commands&amp;quot;&#039;&#039;. - This might either require you to change the Makefile (i.e. add Debug/Release targets), or the commands. - For simplicity&#039;s sake, just ignore those $make, $makefile variables and overwrite them with your actual commands (i.e.&#039;&#039;$make -f $makefile $target&#039;&#039; -&amp;gt; &#039;&#039;make all&#039;&#039;).&lt;br /&gt;
* &#039;&#039;Build&#039;&#039; the project and check in the &#039;&#039;Build log&#039;&#039; if there where any errors/warnings.&lt;br /&gt;
&lt;br /&gt;
So, if this is working now, try to edit a source file and see if those really useful auto-complete and jump to declaration/implementation features are working. - One caveat of using an external Makefile is that the IDE doesn&#039;t know the current settings. So, for example, #defines are not available, and syntax highlighting will not update automatically... So it might be worth it add settings manually at some point.&lt;br /&gt;
&lt;br /&gt;
Now, to get the flashing and debugging working, try this:&lt;br /&gt;
&lt;br /&gt;
* Go to the &#039;&#039;Settings &amp;gt; Debugger&#039;&#039; Settings.&lt;br /&gt;
* Add a new GDB debugger setting (hit &#039;&#039;Create Config&#039;&#039; and call it &#039;&#039;ARM OpenOCD&#039;&#039; for example).&lt;br /&gt;
* Change the &#039;&#039;Executable path&#039;&#039; according to your toolchains location, and check &#039;Do *not* run the debugee&#039;.&lt;br /&gt;
* Go to &#039;&#039;Projects &amp;gt; Properties &amp;gt; Debugger&#039;&#039;.&lt;br /&gt;
** Change the &amp;lt;Project&amp;gt; &#039;&#039;Remote connection&#039;&#039; settings to IP: 127.0.0.1 / Port: 3333.&lt;br /&gt;
** Go to the &amp;lt;Project&amp;gt; &#039;&#039;Additional GDB commands&#039;&#039; tab. And enter those commands into the &#039;&#039;After connection&#039;&#039; box (change filename!):&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
monitor halt&lt;br /&gt;
load ./build/test.elf&lt;br /&gt;
file ./build/test.elf&lt;br /&gt;
monitor sleep 1000&lt;br /&gt;
monitor reset&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
To not run the program automatically, remove the last two commands. Then you need to &#039;&#039;Start / Continue&#039;&#039; the program twice, but you&#039;ll catch the first breakpoint you&#039;ve set!&lt;br /&gt;
* Choose &#039;&#039;Debug &amp;gt; Active Debuggers &amp;gt; GDB/CDB Debugger: ARM OpenOCD&#039;&#039;.&lt;br /&gt;
* Start OpenOCD in a terminal. (Described above).&lt;br /&gt;
* Start debugging by pressing the red arrow (Run / continue) in the debugging toolbar.&lt;br /&gt;
&lt;br /&gt;
The steps are the same as the ones in [http://www.hackvandedam.nl/blog/?p=707 this tutorial &#039;&#039;&#039;with screenshots&#039;&#039;&#039;].&lt;br /&gt;
&lt;br /&gt;
=== stlink ===&lt;br /&gt;
&lt;br /&gt;
[https://github.com/texane/stlink stlink] is a command line tool for programming, inspecting and debugging the STM32 microcontrollers. It also used internally by OpenOCD (I think). - It comes with several small programs (st-flash, st-info, st-term, st-util) that can come in handy while working with the STM32 micros.&lt;br /&gt;
&lt;br /&gt;
There&#039;s a tutorial:&lt;br /&gt;
https://github.com/texane/stlink/blob/master/doc/tutorial/tutorial.pdf&lt;br /&gt;
&lt;br /&gt;
Some useful things I&#039;ve discovered:&lt;br /&gt;
&lt;br /&gt;
Just run st-util can Ctrl-C again to see all relevant uC properties:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
$ st-util&lt;br /&gt;
2016-01-29T13:06:25 INFO src/stlink-common.c: Loading device parameters....&lt;br /&gt;
2016-01-29T13:06:25 INFO src/stlink-common.c: Device connected is: F07x device, id 0x20016448&lt;br /&gt;
2016-01-29T13:06:25 INFO src/stlink-common.c: SRAM size: 0x4000 bytes (16 KiB), Flash: 0x10000 bytes (64 KiB) in pages of 2048 bytes&lt;br /&gt;
2016-01-29T13:06:25 INFO gdbserver/gdb-server.c: Chip ID is 00000448, Core ID is  0bb11477.&lt;br /&gt;
2016-01-29T13:06:25 INFO gdbserver/gdb-server.c: Target voltage is 3554 mV.&lt;br /&gt;
2016-01-29T13:06:25 INFO gdbserver/gdb-server.c: Listening at *:4242...&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Or with st-info:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
$ st-info &lt;br /&gt;
st-info --flash&lt;br /&gt;
st-info --sram&lt;br /&gt;
st-info --descr&lt;br /&gt;
st-info --pagesize&lt;br /&gt;
st-info --chipid&lt;br /&gt;
$ st-info --flash&lt;br /&gt;
0x10000&lt;br /&gt;
$ st-info --sram&lt;br /&gt;
0x4000&lt;br /&gt;
$ st-info --descr&lt;br /&gt;
F07x device&lt;br /&gt;
$ st-info --pagesize&lt;br /&gt;
0x800&lt;br /&gt;
$ st-info --chipid&lt;br /&gt;
0x0448&lt;br /&gt;
&lt;br /&gt;
$ echo `st-info --sram | xargs -I@ printf &amp;quot;%d/1024\n&amp;quot; @ | bc`kB RAM&lt;br /&gt;
16kB RAM&lt;br /&gt;
$ echo `st-info --flash | xargs -I@ printf &amp;quot;%d/1024\n&amp;quot; @ | bc`kB FLASH&lt;br /&gt;
64kB FLASH&lt;br /&gt;
&lt;br /&gt;
$ for a in sram flash pagesize; do echo `st-info --$a | xargs -I@ printf &amp;quot;%d/1024\n&amp;quot; @ | bc`kb $a; done&lt;br /&gt;
16kb sram&lt;br /&gt;
64kb flash&lt;br /&gt;
2kb pagesize&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
OR Simply:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
$ st-info --probe&lt;br /&gt;
Found 1 stlink programmers&lt;br /&gt;
 serial: 303030303030303030303031&lt;br /&gt;
openocd: &amp;quot;\x30\x30\x30\x30\x30\x30\x30\x30\x30\x30\x30\x31&amp;quot;&lt;br /&gt;
  flash: 131072 (pagesize: 256)&lt;br /&gt;
   sram: 16384&lt;br /&gt;
 chipid: 0x0416&lt;br /&gt;
  descr: L1 Med-density device&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Links ===&lt;br /&gt;
&lt;br /&gt;
==== Tools ====&lt;br /&gt;
* [https://gnuarmeclipse.github.io/ GNU ARM Eclipse]: [https://gnuarmeclipse.github.io/eclipse/workspace/preferences/ workspace_preferences], [http://gnuarmeclipse.github.io/toolchain/path/ toolchain_path], [http://gnuarmeclipse.github.io/eclipse/project/portability/ project_portability]&lt;br /&gt;
&lt;br /&gt;
==== Tutorials ====&lt;br /&gt;
* Great introduction: [http://www.triplespark.net/elec/pdev/arm/stm32.html Programming STM32 F2, F4 ARMs under Linux: A Tutorial from Scratch]&lt;br /&gt;
* STM32Cube to GNU ARM Eclipse tips: http://www.carminenoviello.com/en/2015/06/04/stm32-applications-eclipse-gcc-stcube/&lt;br /&gt;
* Micro Python on STM32F4-Discovery: http://gpio.kaltpost.de/?p=2082&lt;br /&gt;
* Logs: https://hackaday.io/project/4277/logs?page=2&lt;br /&gt;
* Code::Blocks tutorial: http://www.hackvandedam.nl/blog/?p=707&lt;br /&gt;
* Eclipse tutorial: http://www.carminenoviello.com/en/2015/06/04/stm32-applications-eclipse-gcc-stcube&lt;br /&gt;
* http://sigalrm.blogspot.ch/2013/12/using-ccm-memory-on-stm32.html&lt;br /&gt;
* http://stm32f4-discovery.com/2014/08/stm32f4-external-interrupts-tutorial/&lt;br /&gt;
* ...&lt;br /&gt;
&lt;br /&gt;
==== Projects / Demos / Code ====&lt;br /&gt;
* MrBlueXav&#039;s Synths: https://github.com/MrBlueXav&lt;br /&gt;
* cliffle&#039;s VGA stuff: https://github.com/cbiffle/m4vgalib-demos, http://cliffle.com/article/2015/06/05/introducing-glitch/&lt;br /&gt;
* ESPruino code: https://github.com/espruino/Espruino -&amp;gt; STM32F401CDU6&lt;br /&gt;
* STM32F4 Audio Codec Board: http://ebrombaugh.studionebula.com/synth/stm32f4_codec/&lt;br /&gt;
* ESPRUINO: http://www.espruino.com/ReferenceSTM32F4DISCOVERY&lt;br /&gt;
* micropython: https://github.com/micropython/micropython&lt;br /&gt;
* STM32F4 DIY: http://mikrocontroller.bplaced.net/wordpress/?page_id=1482&lt;br /&gt;
* STM32F4 overclocking: http://sigalrm.blogspot.ch/2014/01/overclocking-stm32f4.html&lt;br /&gt;
* thermal camera: http://www.theresistornetwork.com/2014/11/flir-lepton-thermal-imaging-sensor.html&lt;br /&gt;
* STM32F7: http://hackaday.com/2015/06/26/new-part-day-stm32f7-an-arm-cortex-m7/&lt;br /&gt;
* Karsten Schmidt: http://workshop.thi.ng/ [https://soundcloud.com/forthcharlie soundcloud] https://github.com/thi-ng/ws-ldn-4 https://github.com/thi-ng/ws-ldn-3 http://asm.thi.ng/&lt;br /&gt;
* Peridrummmm Demo: http://www.pouet.net/prod.php?which=59095 with sources: http://aka-san.halcy.de/revision2012/peridiummmm-src.zip&lt;br /&gt;
* Andy&#039;s Workshop: http://andybrown.me.uk/&lt;br /&gt;
* axoloti: http://axoloti.com/&lt;br /&gt;
&lt;br /&gt;
==== Libraries ====&lt;br /&gt;
* libopencm3 http://libopencm3.org/wiki/Main_Page&lt;br /&gt;
* list of libs: http://mikrocontroller.bplaced.net/wordpress/?page_id=2736&lt;br /&gt;
&lt;br /&gt;
==== OS ====&lt;br /&gt;
* FreeRTOS: http://www.freertos.org/index.html&lt;br /&gt;
* Embedded Linux on STM32: https://github.com/EmcraftSystems&lt;br /&gt;
* ChibiOS: http://www.chibios.org/dokuwiki/&lt;br /&gt;
&lt;br /&gt;
==== General ====&lt;br /&gt;
* ARM Related Books: http://www.arm.com/support/resources/arm-books/&lt;br /&gt;
* STM32 Overview http://www.st.com/web/en/catalog/mmc/FM141/SC1169?sc=stm32&lt;br /&gt;
* mbed https://en.wikipedia.org/wiki/Mbed&lt;br /&gt;
* CMSIS: http://www.keil.com/pack/doc/cmsis/Core/html/index.html&lt;br /&gt;
&lt;br /&gt;
== Hardware ==&lt;br /&gt;
&lt;br /&gt;
All about hardware and hardware tools for STM32 dev. Chips, programmers etc.&lt;br /&gt;
&lt;br /&gt;
=== ST-Link V2 Programmer ===&lt;br /&gt;
&lt;br /&gt;
There are two popular ST-Link V2 Progammers on the market. They have a different pinout but work both well like described above.&lt;br /&gt;
&lt;br /&gt;
[[File:ST-LinkV2_pinout_01.jpg]]&lt;br /&gt;
&lt;br /&gt;
Alternatively, STM32Discovery/[http://jeelabs.org/book/1547a/index.html Nucleo boards too can be used as SWD programmers].&lt;br /&gt;
&lt;br /&gt;
Luckily, only 4 pins have to be used to program and debug the target!&lt;br /&gt;
To find out more about this protocol, have a look into [http://www.arm.com/products/system-ip/debug-trace/coresight-soc-components/serial-wire-debug.php Serial Debug Wire (SWD)] as an alternative to JTAG.&lt;br /&gt;
&lt;br /&gt;
Connect to following pins of the programmer to the corresponding pins on the PCB:&lt;br /&gt;
&lt;br /&gt;
* V3V&lt;br /&gt;
* GND&lt;br /&gt;
* SWCLK&lt;br /&gt;
* SWDIO&lt;br /&gt;
&lt;br /&gt;
-&amp;gt; NRST can be important too on some STM32 chips!&lt;br /&gt;
&lt;br /&gt;
Remember: These are &#039;&#039;&#039;not&#039;&#039;&#039; the [http://www.st.com/web/catalog/tools/FM146/CL1984/SC724/SS1677/PF251168 official ST-Link V2 Programmers], sold by ST.&lt;br /&gt;
&lt;br /&gt;
== Projects ==&lt;br /&gt;
&lt;br /&gt;
STM32 based projects.&lt;br /&gt;
&lt;br /&gt;
=== STM32basic ===&lt;br /&gt;
&lt;br /&gt;
STM32basic is a test board to see how STM32 chips can be used in DIY circuits.&lt;br /&gt;
&lt;br /&gt;
==== STM32basic rev0.01 ====&lt;br /&gt;
&lt;br /&gt;
An initial list of tests:&lt;br /&gt;
&lt;br /&gt;
* JTAG: See how we can program the thing. Do we need all JTAG pins? Or only the SWD pins? What about reset? - Do the cheapo Chinese STLink V2 programmer really work?&lt;br /&gt;
* Basic I/O: LED and push button.&lt;br /&gt;
* U(S)ART: Check whether it&#039;s possible to hook up an FTDI to send/receive characters to/from the STM32basic?&lt;br /&gt;
* BOOT0/1: What about those boot modes?&lt;br /&gt;
* Power Usage : 3V3 Regulator: ..&lt;br /&gt;
&lt;br /&gt;
[[File:STM32basic_pcb1b.jpg]]&lt;br /&gt;
&lt;br /&gt;
Board at OSH Park:&amp;lt;br /&amp;gt;&lt;br /&gt;
https://oshpark.com/shared_projects/kCD7Yr0A&lt;br /&gt;
&lt;br /&gt;
KiCad project and everything else:&amp;lt;br /&amp;gt;&lt;br /&gt;
Remark: this has been made in hurry and is just a test:&amp;lt;br /&amp;gt;&lt;br /&gt;
http://0rel.com/prj/STM32basic/STM32basic_rev0.01.zip&lt;br /&gt;
&lt;br /&gt;
[[File:Stm32basic1.jpg]]&lt;br /&gt;
&lt;br /&gt;
So far, the tests have been working ok.&lt;br /&gt;
&lt;br /&gt;
* STLink V2 programmers seem to work fine, and only require 2 pins + VCC/GND! SWDIO and SWCLK, that&#039;s it! For programming and on-chip debugging.&lt;br /&gt;
* I/O works as well. External interrupts can be configured.&lt;br /&gt;
* UART works, but I have not yet tested it with a proper code. It was working with some echo snippet I&#039;ve found somewhere.&lt;br /&gt;
* Power usage is low. ~15 mA at 3.3 V.&lt;br /&gt;
* BOOT0 jumper has to be set (connected to ground) in order to run code... - Other boot modes have not been tested yet. More tests are needed there... What are the other available boot modes, what about those built-in boot loaders?&lt;br /&gt;
&lt;br /&gt;
However, the board has several flaws:&lt;br /&gt;
* 1.27 mm pin-pitch headers cannot be arranged like that (GPIOs). They need to be further apart to make sockets/headers fit.&lt;br /&gt;
* 3V3 LDO doesn&#039;t make much sense like this. Add add a buck/boost converter. Also remove 5V label.&lt;br /&gt;
* This BOOT0 jumper isn&#039;t nice like this...&lt;br /&gt;
* Remove unnecessary JTAG pins. SWD only.&lt;br /&gt;
* Remove unnecessary USART pins.&lt;br /&gt;
* Add crystal.&lt;br /&gt;
* Add USB plug.&lt;br /&gt;
&lt;br /&gt;
Probably, this will not be remade, since it was enough for a test. I&#039;d like to make a very basic USB touch device next.&lt;br /&gt;
&lt;br /&gt;
==== STM32basic Eclipse project ====&lt;br /&gt;
&lt;br /&gt;
Test project to see if GPIOs with External interrupts and semi hosting works. Sloppy and not cleaned up yet...&amp;lt;br /&amp;gt;&lt;br /&gt;
http://0rel.com/prj/STM32basic/testSTM32F072_interrupt_test0.zip&lt;br /&gt;
&lt;br /&gt;
Note: Eclipse projects can be imported in an existing or new workspace with: &#039;&#039;File &amp;gt; Import &amp;gt; General &amp;gt; Existing Projects into Workspace&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
=== todo ===&lt;br /&gt;
&lt;br /&gt;
* I2C peripherals&lt;br /&gt;
* I2S peripherals&lt;br /&gt;
* SPI peripherals&lt;br /&gt;
* touch&lt;br /&gt;
* usb&lt;br /&gt;
* external memory (sram, flash, eeprom...) -&amp;gt; RTOS / Linux / ChibiOS? (similar to this http://hforsten.com/making-embedded-linux-computer.html)?&lt;br /&gt;
.....&lt;/div&gt;</summary>
		<author><name>0rel</name></author>
	</entry>
	<entry>
		<id>https://wiki.sgmk-ssam.ch/index.php?title=STM32_dev&amp;diff=6573</id>
		<title>STM32 dev</title>
		<link rel="alternate" type="text/html" href="https://wiki.sgmk-ssam.ch/index.php?title=STM32_dev&amp;diff=6573"/>
		<updated>2016-10-15T18:20:54Z</updated>

		<summary type="html">&lt;p&gt;0rel: /* stlink */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Overview ==&lt;br /&gt;
&lt;br /&gt;
Notes on STM32 microcontrollers and on how to get them working in DIY projects.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;/// this is a work in progress draft ///&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
== Software ==&lt;br /&gt;
&lt;br /&gt;
All about software tools for STM32 dev. Development environments, compilers, debuggers, IDEs etc.&lt;br /&gt;
&lt;br /&gt;
=== ARM toolchains ===&lt;br /&gt;
&lt;br /&gt;
==== gcc-arm-embedded Toolchain ====&lt;br /&gt;
&lt;br /&gt;
Install the GCC arm-none-eabi toolchain for your OS. On Arch Linux this can be done with the package manager:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
$ sudo pacman -S arm-none-eabi-gcc arm-none-eabi-gdb arm-none-eabi-binutils arm-none-eabi-newlib&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Alternatively, it can be built from scratch, to have all tools and their sources in one place.&lt;br /&gt;
&lt;br /&gt;
* Download the sources here: https://launchpad.net/gcc-arm-embedded/+download&lt;br /&gt;
* Install the &#039;&#039;common tools and libraries&#039;&#039; like described in the [https://launchpadlibrarian.net/231136652/How-to-build-toolchain.pdf documentation].&lt;br /&gt;
* Build the toolchain. - On my system, the following steps were required:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
$ cp gcc-arm-none-eabi-5_2-2015q4-20151219-src.tar.bz2 ~/toolchain&lt;br /&gt;
$ cd ~/toolchain&lt;br /&gt;
$ tar -xjf gcc-arm-none-eabi-5_2-2015q4-20151219-src.tar.bz2&lt;br /&gt;
$ cd ./gcc-arm-none-eabi-5_2-2015q4-20151219/src&lt;br /&gt;
$ find -name &#039;*.tar.*&#039; | xargs -I% tar -xf %&lt;br /&gt;
$ cd ..&lt;br /&gt;
$ ./build-prerequisites.sh --skip_steps=mingw32&lt;br /&gt;
$ ./build-toolchain.sh --skip_steps=mingw32,manual&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
Note that those &#039;&#039;skip_steps&#039;&#039; options were required in my case.&lt;br /&gt;
&lt;br /&gt;
==== Linaro Toolchain ====&lt;br /&gt;
&lt;br /&gt;
The [https://en.wikipedia.org/wiki/Linaro Linaro] toolchain seems to be famous as well.&lt;br /&gt;
&lt;br /&gt;
Install it with your package manager if available, or build it yourself:&amp;lt;br /&amp;gt;&lt;br /&gt;
https://wiki.linaro.org/WorkingGroups/ToolChain&amp;lt;br /&amp;gt;&lt;br /&gt;
https://wiki.linaro.org/WorkingGroups/ToolChain/FAQ&lt;br /&gt;
&lt;br /&gt;
==== devkitpro devkitARM toolchain ====&lt;br /&gt;
&lt;br /&gt;
Another gcc variant: http://devkitpro.org/&lt;br /&gt;
&lt;br /&gt;
Used in the homebrew scene for game consoles like the GP32, Nintendo (3)DS and GBA. It can [http://www.pouet.net/prod.php?which=59095 apparently] also be used for the STM32s as well! And generates probably more optimized binaries?&lt;br /&gt;
&lt;br /&gt;
(On Arch it can be installed from the AUR: https://aur.archlinux.org/packages/devkitarm-bin/ . But beware, the compiler, link, binutils have all the same name as the ones from the official GCC arm-none-eabi toolchain. So it&#039;s probably better to install it manually.)&lt;br /&gt;
&lt;br /&gt;
=== STM32CubeMX on Linux ===&lt;br /&gt;
&lt;br /&gt;
STM32CubeMX is a code generator for STM32 micros that can come in handy when you start a new project. It generates all the necessary init and HAL code, library and custom pin mux code for your specific MCU.&lt;br /&gt;
&lt;br /&gt;
Unfortunately, it comes as a Windows EXE and ST doesn&#039;t mention that it actually is a Java application. Luckily it can be installed on Linux by hand (thanks to 5V Joe&#039;s great note [http://fivevolt.blogspot.ch/2014/07/installing-stm32cubemx-on-linux.html there]):&lt;br /&gt;
&lt;br /&gt;
* Download [http://www.st.com/web/catalog/tools/FM147/CL1794/SC961/SS1743/PF259242?icmp=stm32cubemx_pron_prcube_feb2014&amp;amp;sc=stm32cube-pr STM32CubeMX].&lt;br /&gt;
* Install the application (tested in January 2016):&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
$ unzip SetupSTM32CubeMX-4.12.0.exe -d stm32cube&lt;br /&gt;
$ cd stm32cube&lt;br /&gt;
$ java -cp . com.izforge.izpack.installer.bootstrap.Installer&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
* Run:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
$ cd &amp;lt;install_dir&amp;gt;&lt;br /&gt;
$ unzip STM32CubeMX.exe&lt;br /&gt;
$ java -cp . com.st.microxplorer.maingui.STM32CubeMX&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== STM32CubeMX to Makefile ===&lt;br /&gt;
&lt;br /&gt;
For whatever reason, STM32CubeMX does not export plain GCC/Makefiles along with the initialization code. But instead, it supports an unpopular IDE called [http://www.st.com/web/catalog/tools/FM147/CL1794/SC961/SS1533/PF261797 SW4STM32], which is also based on free GNU tools. So after installing STM32CubeMX, these are the steps to get the GCC/Makefile project running:&lt;br /&gt;
&lt;br /&gt;
* Get this nice Python script by [http://www.ba0sh1.com/ Baoshi] to generate the Makefile for an exported SW4STM32 project:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
$ git clone https://github.com/baoshi/CubeMX2Makefile&lt;br /&gt;
$ cd CubeMX2Makefile&lt;br /&gt;
$ python2 CubeMX2Makefile.py &amp;lt;your_sw4stm32_prject_dir&amp;gt;&lt;br /&gt;
$ cd &amp;lt;your_sw4stm32_prject_dir&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* Fix a tiny bug in the generated Makefile (tested in January 2016). More can be read [http://www.ba0sh1.com/stm32cubemx-gcc-makefile/ here].&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
$ grep __weak Makefile &lt;br /&gt;
C_DEFS = -D__weak=&amp;quot;__attribute__\(\(weak\)\)&amp;quot; -D__packed=&amp;quot;__attribute__\(\(__packed__\)\)&amp;quot; -DUSE_HAL_DRIVER -DSTM32F072xB&lt;br /&gt;
$ sed -i &#039;s/\\(\\(weak\\)\\)/((weak))/g&#039; Makefile &lt;br /&gt;
$ sed -i &#039;s/\\(\\(packed\\)\\)/((packed))/g&#039; Makefile &lt;br /&gt;
$ grep __weak Makefile &lt;br /&gt;
C_DEFS = -D__weak=&amp;quot;__attribute__((weak))&amp;quot; -D__packed=&amp;quot;__attribute__\(\(__packed__\)\)&amp;quot; -DUSE_HAL_DRIVER -DSTM32F072xB&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* Then build the binary:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
$ make&lt;br /&gt;
(...)&lt;br /&gt;
arm-none-eabi-size build/STM32F072RBT6.elf&lt;br /&gt;
   text	   data	    bss	    dec	    hex	filename&lt;br /&gt;
   4568	     12	   1572	   6152	   1808	build/STM32F072RBT6.elf&lt;br /&gt;
arm-none-eabi-objcopy -O ihex build/STM32F072RBT6.elf build/STM32F072RBT6.hex&lt;br /&gt;
arm-none-eabi-objcopy -O binary -S build/STM32F072RBT6.elf build/STM32F072RBT6.bin	&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Flash ===&lt;br /&gt;
&lt;br /&gt;
Install OpenOCD and STLINK. On Arch Linux:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
sudo pacman -S stlink openocd&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now [http://openocd.org/ OpenOCD] and (arm-none-eabi-)gdb can be used to program and debug the MCU. All discovery boards also come with an ST-LINK/V2 programmer right built in speaking over USB to the host and over JTAG/[http://www.arm.com/products/system-ip/debug-trace/coresight-soc-components/serial-wire-debug.php SWD] to the target (note: only two pins are actually required for SWD debugging/flashing (SWDIO/SWCLK), but that for later (see also [[#Hardware]])). STM32 Discovery Boards should show up in the lsusb list like that:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
$ lsusb&lt;br /&gt;
(...)&lt;br /&gt;
Bus 003 Device 006: ID 0483:3748 STMicroelectronics ST-LINK/V2&lt;br /&gt;
(...)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
OpenOCD can now act as a &amp;quot;middleman&amp;quot; between the ST-LINK programmer and the user. As a server on the host, to which you can connect with telnet and GDB.&lt;br /&gt;
&lt;br /&gt;
To configure OpenOCD, put a configuration file called opencd.cfg into the project folder and start OpenOCD. While working on the project, let it run there in the foreground to see all the logs...&lt;br /&gt;
&lt;br /&gt;
For the [http://www.st.com/st-web-ui/static/active/jp/resource/technical/document/user_manual/DM00099401.pdf STM32 F072 Discovery] board this should work, for example:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
$ cd &amp;lt;project_directory&amp;gt;&lt;br /&gt;
$ echo &amp;quot;source [find board/stm32f0discovery.cfg]&amp;quot; &amp;gt; openocd.cfg&lt;br /&gt;
$ openocd&lt;br /&gt;
Open On-Chip Debugger 0.9.0 (2015-05-19-13:50)&lt;br /&gt;
Licensed under GNU GPL v2&lt;br /&gt;
For bug reports, read&lt;br /&gt;
	http://openocd.org/doc/doxygen/bugs.html&lt;br /&gt;
Info : The selected transport took over low-level target control. The results might differ compared to plain JTAG/SWD&lt;br /&gt;
adapter speed: 1000 kHz&lt;br /&gt;
adapter_nsrst_delay: 100&lt;br /&gt;
none separate&lt;br /&gt;
srst_only separate srst_nogate srst_open_drain connect_deassert_srst&lt;br /&gt;
Info : Unable to match requested speed 1000 kHz, using 950 kHz&lt;br /&gt;
Info : Unable to match requested speed 1000 kHz, using 950 kHz&lt;br /&gt;
Info : clock speed 950 kHz&lt;br /&gt;
Info : STLINK v2 JTAG v17 API v2 SWIM v0 VID 0x0483 PID 0x3748&lt;br /&gt;
Info : using stlink api v2&lt;br /&gt;
Info : Target voltage: 2.896454&lt;br /&gt;
Info : stm32f0x.cpu: hardware has 4 breakpoints, 2 watchpoints&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
(Don&#039;t worry about those warnings about the wrong clock speed for now...)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
In order to program the flash, connect to OpenOCD via telnet in another terminal:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
$ telnet 127.0.0.1 4444&lt;br /&gt;
Trying 127.0.0.1...&lt;br /&gt;
Connected to 127.0.0.1.&lt;br /&gt;
Escape character is &#039;^]&#039;.&lt;br /&gt;
Open On-Chip Debugger&lt;br /&gt;
&amp;gt; &lt;br /&gt;
&amp;gt; reset halt&lt;br /&gt;
target state: halted&lt;br /&gt;
target halted due to debug-request, current mode: Thread &lt;br /&gt;
xPSR: 0xc1000000 pc: 0x080014d0 msp: 0x20004000&lt;br /&gt;
&amp;gt; flash probe 0&lt;br /&gt;
device id = 0x20016448&lt;br /&gt;
flash size = 128kbytes&lt;br /&gt;
flash &#039;stm32f1x&#039; found at 0x08000000&lt;br /&gt;
&amp;gt; flash write_image erase build/STM32F072RBT6.elf&lt;br /&gt;
auto erase enabled&lt;br /&gt;
target state: halted&lt;br /&gt;
target halted due to breakpoint, current mode: Thread &lt;br /&gt;
xPSR: 0x61000000 pc: 0x2000003a msp: 0x20004000&lt;br /&gt;
wrote 6144 bytes from file build/STM32F072RBT6.elf in 0.503961s (11.906 KiB/s)&lt;br /&gt;
&amp;gt; reset run&lt;br /&gt;
&amp;gt; exit&lt;br /&gt;
Connection closed by foreign host.&lt;br /&gt;
$&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This should write the binary to the flash memory and start the program.&lt;br /&gt;
Of course, all those steps can be automated further and integrated into an IDE, but that&#039;s for later...&lt;br /&gt;
&lt;br /&gt;
To program the STM32F0Discovery board for example, this can be used to just flash the chip:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
$ openocd -f board/stm32f0discovery.cfg -c &amp;quot;program build/STM32F072RBT6.elf verify reset exit&amp;quot; &lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
To program a custom board for example with the STM32F0x chip, a command like this can be used:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
$ openocd -f interface/stlink-v2.cfg -f target/stm32f0x.cfg -c &amp;quot;program testSTM32F072_interrupt_test0.elf verify reset exit&amp;quot;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
To make things more convenient, add a new target &#039;&#039;flash&#039;&#039; to the Makefile with this command, and you can simply run &#039;&#039;make flash&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The exported main.c from STM32CubeMX was only slightly modified to let the user LEDs flash and react to the user pushbutton:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
******************************************************************************&lt;br /&gt;
* main.c *&lt;br /&gt;
******************************************************************************&lt;br /&gt;
&lt;br /&gt;
#include &amp;quot;stm32f0xx_hal.h&amp;quot;&lt;br /&gt;
&lt;br /&gt;
void SystemClock_Config(void);&lt;br /&gt;
static void MX_GPIO_Init(void);&lt;br /&gt;
&lt;br /&gt;
int main(void)&lt;br /&gt;
{&lt;br /&gt;
  /* Reset of all peripherals, Initializes the Flash interface and the Systick. */&lt;br /&gt;
  HAL_Init();&lt;br /&gt;
&lt;br /&gt;
  /* Configure the system clock */&lt;br /&gt;
  SystemClock_Config();&lt;br /&gt;
&lt;br /&gt;
  /* Initialize all configured peripherals */&lt;br /&gt;
  MX_GPIO_Init();&lt;br /&gt;
&lt;br /&gt;
  while (1)&lt;br /&gt;
  {&lt;br /&gt;
    uint32_t delay;&lt;br /&gt;
    if( HAL_GPIO_ReadPin( GPIOA, GPIO_PIN_0 ) == GPIO_PIN_SET )&lt;br /&gt;
      delay = 50;&lt;br /&gt;
    else&lt;br /&gt;
      delay = 250;&lt;br /&gt;
&lt;br /&gt;
    HAL_GPIO_TogglePin( GPIOC, GPIO_PIN_9 );&lt;br /&gt;
    HAL_Delay( delay );&lt;br /&gt;
    HAL_GPIO_TogglePin( GPIOC, GPIO_PIN_8 );&lt;br /&gt;
    HAL_Delay( delay );&lt;br /&gt;
    HAL_GPIO_TogglePin( GPIOC, GPIO_PIN_7 );&lt;br /&gt;
    HAL_Delay( delay );&lt;br /&gt;
    HAL_GPIO_TogglePin( GPIOC, GPIO_PIN_6 );&lt;br /&gt;
    HAL_Delay( delay );&lt;br /&gt;
&lt;br /&gt;
  }&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
/** System Clock Configuration&lt;br /&gt;
*/&lt;br /&gt;
void SystemClock_Config(void)&lt;br /&gt;
{&lt;br /&gt;
&lt;br /&gt;
  RCC_OscInitTypeDef RCC_OscInitStruct;&lt;br /&gt;
  RCC_ClkInitTypeDef RCC_ClkInitStruct;&lt;br /&gt;
&lt;br /&gt;
  RCC_OscInitStruct.OscillatorType = RCC_OSCILLATORTYPE_HSI;&lt;br /&gt;
  RCC_OscInitStruct.HSIState = RCC_HSI_ON;&lt;br /&gt;
  RCC_OscInitStruct.HSICalibrationValue = 16;&lt;br /&gt;
  RCC_OscInitStruct.PLL.PLLState = RCC_PLL_NONE;&lt;br /&gt;
  HAL_RCC_OscConfig(&amp;amp;RCC_OscInitStruct);&lt;br /&gt;
&lt;br /&gt;
  RCC_ClkInitStruct.ClockType = RCC_CLOCKTYPE_SYSCLK;&lt;br /&gt;
  RCC_ClkInitStruct.SYSCLKSource = RCC_SYSCLKSOURCE_HSI;&lt;br /&gt;
  RCC_ClkInitStruct.AHBCLKDivider = RCC_SYSCLK_DIV1;&lt;br /&gt;
  RCC_ClkInitStruct.APB1CLKDivider = RCC_HCLK_DIV1;&lt;br /&gt;
  HAL_RCC_ClockConfig(&amp;amp;RCC_ClkInitStruct, FLASH_LATENCY_0);&lt;br /&gt;
&lt;br /&gt;
  HAL_SYSTICK_Config(HAL_RCC_GetHCLKFreq()/1000);&lt;br /&gt;
&lt;br /&gt;
  HAL_SYSTICK_CLKSourceConfig(SYSTICK_CLKSOURCE_HCLK);&lt;br /&gt;
&lt;br /&gt;
  /* SysTick_IRQn interrupt configuration */&lt;br /&gt;
  HAL_NVIC_SetPriority(SysTick_IRQn, 0, 0);&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
/** Configure pins as&lt;br /&gt;
        * Analog&lt;br /&gt;
        * Input&lt;br /&gt;
        * Output&lt;br /&gt;
        * EVENT_OUT&lt;br /&gt;
        * EXTI&lt;br /&gt;
*/&lt;br /&gt;
void MX_GPIO_Init(void)&lt;br /&gt;
{&lt;br /&gt;
&lt;br /&gt;
  GPIO_InitTypeDef GPIO_InitStruct;&lt;br /&gt;
&lt;br /&gt;
  /* GPIO Ports Clock Enable */&lt;br /&gt;
  __GPIOA_CLK_ENABLE();&lt;br /&gt;
  __GPIOC_CLK_ENABLE();&lt;br /&gt;
&lt;br /&gt;
  /*Configure GPIO pin : PA0 */&lt;br /&gt;
  GPIO_InitStruct.Pin = GPIO_PIN_0;&lt;br /&gt;
  GPIO_InitStruct.Mode = GPIO_MODE_INPUT;&lt;br /&gt;
  GPIO_InitStruct.Pull = GPIO_NOPULL;&lt;br /&gt;
  HAL_GPIO_Init(GPIOA, &amp;amp;GPIO_InitStruct);&lt;br /&gt;
&lt;br /&gt;
  /*Configure GPIO pins : PC6 PC7 PC8 PC9 */&lt;br /&gt;
  GPIO_InitStruct.Pin = GPIO_PIN_6|GPIO_PIN_7|GPIO_PIN_8|GPIO_PIN_9;&lt;br /&gt;
  GPIO_InitStruct.Mode = GPIO_MODE_OUTPUT_PP;&lt;br /&gt;
  GPIO_InitStruct.Pull = GPIO_NOPULL;&lt;br /&gt;
  GPIO_InitStruct.Speed = GPIO_SPEED_LOW;&lt;br /&gt;
  HAL_GPIO_Init(GPIOC, &amp;amp;GPIO_InitStruct);&lt;br /&gt;
&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
(&lt;br /&gt;
Note that pins -- among various other things -- can be customized in the CubeMX editor. Reexporting code to an existing project is straight forward, and can be done easily while the old Makefile keeps valid for minor changes... - However, STM32CubeMX looks still quite unfinished to me. It&#039;s a nice concept, but where are all the ST libraries, for example for the [http://www.st.com/web/en/catalog/tools/FM147/CL1794/SC961/SS1743/LN1734/PF258658# touch functionality]? It still needs to be downloaded separately... and it comes in a bloody EXE file as well! *arghs*&lt;br /&gt;
&lt;br /&gt;
Unfortunately, things seem to be a bit confusing. If you&#039;re using a STM32F0, then probably need to take a look into the [http://www.st.com/web/catalog/tools/FM147/CL1794/SC961/SS1743/LN1897/PF260612?icmp=pf260612_pron_nb_jun2014&amp;amp;sc=stm32cubef0-pr STM32CubeF0] software bundle, which contains a more up-to-date TouchSensing Library... Hm.&lt;br /&gt;
&lt;br /&gt;
Also, note that most of the provided code by ST is only documented in the source files themselves... And there are at least two vastly differing versions of the basic functions out there, what makes copy/pasting/sharing a bit difficult. I even don&#039;t know if they continue working on this code base, or if they switch over to [https://www.mbed.com/en/ mbed]. That seems to be the focus of those newer [http://www.st.com/web/catalog/tools/FM116/SC959/SS1532/LN1847?sc=stm32nucleo Nucleo] evaluation boards.&lt;br /&gt;
)&lt;br /&gt;
&lt;br /&gt;
=== Debugging: GDB ===&lt;br /&gt;
&lt;br /&gt;
GDB can be used to debug the code right on the hardware. While OpenOCD is running, you can connect to the target like this and step through the program:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
$ arm-none-eabi-gdb -tui build/STM32F072RBT6.elf&lt;br /&gt;
(...)&lt;br /&gt;
Reading symbols from build/STM32F072RBT6.elf...done.&lt;br /&gt;
&lt;br /&gt;
(gdb) target remote :3333&lt;br /&gt;
Remote debugging using :3333&lt;br /&gt;
Python Exception &amp;lt;type &#039;exceptions.NameError&#039;&amp;gt; Installation error: gdb.execute_u&lt;br /&gt;
nwinders function is missing:&lt;br /&gt;
HAL_GetTick () at Drivers/STM32F0xx_HAL_Driver/Src/stm32f0xx_hal.c:298&lt;br /&gt;
&lt;br /&gt;
(gdb) c&lt;br /&gt;
Continuing.&lt;br /&gt;
&lt;br /&gt;
Program received signal SIGINT, Interrupt.&lt;br /&gt;
0x080002f6 in HAL_Delay (Python Exception &amp;lt;type &#039;exceptions.NameError&#039;&amp;gt; Installa&lt;br /&gt;
tion error: gdb.execute_unwinders function is missing:&lt;br /&gt;
Delay=250)&lt;br /&gt;
    at Drivers/STM32F0xx_HAL_Driver/Src/stm32f0xx_hal.c:317&lt;br /&gt;
&lt;br /&gt;
(gdb) break main.c:91&lt;br /&gt;
Breakpoint 1 at 0x8001392: file Src/main.c, line 91.&lt;br /&gt;
&lt;br /&gt;
(gdb) c&lt;br /&gt;
Continuing.&lt;br /&gt;
Note: automatically using hardware breakpoints for read-only addresses.&lt;br /&gt;
Python Exception &amp;lt;type &#039;exceptions.NameError&#039;&amp;gt; Installation error: gdb.execute_u&lt;br /&gt;
nwinders function is missing:&lt;br /&gt;
&lt;br /&gt;
Breakpoint 1, main () at Src/main.c:91&lt;br /&gt;
&lt;br /&gt;
(...)&lt;br /&gt;
(gdb) detach&lt;br /&gt;
(qdb) quit&lt;br /&gt;
$&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
(Note: the -tui option is really great to inspect the code... see [http://ftp.gnu.org/old-gnu/Manuals/gdb-5.1.1/html_chapter/gdb_19.html GDB Text User Interface])&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== IDE: Eclipse SW4STM32 ===&lt;br /&gt;
&lt;br /&gt;
GOOD NEWS: This officially supported Eclipse variant works out of the box with STM32CubeMX generated project! You simply need to register on that site, and you&#039;ll get a software package that should work:&lt;br /&gt;
&lt;br /&gt;
[http://www.st.com/content/st_com/en/products/development-tools/software-development-tools/stm32-software-development-tools/stm32-ides/sw4stm32.html SW4STM32 - System Workbench for STM32: free IDE on Windows, Linux and OS X ]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
(Side note: I don&#039;t know how well it works when you have another Eclipse installed on your system... currently testing this out.)&lt;br /&gt;
&lt;br /&gt;
=== IDE: Eclipse with GNU ARM Eclipse plugin ===&lt;br /&gt;
&lt;br /&gt;
To use Eclipse as an IDE for the STM32s, just install Eclipse and a the GNU ARM Eclipse Plugin.&lt;br /&gt;
&lt;br /&gt;
* Eclipse IDE for C/C++ (CDT). This can be installed manually or with your package manager.&lt;br /&gt;
* Eclipse Plugin: [https://gnuarmeclipse.github.io/ GNU ARM Eclipse]. - This can be done in the Eclipse Marketplace (under &#039;&#039;Help &amp;gt; Eclipse Marketplace&#039;&#039; (use the default options)).&lt;br /&gt;
* Create a new Eclipse project with the GNU ARM Eclipse (Choose STM32Fxxx C/C++ Project in the Wizard)&lt;br /&gt;
&lt;br /&gt;
With some minor adjustments in the settings (OpenOCD), the basic Blinky example that comes with the plugin should work out of the box, with a STLink v2 programmer. Code completion etc. works fine too.&lt;br /&gt;
&lt;br /&gt;
(/todo: show every step)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
But there&#039;s quite annoying problem with this workflow!:&lt;br /&gt;
&lt;br /&gt;
http://www.carminenoviello.com/en/2015/06/04/stm32-applications-eclipse-gcc-stcube/:&lt;br /&gt;
&amp;lt;blockquote&amp;gt;&lt;br /&gt;
Unfortunately, the plug-in author has updated just the template for STM32-F4 family to the more recently STM32Cube-F4 HAL framework from ST (which still supports only commercial IDE.....), leaving the other templates still based on the old Standard Peripheral Library, which is no longer supported by ST and STM32CubeMX tool used in my tutorial. This causes my instructions to be wrong for processor families different from STM32-F4. &lt;br /&gt;
&amp;lt;/blockquote&amp;gt;&lt;br /&gt;
&lt;br /&gt;
So, several manual setup steps will be required to get started with your own STM32 project. To goal is to configure the project in STM32CubeMX, and use up-to-date HAL code, and not the deprecated Standard Peripheral Library.&lt;br /&gt;
&lt;br /&gt;
The GNU ARM Eclipse plugin is great, but doesn&#039;t create projects with up-to-date code. So we need to modify the manually created GNU ARM Eclipse project. - I used a custom STM32F072C8 board, and all steps below assum this hardware. The steps would be slightly different for other hardware.&lt;br /&gt;
&lt;br /&gt;
([http://www.carminenoviello.com/en/2015/06/04/stm32-applications-eclipse-gcc-stcube This tutorial] was helping here...)&lt;br /&gt;
&lt;br /&gt;
* First create a new &#039;C Project&#039; in your Eclipse workspace.&lt;br /&gt;
* In Wizard slide &#039;&#039;C Project&#039;&#039;: Choose Executable &amp;gt; &#039;&#039;Hello World ARM Cortex-M C/C++ Project&#039;&#039; and give it a name (e.g. testSTM32_00). This will generate a generic ARM project instead of an STM32Fxxx one. - Then hit &#039;&#039;Next&#039;&#039;.&lt;br /&gt;
* In Wizard slide &#039;&#039;Target processor settings&#039;&#039;: Configure the target processor: For the STM32F072C8: Change the defaults to Flash size (kB): 64, RAM size (kB): 16, Use system calls: Freestanding (no POSIX system calls), Trace output: None (no trace output). - Then hit &#039;&#039;Next&#039;&#039;.&lt;br /&gt;
* In Wizard slide &#039;&#039;Folders&#039;&#039;: Change Vendor CMSIS name to stm32f0xx. - Then hit next.&lt;br /&gt;
* In Wizard slide &#039;&#039;Select Configurations&#039;&#039;: Leave as is. - Then hit &#039;&#039;Next&#039;&#039;.&lt;br /&gt;
* In Wizard slide &#039;&#039;Cross GNU ARM Toolchain&#039;&#039;: Select &#039;&#039;GNU Tools for ARM Embedded Processors (arm-none-eabi-gcc)&#039;&#039; and either choose the global, system wide toolchain (probably in /usr/bin) or enter the path to your custom one. - Then hit &#039;&#039;Finish&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
This will create a generic ARM project, which should build without errors (hit Ctrl+B). &lt;br /&gt;
&lt;br /&gt;
Next, we need to add the vendor specific HAL code by ST generated with STM32CubeMX and/or downloaded in a more specific firmware package (STM32CubeF0, STM32CubeF4 etc.).&lt;br /&gt;
&lt;br /&gt;
...&lt;br /&gt;
So, after configuring a generic Eclipse project, we&#039;re ready to modify it.&lt;br /&gt;
&lt;br /&gt;
* Configure and export an EWARM project in [http://www.st.com/web/en/catalog/tools/PF259242 STM32CubeMX] (with default settings).&lt;br /&gt;
&lt;br /&gt;
* Extract the [http://www.st.com/web/en/catalog/tools/PF260612 STM32CubeF0] archive. ([http://www.st.com/web/en/catalog/tools/PF260820 STM32CubeF1], [http://www.st.com/web/en/catalog/tools/PF260266 STM32CubeF2], [http://www.st.com/web/en/catalog/tools/PF260613 STMCubeF3], [http://www.st.com/web/en/catalog/tools/PF259243 STMCubeF4]).&lt;br /&gt;
&lt;br /&gt;
As a starting point, here&#039;s a bash script, that modifies the previously created Eclipse project:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
#!/usr/bin/env bash&lt;br /&gt;
&lt;br /&gt;
set -e&lt;br /&gt;
&lt;br /&gt;
#echo &amp;quot;Press CTRL+C to proceed.&amp;quot;&lt;br /&gt;
#trap &amp;quot;pkill -f &#039;sleep 1h&#039;&amp;quot; INT&lt;br /&gt;
#trap &amp;quot;set +x ; sleep 1h ; set -x&amp;quot; DEBUG&lt;br /&gt;
&lt;br /&gt;
# MODIFY THIS!&lt;br /&gt;
ECLIPSE_PROJECT=/run/media/rel/prc/code/workspace_testSTM32_01/testSTM32_00&lt;br /&gt;
STM32CUBEF0=/home/rel/src/STM32Cube_FW_F0_V1.4.0&lt;br /&gt;
STM32CUBEMX=/home/rel/Desktop/test_stm32cubemx_ewarm&lt;br /&gt;
&lt;br /&gt;
echo --------------------------------------------------------------------------------&lt;br /&gt;
echo Eclipse Project Initializer for STM32F072 Dev&lt;br /&gt;
echo --------------------------------------------------------------------------------&lt;br /&gt;
&lt;br /&gt;
echo&lt;br /&gt;
echo The script is using the following paths:&lt;br /&gt;
echo&lt;br /&gt;
echo Eclipse Project:&lt;br /&gt;
echo $ECLIPSE_PROJECT&lt;br /&gt;
echo&lt;br /&gt;
echo STM32Cube:&lt;br /&gt;
echo $STM32CUBEF0&lt;br /&gt;
echo&lt;br /&gt;
echo STM32CubeMX:&lt;br /&gt;
echo $STM32CUBEMX&lt;br /&gt;
&lt;br /&gt;
echo&lt;br /&gt;
echo -n &amp;quot;Do you want to proceed? [ENTER]&amp;quot;&lt;br /&gt;
read&lt;br /&gt;
&lt;br /&gt;
echo&lt;br /&gt;
echo Deleting files from eclipse project:&lt;br /&gt;
rm -fv $ECLIPSE_PROJECT/src/main.c&lt;br /&gt;
rm -fv $ECLIPSE_PROJECT/src/Timer.c&lt;br /&gt;
rm -fv $ECLIPSE_PROJECT/include/Timer.h&lt;br /&gt;
&lt;br /&gt;
rm -fv $ECLIPSE_PROJECT/system/include/cmsis/stm32f0xx.h&lt;br /&gt;
rm -fv $ECLIPSE_PROJECT/system/include/cmsis/system_stm32f0xx.h&lt;br /&gt;
&lt;br /&gt;
rm -fv $ECLIPSE_PROJECT/system/src/cmsis/system_stm32f0xx.c&lt;br /&gt;
rm -fv $ECLIPSE_PROJECT/system/src/cmsis/vectors_stm32f0xx.c&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
echo&lt;br /&gt;
echo Copying: ST HAL:&lt;br /&gt;
cp -rfv $STM32CUBEF0/Drivers/STM32F0xx_HAL_Driver/Src/* \&lt;br /&gt;
$ECLIPSE_PROJECT/system/src/stm32f0xx&lt;br /&gt;
&lt;br /&gt;
cp -rfv $STM32CUBEF0/Drivers/STM32F0xx_HAL_Driver/Inc/* \&lt;br /&gt;
$ECLIPSE_PROJECT/system/include/stm32f0xx&lt;br /&gt;
&lt;br /&gt;
cp -rfv $STM32CUBEF0/Drivers/CMSIS/Device/ST/STM32F0xx/Include/* \&lt;br /&gt;
$ECLIPSE_PROJECT/system/include/cmsis&lt;br /&gt;
&lt;br /&gt;
cp -fv $STM32CUBEF0/Drivers/CMSIS/Device/ST/STM32F0xx/Source/Templates/gcc/startup_stm32f072xb.s \&lt;br /&gt;
$ECLIPSE_PROJECT/system/src/cmsis/startup_stm32f072xb.S&lt;br /&gt;
&lt;br /&gt;
cp -fv $STM32CUBEF0/Drivers/CMSIS/Device/ST/STM32F0xx/Source/Templates/system_stm32f0xx.c \&lt;br /&gt;
$ECLIPSE_PROJECT/system/src/cmsis&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
# echo Copying: example project from STM32CubeF0:&lt;br /&gt;
#cp $STM32CUBEF0/Projects/STM32F072B-Discovery/Examples/GPIO/GPIO_IOToggle/Inc/* \&lt;br /&gt;
#$ECLIPSE_PROJECT/include&lt;br /&gt;
&lt;br /&gt;
#cp $STM32CUBEF0/Projects/STM32F072B-Discovery/Examples/GPIO/GPIO_IOToggle/Src/main.c \&lt;br /&gt;
#$ECLIPSE_PROJECT/src&lt;br /&gt;
&lt;br /&gt;
#cp $STM32CUBEF0/Projects/STM32F072B-Discovery/Examples/GPIO/GPIO_IOToggle/Src/stm32f0xx_it.c \&lt;br /&gt;
#$ECLIPSE_PROJECT/src&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
echo&lt;br /&gt;
echo Copying: example project from STM32CubeMX:&lt;br /&gt;
cp $STM32CUBEMX/Src/* $ECLIPSE_PROJECT/src&lt;br /&gt;
cp $STM32CUBEMX/Inc/* $ECLIPSE_PROJECT/include&lt;br /&gt;
&lt;br /&gt;
echo&lt;br /&gt;
echo Modifiying/fixing the memory map:&lt;br /&gt;
echo $ECLIPSE_PROJECT/ldscripts/mem.ld&lt;br /&gt;
sed -i &#039;s/FLASH (rx) : ORIGIN = 0x00000000/FLASH (rx) : ORIGIN = 0x08000000/g&#039; $ECLIPSE_PROJECT/ldscripts/mem.ld&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
echo&lt;br /&gt;
echo SUCCESS&lt;br /&gt;
echo&lt;br /&gt;
&lt;br /&gt;
echo&lt;br /&gt;
echo Now, exclude the following file from the Eclipse project manually:&lt;br /&gt;
ls $ECLIPSE_PROJECT/system/src/stm32f0xx/stm32f0xx_hal_msp_template.c&lt;br /&gt;
&lt;br /&gt;
echo&lt;br /&gt;
echo And add the following preprocessor constants to the C/C++ compiler settings in Eclipse:&lt;br /&gt;
echo USE_HAL_DRIVER&lt;br /&gt;
echo STM32F072xB&lt;br /&gt;
&lt;br /&gt;
echo&lt;br /&gt;
echo &amp;quot;And add the following config options to the GDB OpenOCD Debugging settings (in Run Configurations):&amp;quot;&lt;br /&gt;
echo &amp;quot;-f interface/stlink-v2.cfg -f target/stm32f0x.cfg&amp;quot;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This script needs to be modified according to your needs! (Currently is working for the STM32F072C8, and contains fixed paths! - Note that there minor inconsistencies in some of these ST projects. For example, all the provided STM32F072xB* files by ST work for both types of chips -- STM32F072x8 and STM32F072xB.)&lt;br /&gt;
&lt;br /&gt;
Like described in the script above, some minor manual changes need to be made in Eclipse after running the script.&lt;br /&gt;
&lt;br /&gt;
This should now be a good basis to start a new STM32 project.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Note that the GNU ARM Eclipse plugin always generates a Makefile for every project configuration (Debug / Release). It can be found in &amp;lt;project_folder&amp;gt;/Debug pr &amp;lt;project_folder&amp;gt;/Release respectively.&lt;br /&gt;
&lt;br /&gt;
==== Semihosting ====&lt;br /&gt;
&lt;br /&gt;
http://infocenter.arm.com/help/index.jsp?topic=/com.arm.doc.dui0471c/Bgbjjgij.html:&lt;br /&gt;
&amp;lt;blockquote&amp;gt;&lt;br /&gt;
What is semihosting?&lt;br /&gt;
&lt;br /&gt;
Semihosting is a mechanism that enables code running on an ARM target to communicate and use the Input/Output facilities on a host computer that is running a debugger.&lt;br /&gt;
&lt;br /&gt;
Examples of these facilities include keyboard input, screen output, and disk I/O.&lt;br /&gt;
&amp;lt;/blockquote&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The GNU ARM Eclipse plugin comes with a really bare-bone implementation of some semihosting print functions that can be used to print logs to the console right in Eclipse (over GDB, without using any additional serial/UART connection whatsoever).&lt;br /&gt;
&lt;br /&gt;
Since I&#039;d always create a project without Semihosting enabled in the GNU ARM Eclipse wizard, you can still easily enable it later on:&lt;br /&gt;
&lt;br /&gt;
The easiest way I&#039;ve found so far, is by defining those Preprocessor constants in the C/C++ Project settings (Projects &amp;gt; Properties &amp;gt; C/C++ Build &amp;gt; Settings &amp;gt; Cross ARM GNU C/C++ Compiler &amp;gt; Preprocessor):&lt;br /&gt;
* TRACE&lt;br /&gt;
* OS_USE_TRACE_SEMIHOSTING_STDOUT&lt;br /&gt;
&lt;br /&gt;
And then, by using the following function calls in your code to log stuff to the Eclipse console right away:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
trace_initialize(); // in fact not required&lt;br /&gt;
// (...)&lt;br /&gt;
static int i = 0;&lt;br /&gt;
trace_puts( &amp;quot;hello&amp;quot; );&lt;br /&gt;
trace_printf( &amp;quot;nr %d\n&amp;quot;, i++ );&lt;br /&gt;
HAL_Delay( 1000 );  &lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
These functions were implemented by the author of GNU ARM Eclipse [https://github.com/ilg-ul Liviu Ionescu], and can be looked up in these files:&lt;br /&gt;
* &amp;lt;eclipse_project&amp;gt;/system/include/arm/semihosting.h&lt;br /&gt;
* &amp;lt;eclipse_project&amp;gt;/system/include/diag/Trace.h&lt;br /&gt;
* &amp;lt;eclipse_project&amp;gt;/system/src/diag/Trace.c&lt;br /&gt;
* &amp;lt;eclipse_project&amp;gt;/system/src/diag/trace_impl.c&lt;br /&gt;
&lt;br /&gt;
An interesting comment in &#039;&#039;trace_impl.c:133&#039;&#039; says:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
// Semihosting is the other output channel that can be used for the trace&lt;br /&gt;
// messages. It comes in two flavours: STDOUT and DEBUG. The STDOUT channel&lt;br /&gt;
// is the equivalent of the stdout in POSIX and in most cases it is forwarded&lt;br /&gt;
// to the GDB server stdout stream. The debug channel is a separate&lt;br /&gt;
// channel. STDOUT is buffered, so nothing is displayed until a \n;&lt;br /&gt;
// DEBUG is not buffered, but can be slow.&lt;br /&gt;
//&lt;br /&gt;
// Choosing between semihosting stdout and debug depends on the capabilities&lt;br /&gt;
// of your GDB server, and also on specific needs. It is recommended to test&lt;br /&gt;
// DEBUG first, and if too slow, try STDOUT.&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Note that semihosting needs to be enabled in your Eclipse run configuration (it is by default), in the Startup tab &amp;gt; Enable ARM semihosting. This will tell GDB to use semihosting. Without enabling, calls to those trace_* functions will throw some kind of exception... and make the processor halt. I couldn&#039;t find out much yet about how this feature really works, somehow it uses a special BKPT instruction...&lt;br /&gt;
&lt;br /&gt;
Semihosting (OS_USE_TRACE_SEMIHOSTING_STDOUT) can also be used in &amp;quot;Release&amp;quot; builds, since the semihosted calls don&#039;t rely on debug symbols.&lt;br /&gt;
&lt;br /&gt;
=== IDE: Code::Blocks ===&lt;br /&gt;
&lt;br /&gt;
My favorite cross-platform IDE for C/C++ is Code::Blocks. - And luckily, it also works well for ARM development! After twiddling around with those confusing Eclipse settings, I&#039;ve almost forgot to try out and setup Code::Blocks.&lt;br /&gt;
&lt;br /&gt;
The steps required are bit unintuitive, but building and debugging projects with full auto-complete and indexer support works now.&lt;br /&gt;
&lt;br /&gt;
The advantages over using Eclipse:&lt;br /&gt;
* Faster GUI.&lt;br /&gt;
* Works with STM32CubeMX generated code.&lt;br /&gt;
* Uses just a plain/manually editable Makefile to build the project.&lt;br /&gt;
* Familiar C/C++ settings and more *transparent* project handling -&amp;gt; Edit + debug. Nothing more. Everything can be done by hand on a console too. No mysterious hidden helpers...&lt;br /&gt;
&lt;br /&gt;
I&#039;m still evaluating this workflow... But to get things up and running, you can do this:&lt;br /&gt;
&lt;br /&gt;
(Assuming you already have a working Makefile based project, e.g. [http://wiki.sgmk-ssam.ch/wiki/STM32_dev#STM32CubeMX_to_Makefile created with STM32CubeMX, like described above]).&lt;br /&gt;
&lt;br /&gt;
* Open Code::Blocks and create an &#039;&#039;&#039;empty&#039;&#039;&#039; project (&#039;&#039;File &amp;gt; New &amp;gt; Project &amp;gt; Empty project&#039;&#039;).&lt;br /&gt;
* Give it a name in the Wizard, and choose the &#039;&#039;GNU GCC Compiler for ARM&#039;&#039;, and save it. &lt;br /&gt;
* Copy all content of the Makefile project over to Code::Blocks project folder.&lt;br /&gt;
* Import all required source files into the Code::Blocks workspace (right click -&amp;gt; &#039;&#039;Add files recursively...&#039;&#039;). &lt;br /&gt;
* Check &#039;&#039;Project &amp;gt; Properties &amp;gt; Project settings &amp;gt; Makefile: This is a custom Makefile&#039;&#039;.&lt;br /&gt;
* Adjust the build settings in &#039;&#039;Project &amp;gt; Build options &amp;gt; &amp;quot;Make commands&amp;quot;&#039;&#039;. - This might either require you to change the Makefile (i.e. add Debug/Release targets), or the commands. - For simplicity&#039;s sake, just ignore those $make, $makefile variables and overwrite them with your actual commands (i.e.&#039;&#039;$make -f $makefile $target&#039;&#039; -&amp;gt; &#039;&#039;make all&#039;&#039;).&lt;br /&gt;
* &#039;&#039;Build&#039;&#039; the project and check in the &#039;&#039;Build log&#039;&#039; if there where any errors/warnings.&lt;br /&gt;
&lt;br /&gt;
So, if this is working now, try to edit a source file and see if those really useful auto-complete and jump to declaration/implementation features are working. - One caveat of using an external Makefile is that the IDE doesn&#039;t know the current settings. So, for example, #defines are not available, and syntax highlighting will not update automatically... So it might be worth it add settings manually at some point.&lt;br /&gt;
&lt;br /&gt;
Now, to get the flashing and debugging working, try this:&lt;br /&gt;
&lt;br /&gt;
* Go to the &#039;&#039;Settings &amp;gt; Debugger&#039;&#039; Settings.&lt;br /&gt;
* Add a new GDB debugger setting (hit &#039;&#039;Create Config&#039;&#039; and call it &#039;&#039;ARM OpenOCD&#039;&#039; for example).&lt;br /&gt;
* Change the &#039;&#039;Executable path&#039;&#039; according to your toolchains location, and check &#039;Do *not* run the debugee&#039;.&lt;br /&gt;
* Go to &#039;&#039;Projects &amp;gt; Properties &amp;gt; Debugger&#039;&#039;.&lt;br /&gt;
** Change the &amp;lt;Project&amp;gt; &#039;&#039;Remote connection&#039;&#039; settings to IP: 127.0.0.1 / Port: 3333.&lt;br /&gt;
** Go to the &amp;lt;Project&amp;gt; &#039;&#039;Additional GDB commands&#039;&#039; tab. And enter those commands into the &#039;&#039;After connection&#039;&#039; box (change filename!):&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
monitor halt&lt;br /&gt;
load ./build/test.elf&lt;br /&gt;
file ./build/test.elf&lt;br /&gt;
monitor sleep 1000&lt;br /&gt;
monitor reset&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
To not run the program automatically, remove the last two commands. Then you need to &#039;&#039;Start / Continue&#039;&#039; the program twice, but you&#039;ll catch the first breakpoint you&#039;ve set!&lt;br /&gt;
* Choose &#039;&#039;Debug &amp;gt; Active Debuggers &amp;gt; GDB/CDB Debugger: ARM OpenOCD&#039;&#039;.&lt;br /&gt;
* Start OpenOCD in a terminal. (Described above).&lt;br /&gt;
* Start debugging by pressing the red arrow (Run / continue) in the debugging toolbar.&lt;br /&gt;
&lt;br /&gt;
The steps are the same as the ones in [http://www.hackvandedam.nl/blog/?p=707 this tutorial &#039;&#039;&#039;with screenshots&#039;&#039;&#039;].&lt;br /&gt;
&lt;br /&gt;
=== stlink ===&lt;br /&gt;
&lt;br /&gt;
[https://github.com/texane/stlink stlink] is a command line tool for programming, inspecting and debugging the STM32 microcontrollers. It also used internally by OpenOCD (I think). - It comes with several small programs (st-flash, st-info, st-term, st-util) that can come in handy while working with the STM32 micros.&lt;br /&gt;
&lt;br /&gt;
There&#039;s a tutorial:&lt;br /&gt;
https://github.com/texane/stlink/blob/master/doc/tutorial/tutorial.pdf&lt;br /&gt;
&lt;br /&gt;
Some useful things I&#039;ve discovered:&lt;br /&gt;
&lt;br /&gt;
Just run st-util can Ctrl-C again to see all relevant uC properties:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
$ st-util&lt;br /&gt;
2016-01-29T13:06:25 INFO src/stlink-common.c: Loading device parameters....&lt;br /&gt;
2016-01-29T13:06:25 INFO src/stlink-common.c: Device connected is: F07x device, id 0x20016448&lt;br /&gt;
2016-01-29T13:06:25 INFO src/stlink-common.c: SRAM size: 0x4000 bytes (16 KiB), Flash: 0x10000 bytes (64 KiB) in pages of 2048 bytes&lt;br /&gt;
2016-01-29T13:06:25 INFO gdbserver/gdb-server.c: Chip ID is 00000448, Core ID is  0bb11477.&lt;br /&gt;
2016-01-29T13:06:25 INFO gdbserver/gdb-server.c: Target voltage is 3554 mV.&lt;br /&gt;
2016-01-29T13:06:25 INFO gdbserver/gdb-server.c: Listening at *:4242...&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Or with st-info:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
$ st-info &lt;br /&gt;
st-info --flash&lt;br /&gt;
st-info --sram&lt;br /&gt;
st-info --descr&lt;br /&gt;
st-info --pagesize&lt;br /&gt;
st-info --chipid&lt;br /&gt;
$ st-info --flash&lt;br /&gt;
0x10000&lt;br /&gt;
$ st-info --sram&lt;br /&gt;
0x4000&lt;br /&gt;
$ st-info --descr&lt;br /&gt;
F07x device&lt;br /&gt;
$ st-info --pagesize&lt;br /&gt;
0x800&lt;br /&gt;
$ st-info --chipid&lt;br /&gt;
0x0448&lt;br /&gt;
&lt;br /&gt;
$ echo `st-info --sram | xargs -I@ printf &amp;quot;%d/1024\n&amp;quot; @ | bc`kB RAM&lt;br /&gt;
16kB RAM&lt;br /&gt;
$ echo `st-info --flash | xargs -I@ printf &amp;quot;%d/1024\n&amp;quot; @ | bc`kB FLASH&lt;br /&gt;
64kB FLASH&lt;br /&gt;
&lt;br /&gt;
$ for a in sram flash pagesize; do echo `st-info --$a | xargs -I@ printf &amp;quot;%d/1024\n&amp;quot; @ | bc`kb $a; done&lt;br /&gt;
16kb sram&lt;br /&gt;
64kb flash&lt;br /&gt;
2kb pagesize&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
OR Simply:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
$ st-link --probe&lt;br /&gt;
Found 1 stlink programmers&lt;br /&gt;
 serial: 303030303030303030303031&lt;br /&gt;
openocd: &amp;quot;\x30\x30\x30\x30\x30\x30\x30\x30\x30\x30\x30\x31&amp;quot;&lt;br /&gt;
  flash: 131072 (pagesize: 256)&lt;br /&gt;
   sram: 16384&lt;br /&gt;
 chipid: 0x0416&lt;br /&gt;
  descr: L1 Med-density device&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Links ===&lt;br /&gt;
&lt;br /&gt;
==== Tools ====&lt;br /&gt;
* [https://gnuarmeclipse.github.io/ GNU ARM Eclipse]: [https://gnuarmeclipse.github.io/eclipse/workspace/preferences/ workspace_preferences], [http://gnuarmeclipse.github.io/toolchain/path/ toolchain_path], [http://gnuarmeclipse.github.io/eclipse/project/portability/ project_portability]&lt;br /&gt;
&lt;br /&gt;
==== Tutorials ====&lt;br /&gt;
* Great introduction: [http://www.triplespark.net/elec/pdev/arm/stm32.html Programming STM32 F2, F4 ARMs under Linux: A Tutorial from Scratch]&lt;br /&gt;
* STM32Cube to GNU ARM Eclipse tips: http://www.carminenoviello.com/en/2015/06/04/stm32-applications-eclipse-gcc-stcube/&lt;br /&gt;
* Micro Python on STM32F4-Discovery: http://gpio.kaltpost.de/?p=2082&lt;br /&gt;
* Logs: https://hackaday.io/project/4277/logs?page=2&lt;br /&gt;
* Code::Blocks tutorial: http://www.hackvandedam.nl/blog/?p=707&lt;br /&gt;
* Eclipse tutorial: http://www.carminenoviello.com/en/2015/06/04/stm32-applications-eclipse-gcc-stcube&lt;br /&gt;
* http://sigalrm.blogspot.ch/2013/12/using-ccm-memory-on-stm32.html&lt;br /&gt;
* http://stm32f4-discovery.com/2014/08/stm32f4-external-interrupts-tutorial/&lt;br /&gt;
* ...&lt;br /&gt;
&lt;br /&gt;
==== Projects / Demos / Code ====&lt;br /&gt;
* MrBlueXav&#039;s Synths: https://github.com/MrBlueXav&lt;br /&gt;
* cliffle&#039;s VGA stuff: https://github.com/cbiffle/m4vgalib-demos, http://cliffle.com/article/2015/06/05/introducing-glitch/&lt;br /&gt;
* ESPruino code: https://github.com/espruino/Espruino -&amp;gt; STM32F401CDU6&lt;br /&gt;
* STM32F4 Audio Codec Board: http://ebrombaugh.studionebula.com/synth/stm32f4_codec/&lt;br /&gt;
* ESPRUINO: http://www.espruino.com/ReferenceSTM32F4DISCOVERY&lt;br /&gt;
* micropython: https://github.com/micropython/micropython&lt;br /&gt;
* STM32F4 DIY: http://mikrocontroller.bplaced.net/wordpress/?page_id=1482&lt;br /&gt;
* STM32F4 overclocking: http://sigalrm.blogspot.ch/2014/01/overclocking-stm32f4.html&lt;br /&gt;
* thermal camera: http://www.theresistornetwork.com/2014/11/flir-lepton-thermal-imaging-sensor.html&lt;br /&gt;
* STM32F7: http://hackaday.com/2015/06/26/new-part-day-stm32f7-an-arm-cortex-m7/&lt;br /&gt;
* Karsten Schmidt: http://workshop.thi.ng/ [https://soundcloud.com/forthcharlie soundcloud] https://github.com/thi-ng/ws-ldn-4 https://github.com/thi-ng/ws-ldn-3 http://asm.thi.ng/&lt;br /&gt;
* Peridrummmm Demo: http://www.pouet.net/prod.php?which=59095 with sources: http://aka-san.halcy.de/revision2012/peridiummmm-src.zip&lt;br /&gt;
* Andy&#039;s Workshop: http://andybrown.me.uk/&lt;br /&gt;
* axoloti: http://axoloti.com/&lt;br /&gt;
&lt;br /&gt;
==== Libraries ====&lt;br /&gt;
* libopencm3 http://libopencm3.org/wiki/Main_Page&lt;br /&gt;
* list of libs: http://mikrocontroller.bplaced.net/wordpress/?page_id=2736&lt;br /&gt;
&lt;br /&gt;
==== OS ====&lt;br /&gt;
* FreeRTOS: http://www.freertos.org/index.html&lt;br /&gt;
* Embedded Linux on STM32: https://github.com/EmcraftSystems&lt;br /&gt;
* ChibiOS: http://www.chibios.org/dokuwiki/&lt;br /&gt;
&lt;br /&gt;
==== General ====&lt;br /&gt;
* ARM Related Books: http://www.arm.com/support/resources/arm-books/&lt;br /&gt;
* STM32 Overview http://www.st.com/web/en/catalog/mmc/FM141/SC1169?sc=stm32&lt;br /&gt;
* mbed https://en.wikipedia.org/wiki/Mbed&lt;br /&gt;
* CMSIS: http://www.keil.com/pack/doc/cmsis/Core/html/index.html&lt;br /&gt;
&lt;br /&gt;
== Hardware ==&lt;br /&gt;
&lt;br /&gt;
All about hardware and hardware tools for STM32 dev. Chips, programmers etc.&lt;br /&gt;
&lt;br /&gt;
=== ST-Link V2 Programmer ===&lt;br /&gt;
&lt;br /&gt;
There are two popular ST-Link V2 Progammers on the market. They have a different pinout but work both well like described above.&lt;br /&gt;
&lt;br /&gt;
[[File:ST-LinkV2_pinout_01.jpg]]&lt;br /&gt;
&lt;br /&gt;
Alternatively, STM32Discovery/[http://jeelabs.org/book/1547a/index.html Nucleo boards too can be used as SWD programmers].&lt;br /&gt;
&lt;br /&gt;
Luckily, only 4 pins have to be used to program and debug the target!&lt;br /&gt;
To find out more about this protocol, have a look into [http://www.arm.com/products/system-ip/debug-trace/coresight-soc-components/serial-wire-debug.php Serial Debug Wire (SWD)] as an alternative to JTAG.&lt;br /&gt;
&lt;br /&gt;
Connect to following pins of the programmer to the corresponding pins on the PCB:&lt;br /&gt;
&lt;br /&gt;
* V3V&lt;br /&gt;
* GND&lt;br /&gt;
* SWCLK&lt;br /&gt;
* SWDIO&lt;br /&gt;
&lt;br /&gt;
-&amp;gt; NRST can be important too on some STM32 chips!&lt;br /&gt;
&lt;br /&gt;
Remember: These are &#039;&#039;&#039;not&#039;&#039;&#039; the [http://www.st.com/web/catalog/tools/FM146/CL1984/SC724/SS1677/PF251168 official ST-Link V2 Programmers], sold by ST.&lt;br /&gt;
&lt;br /&gt;
== Projects ==&lt;br /&gt;
&lt;br /&gt;
STM32 based projects.&lt;br /&gt;
&lt;br /&gt;
=== STM32basic ===&lt;br /&gt;
&lt;br /&gt;
STM32basic is a test board to see how STM32 chips can be used in DIY circuits.&lt;br /&gt;
&lt;br /&gt;
==== STM32basic rev0.01 ====&lt;br /&gt;
&lt;br /&gt;
An initial list of tests:&lt;br /&gt;
&lt;br /&gt;
* JTAG: See how we can program the thing. Do we need all JTAG pins? Or only the SWD pins? What about reset? - Do the cheapo Chinese STLink V2 programmer really work?&lt;br /&gt;
* Basic I/O: LED and push button.&lt;br /&gt;
* U(S)ART: Check whether it&#039;s possible to hook up an FTDI to send/receive characters to/from the STM32basic?&lt;br /&gt;
* BOOT0/1: What about those boot modes?&lt;br /&gt;
* Power Usage : 3V3 Regulator: ..&lt;br /&gt;
&lt;br /&gt;
[[File:STM32basic_pcb1b.jpg]]&lt;br /&gt;
&lt;br /&gt;
Board at OSH Park:&amp;lt;br /&amp;gt;&lt;br /&gt;
https://oshpark.com/shared_projects/kCD7Yr0A&lt;br /&gt;
&lt;br /&gt;
KiCad project and everything else:&amp;lt;br /&amp;gt;&lt;br /&gt;
Remark: this has been made in hurry and is just a test:&amp;lt;br /&amp;gt;&lt;br /&gt;
http://0rel.com/prj/STM32basic/STM32basic_rev0.01.zip&lt;br /&gt;
&lt;br /&gt;
[[File:Stm32basic1.jpg]]&lt;br /&gt;
&lt;br /&gt;
So far, the tests have been working ok.&lt;br /&gt;
&lt;br /&gt;
* STLink V2 programmers seem to work fine, and only require 2 pins + VCC/GND! SWDIO and SWCLK, that&#039;s it! For programming and on-chip debugging.&lt;br /&gt;
* I/O works as well. External interrupts can be configured.&lt;br /&gt;
* UART works, but I have not yet tested it with a proper code. It was working with some echo snippet I&#039;ve found somewhere.&lt;br /&gt;
* Power usage is low. ~15 mA at 3.3 V.&lt;br /&gt;
* BOOT0 jumper has to be set (connected to ground) in order to run code... - Other boot modes have not been tested yet. More tests are needed there... What are the other available boot modes, what about those built-in boot loaders?&lt;br /&gt;
&lt;br /&gt;
However, the board has several flaws:&lt;br /&gt;
* 1.27 mm pin-pitch headers cannot be arranged like that (GPIOs). They need to be further apart to make sockets/headers fit.&lt;br /&gt;
* 3V3 LDO doesn&#039;t make much sense like this. Add add a buck/boost converter. Also remove 5V label.&lt;br /&gt;
* This BOOT0 jumper isn&#039;t nice like this...&lt;br /&gt;
* Remove unnecessary JTAG pins. SWD only.&lt;br /&gt;
* Remove unnecessary USART pins.&lt;br /&gt;
* Add crystal.&lt;br /&gt;
* Add USB plug.&lt;br /&gt;
&lt;br /&gt;
Probably, this will not be remade, since it was enough for a test. I&#039;d like to make a very basic USB touch device next.&lt;br /&gt;
&lt;br /&gt;
==== STM32basic Eclipse project ====&lt;br /&gt;
&lt;br /&gt;
Test project to see if GPIOs with External interrupts and semi hosting works. Sloppy and not cleaned up yet...&amp;lt;br /&amp;gt;&lt;br /&gt;
http://0rel.com/prj/STM32basic/testSTM32F072_interrupt_test0.zip&lt;br /&gt;
&lt;br /&gt;
Note: Eclipse projects can be imported in an existing or new workspace with: &#039;&#039;File &amp;gt; Import &amp;gt; General &amp;gt; Existing Projects into Workspace&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
=== todo ===&lt;br /&gt;
&lt;br /&gt;
* I2C peripherals&lt;br /&gt;
* I2S peripherals&lt;br /&gt;
* SPI peripherals&lt;br /&gt;
* touch&lt;br /&gt;
* usb&lt;br /&gt;
* external memory (sram, flash, eeprom...) -&amp;gt; RTOS / Linux / ChibiOS? (similar to this http://hforsten.com/making-embedded-linux-computer.html)?&lt;br /&gt;
.....&lt;/div&gt;</summary>
		<author><name>0rel</name></author>
	</entry>
	<entry>
		<id>https://wiki.sgmk-ssam.ch/index.php?title=STM32_dev&amp;diff=6572</id>
		<title>STM32 dev</title>
		<link rel="alternate" type="text/html" href="https://wiki.sgmk-ssam.ch/index.php?title=STM32_dev&amp;diff=6572"/>
		<updated>2016-10-15T16:27:36Z</updated>

		<summary type="html">&lt;p&gt;0rel: /* IDE: Eclipse SW4STM32 */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Overview ==&lt;br /&gt;
&lt;br /&gt;
Notes on STM32 microcontrollers and on how to get them working in DIY projects.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;/// this is a work in progress draft ///&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
== Software ==&lt;br /&gt;
&lt;br /&gt;
All about software tools for STM32 dev. Development environments, compilers, debuggers, IDEs etc.&lt;br /&gt;
&lt;br /&gt;
=== ARM toolchains ===&lt;br /&gt;
&lt;br /&gt;
==== gcc-arm-embedded Toolchain ====&lt;br /&gt;
&lt;br /&gt;
Install the GCC arm-none-eabi toolchain for your OS. On Arch Linux this can be done with the package manager:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
$ sudo pacman -S arm-none-eabi-gcc arm-none-eabi-gdb arm-none-eabi-binutils arm-none-eabi-newlib&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Alternatively, it can be built from scratch, to have all tools and their sources in one place.&lt;br /&gt;
&lt;br /&gt;
* Download the sources here: https://launchpad.net/gcc-arm-embedded/+download&lt;br /&gt;
* Install the &#039;&#039;common tools and libraries&#039;&#039; like described in the [https://launchpadlibrarian.net/231136652/How-to-build-toolchain.pdf documentation].&lt;br /&gt;
* Build the toolchain. - On my system, the following steps were required:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
$ cp gcc-arm-none-eabi-5_2-2015q4-20151219-src.tar.bz2 ~/toolchain&lt;br /&gt;
$ cd ~/toolchain&lt;br /&gt;
$ tar -xjf gcc-arm-none-eabi-5_2-2015q4-20151219-src.tar.bz2&lt;br /&gt;
$ cd ./gcc-arm-none-eabi-5_2-2015q4-20151219/src&lt;br /&gt;
$ find -name &#039;*.tar.*&#039; | xargs -I% tar -xf %&lt;br /&gt;
$ cd ..&lt;br /&gt;
$ ./build-prerequisites.sh --skip_steps=mingw32&lt;br /&gt;
$ ./build-toolchain.sh --skip_steps=mingw32,manual&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
Note that those &#039;&#039;skip_steps&#039;&#039; options were required in my case.&lt;br /&gt;
&lt;br /&gt;
==== Linaro Toolchain ====&lt;br /&gt;
&lt;br /&gt;
The [https://en.wikipedia.org/wiki/Linaro Linaro] toolchain seems to be famous as well.&lt;br /&gt;
&lt;br /&gt;
Install it with your package manager if available, or build it yourself:&amp;lt;br /&amp;gt;&lt;br /&gt;
https://wiki.linaro.org/WorkingGroups/ToolChain&amp;lt;br /&amp;gt;&lt;br /&gt;
https://wiki.linaro.org/WorkingGroups/ToolChain/FAQ&lt;br /&gt;
&lt;br /&gt;
==== devkitpro devkitARM toolchain ====&lt;br /&gt;
&lt;br /&gt;
Another gcc variant: http://devkitpro.org/&lt;br /&gt;
&lt;br /&gt;
Used in the homebrew scene for game consoles like the GP32, Nintendo (3)DS and GBA. It can [http://www.pouet.net/prod.php?which=59095 apparently] also be used for the STM32s as well! And generates probably more optimized binaries?&lt;br /&gt;
&lt;br /&gt;
(On Arch it can be installed from the AUR: https://aur.archlinux.org/packages/devkitarm-bin/ . But beware, the compiler, link, binutils have all the same name as the ones from the official GCC arm-none-eabi toolchain. So it&#039;s probably better to install it manually.)&lt;br /&gt;
&lt;br /&gt;
=== STM32CubeMX on Linux ===&lt;br /&gt;
&lt;br /&gt;
STM32CubeMX is a code generator for STM32 micros that can come in handy when you start a new project. It generates all the necessary init and HAL code, library and custom pin mux code for your specific MCU.&lt;br /&gt;
&lt;br /&gt;
Unfortunately, it comes as a Windows EXE and ST doesn&#039;t mention that it actually is a Java application. Luckily it can be installed on Linux by hand (thanks to 5V Joe&#039;s great note [http://fivevolt.blogspot.ch/2014/07/installing-stm32cubemx-on-linux.html there]):&lt;br /&gt;
&lt;br /&gt;
* Download [http://www.st.com/web/catalog/tools/FM147/CL1794/SC961/SS1743/PF259242?icmp=stm32cubemx_pron_prcube_feb2014&amp;amp;sc=stm32cube-pr STM32CubeMX].&lt;br /&gt;
* Install the application (tested in January 2016):&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
$ unzip SetupSTM32CubeMX-4.12.0.exe -d stm32cube&lt;br /&gt;
$ cd stm32cube&lt;br /&gt;
$ java -cp . com.izforge.izpack.installer.bootstrap.Installer&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
* Run:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
$ cd &amp;lt;install_dir&amp;gt;&lt;br /&gt;
$ unzip STM32CubeMX.exe&lt;br /&gt;
$ java -cp . com.st.microxplorer.maingui.STM32CubeMX&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== STM32CubeMX to Makefile ===&lt;br /&gt;
&lt;br /&gt;
For whatever reason, STM32CubeMX does not export plain GCC/Makefiles along with the initialization code. But instead, it supports an unpopular IDE called [http://www.st.com/web/catalog/tools/FM147/CL1794/SC961/SS1533/PF261797 SW4STM32], which is also based on free GNU tools. So after installing STM32CubeMX, these are the steps to get the GCC/Makefile project running:&lt;br /&gt;
&lt;br /&gt;
* Get this nice Python script by [http://www.ba0sh1.com/ Baoshi] to generate the Makefile for an exported SW4STM32 project:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
$ git clone https://github.com/baoshi/CubeMX2Makefile&lt;br /&gt;
$ cd CubeMX2Makefile&lt;br /&gt;
$ python2 CubeMX2Makefile.py &amp;lt;your_sw4stm32_prject_dir&amp;gt;&lt;br /&gt;
$ cd &amp;lt;your_sw4stm32_prject_dir&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* Fix a tiny bug in the generated Makefile (tested in January 2016). More can be read [http://www.ba0sh1.com/stm32cubemx-gcc-makefile/ here].&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
$ grep __weak Makefile &lt;br /&gt;
C_DEFS = -D__weak=&amp;quot;__attribute__\(\(weak\)\)&amp;quot; -D__packed=&amp;quot;__attribute__\(\(__packed__\)\)&amp;quot; -DUSE_HAL_DRIVER -DSTM32F072xB&lt;br /&gt;
$ sed -i &#039;s/\\(\\(weak\\)\\)/((weak))/g&#039; Makefile &lt;br /&gt;
$ sed -i &#039;s/\\(\\(packed\\)\\)/((packed))/g&#039; Makefile &lt;br /&gt;
$ grep __weak Makefile &lt;br /&gt;
C_DEFS = -D__weak=&amp;quot;__attribute__((weak))&amp;quot; -D__packed=&amp;quot;__attribute__\(\(__packed__\)\)&amp;quot; -DUSE_HAL_DRIVER -DSTM32F072xB&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* Then build the binary:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
$ make&lt;br /&gt;
(...)&lt;br /&gt;
arm-none-eabi-size build/STM32F072RBT6.elf&lt;br /&gt;
   text	   data	    bss	    dec	    hex	filename&lt;br /&gt;
   4568	     12	   1572	   6152	   1808	build/STM32F072RBT6.elf&lt;br /&gt;
arm-none-eabi-objcopy -O ihex build/STM32F072RBT6.elf build/STM32F072RBT6.hex&lt;br /&gt;
arm-none-eabi-objcopy -O binary -S build/STM32F072RBT6.elf build/STM32F072RBT6.bin	&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Flash ===&lt;br /&gt;
&lt;br /&gt;
Install OpenOCD and STLINK. On Arch Linux:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
sudo pacman -S stlink openocd&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now [http://openocd.org/ OpenOCD] and (arm-none-eabi-)gdb can be used to program and debug the MCU. All discovery boards also come with an ST-LINK/V2 programmer right built in speaking over USB to the host and over JTAG/[http://www.arm.com/products/system-ip/debug-trace/coresight-soc-components/serial-wire-debug.php SWD] to the target (note: only two pins are actually required for SWD debugging/flashing (SWDIO/SWCLK), but that for later (see also [[#Hardware]])). STM32 Discovery Boards should show up in the lsusb list like that:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
$ lsusb&lt;br /&gt;
(...)&lt;br /&gt;
Bus 003 Device 006: ID 0483:3748 STMicroelectronics ST-LINK/V2&lt;br /&gt;
(...)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
OpenOCD can now act as a &amp;quot;middleman&amp;quot; between the ST-LINK programmer and the user. As a server on the host, to which you can connect with telnet and GDB.&lt;br /&gt;
&lt;br /&gt;
To configure OpenOCD, put a configuration file called opencd.cfg into the project folder and start OpenOCD. While working on the project, let it run there in the foreground to see all the logs...&lt;br /&gt;
&lt;br /&gt;
For the [http://www.st.com/st-web-ui/static/active/jp/resource/technical/document/user_manual/DM00099401.pdf STM32 F072 Discovery] board this should work, for example:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
$ cd &amp;lt;project_directory&amp;gt;&lt;br /&gt;
$ echo &amp;quot;source [find board/stm32f0discovery.cfg]&amp;quot; &amp;gt; openocd.cfg&lt;br /&gt;
$ openocd&lt;br /&gt;
Open On-Chip Debugger 0.9.0 (2015-05-19-13:50)&lt;br /&gt;
Licensed under GNU GPL v2&lt;br /&gt;
For bug reports, read&lt;br /&gt;
	http://openocd.org/doc/doxygen/bugs.html&lt;br /&gt;
Info : The selected transport took over low-level target control. The results might differ compared to plain JTAG/SWD&lt;br /&gt;
adapter speed: 1000 kHz&lt;br /&gt;
adapter_nsrst_delay: 100&lt;br /&gt;
none separate&lt;br /&gt;
srst_only separate srst_nogate srst_open_drain connect_deassert_srst&lt;br /&gt;
Info : Unable to match requested speed 1000 kHz, using 950 kHz&lt;br /&gt;
Info : Unable to match requested speed 1000 kHz, using 950 kHz&lt;br /&gt;
Info : clock speed 950 kHz&lt;br /&gt;
Info : STLINK v2 JTAG v17 API v2 SWIM v0 VID 0x0483 PID 0x3748&lt;br /&gt;
Info : using stlink api v2&lt;br /&gt;
Info : Target voltage: 2.896454&lt;br /&gt;
Info : stm32f0x.cpu: hardware has 4 breakpoints, 2 watchpoints&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
(Don&#039;t worry about those warnings about the wrong clock speed for now...)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
In order to program the flash, connect to OpenOCD via telnet in another terminal:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
$ telnet 127.0.0.1 4444&lt;br /&gt;
Trying 127.0.0.1...&lt;br /&gt;
Connected to 127.0.0.1.&lt;br /&gt;
Escape character is &#039;^]&#039;.&lt;br /&gt;
Open On-Chip Debugger&lt;br /&gt;
&amp;gt; &lt;br /&gt;
&amp;gt; reset halt&lt;br /&gt;
target state: halted&lt;br /&gt;
target halted due to debug-request, current mode: Thread &lt;br /&gt;
xPSR: 0xc1000000 pc: 0x080014d0 msp: 0x20004000&lt;br /&gt;
&amp;gt; flash probe 0&lt;br /&gt;
device id = 0x20016448&lt;br /&gt;
flash size = 128kbytes&lt;br /&gt;
flash &#039;stm32f1x&#039; found at 0x08000000&lt;br /&gt;
&amp;gt; flash write_image erase build/STM32F072RBT6.elf&lt;br /&gt;
auto erase enabled&lt;br /&gt;
target state: halted&lt;br /&gt;
target halted due to breakpoint, current mode: Thread &lt;br /&gt;
xPSR: 0x61000000 pc: 0x2000003a msp: 0x20004000&lt;br /&gt;
wrote 6144 bytes from file build/STM32F072RBT6.elf in 0.503961s (11.906 KiB/s)&lt;br /&gt;
&amp;gt; reset run&lt;br /&gt;
&amp;gt; exit&lt;br /&gt;
Connection closed by foreign host.&lt;br /&gt;
$&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This should write the binary to the flash memory and start the program.&lt;br /&gt;
Of course, all those steps can be automated further and integrated into an IDE, but that&#039;s for later...&lt;br /&gt;
&lt;br /&gt;
To program the STM32F0Discovery board for example, this can be used to just flash the chip:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
$ openocd -f board/stm32f0discovery.cfg -c &amp;quot;program build/STM32F072RBT6.elf verify reset exit&amp;quot; &lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
To program a custom board for example with the STM32F0x chip, a command like this can be used:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
$ openocd -f interface/stlink-v2.cfg -f target/stm32f0x.cfg -c &amp;quot;program testSTM32F072_interrupt_test0.elf verify reset exit&amp;quot;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
To make things more convenient, add a new target &#039;&#039;flash&#039;&#039; to the Makefile with this command, and you can simply run &#039;&#039;make flash&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The exported main.c from STM32CubeMX was only slightly modified to let the user LEDs flash and react to the user pushbutton:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
******************************************************************************&lt;br /&gt;
* main.c *&lt;br /&gt;
******************************************************************************&lt;br /&gt;
&lt;br /&gt;
#include &amp;quot;stm32f0xx_hal.h&amp;quot;&lt;br /&gt;
&lt;br /&gt;
void SystemClock_Config(void);&lt;br /&gt;
static void MX_GPIO_Init(void);&lt;br /&gt;
&lt;br /&gt;
int main(void)&lt;br /&gt;
{&lt;br /&gt;
  /* Reset of all peripherals, Initializes the Flash interface and the Systick. */&lt;br /&gt;
  HAL_Init();&lt;br /&gt;
&lt;br /&gt;
  /* Configure the system clock */&lt;br /&gt;
  SystemClock_Config();&lt;br /&gt;
&lt;br /&gt;
  /* Initialize all configured peripherals */&lt;br /&gt;
  MX_GPIO_Init();&lt;br /&gt;
&lt;br /&gt;
  while (1)&lt;br /&gt;
  {&lt;br /&gt;
    uint32_t delay;&lt;br /&gt;
    if( HAL_GPIO_ReadPin( GPIOA, GPIO_PIN_0 ) == GPIO_PIN_SET )&lt;br /&gt;
      delay = 50;&lt;br /&gt;
    else&lt;br /&gt;
      delay = 250;&lt;br /&gt;
&lt;br /&gt;
    HAL_GPIO_TogglePin( GPIOC, GPIO_PIN_9 );&lt;br /&gt;
    HAL_Delay( delay );&lt;br /&gt;
    HAL_GPIO_TogglePin( GPIOC, GPIO_PIN_8 );&lt;br /&gt;
    HAL_Delay( delay );&lt;br /&gt;
    HAL_GPIO_TogglePin( GPIOC, GPIO_PIN_7 );&lt;br /&gt;
    HAL_Delay( delay );&lt;br /&gt;
    HAL_GPIO_TogglePin( GPIOC, GPIO_PIN_6 );&lt;br /&gt;
    HAL_Delay( delay );&lt;br /&gt;
&lt;br /&gt;
  }&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
/** System Clock Configuration&lt;br /&gt;
*/&lt;br /&gt;
void SystemClock_Config(void)&lt;br /&gt;
{&lt;br /&gt;
&lt;br /&gt;
  RCC_OscInitTypeDef RCC_OscInitStruct;&lt;br /&gt;
  RCC_ClkInitTypeDef RCC_ClkInitStruct;&lt;br /&gt;
&lt;br /&gt;
  RCC_OscInitStruct.OscillatorType = RCC_OSCILLATORTYPE_HSI;&lt;br /&gt;
  RCC_OscInitStruct.HSIState = RCC_HSI_ON;&lt;br /&gt;
  RCC_OscInitStruct.HSICalibrationValue = 16;&lt;br /&gt;
  RCC_OscInitStruct.PLL.PLLState = RCC_PLL_NONE;&lt;br /&gt;
  HAL_RCC_OscConfig(&amp;amp;RCC_OscInitStruct);&lt;br /&gt;
&lt;br /&gt;
  RCC_ClkInitStruct.ClockType = RCC_CLOCKTYPE_SYSCLK;&lt;br /&gt;
  RCC_ClkInitStruct.SYSCLKSource = RCC_SYSCLKSOURCE_HSI;&lt;br /&gt;
  RCC_ClkInitStruct.AHBCLKDivider = RCC_SYSCLK_DIV1;&lt;br /&gt;
  RCC_ClkInitStruct.APB1CLKDivider = RCC_HCLK_DIV1;&lt;br /&gt;
  HAL_RCC_ClockConfig(&amp;amp;RCC_ClkInitStruct, FLASH_LATENCY_0);&lt;br /&gt;
&lt;br /&gt;
  HAL_SYSTICK_Config(HAL_RCC_GetHCLKFreq()/1000);&lt;br /&gt;
&lt;br /&gt;
  HAL_SYSTICK_CLKSourceConfig(SYSTICK_CLKSOURCE_HCLK);&lt;br /&gt;
&lt;br /&gt;
  /* SysTick_IRQn interrupt configuration */&lt;br /&gt;
  HAL_NVIC_SetPriority(SysTick_IRQn, 0, 0);&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
/** Configure pins as&lt;br /&gt;
        * Analog&lt;br /&gt;
        * Input&lt;br /&gt;
        * Output&lt;br /&gt;
        * EVENT_OUT&lt;br /&gt;
        * EXTI&lt;br /&gt;
*/&lt;br /&gt;
void MX_GPIO_Init(void)&lt;br /&gt;
{&lt;br /&gt;
&lt;br /&gt;
  GPIO_InitTypeDef GPIO_InitStruct;&lt;br /&gt;
&lt;br /&gt;
  /* GPIO Ports Clock Enable */&lt;br /&gt;
  __GPIOA_CLK_ENABLE();&lt;br /&gt;
  __GPIOC_CLK_ENABLE();&lt;br /&gt;
&lt;br /&gt;
  /*Configure GPIO pin : PA0 */&lt;br /&gt;
  GPIO_InitStruct.Pin = GPIO_PIN_0;&lt;br /&gt;
  GPIO_InitStruct.Mode = GPIO_MODE_INPUT;&lt;br /&gt;
  GPIO_InitStruct.Pull = GPIO_NOPULL;&lt;br /&gt;
  HAL_GPIO_Init(GPIOA, &amp;amp;GPIO_InitStruct);&lt;br /&gt;
&lt;br /&gt;
  /*Configure GPIO pins : PC6 PC7 PC8 PC9 */&lt;br /&gt;
  GPIO_InitStruct.Pin = GPIO_PIN_6|GPIO_PIN_7|GPIO_PIN_8|GPIO_PIN_9;&lt;br /&gt;
  GPIO_InitStruct.Mode = GPIO_MODE_OUTPUT_PP;&lt;br /&gt;
  GPIO_InitStruct.Pull = GPIO_NOPULL;&lt;br /&gt;
  GPIO_InitStruct.Speed = GPIO_SPEED_LOW;&lt;br /&gt;
  HAL_GPIO_Init(GPIOC, &amp;amp;GPIO_InitStruct);&lt;br /&gt;
&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
(&lt;br /&gt;
Note that pins -- among various other things -- can be customized in the CubeMX editor. Reexporting code to an existing project is straight forward, and can be done easily while the old Makefile keeps valid for minor changes... - However, STM32CubeMX looks still quite unfinished to me. It&#039;s a nice concept, but where are all the ST libraries, for example for the [http://www.st.com/web/en/catalog/tools/FM147/CL1794/SC961/SS1743/LN1734/PF258658# touch functionality]? It still needs to be downloaded separately... and it comes in a bloody EXE file as well! *arghs*&lt;br /&gt;
&lt;br /&gt;
Unfortunately, things seem to be a bit confusing. If you&#039;re using a STM32F0, then probably need to take a look into the [http://www.st.com/web/catalog/tools/FM147/CL1794/SC961/SS1743/LN1897/PF260612?icmp=pf260612_pron_nb_jun2014&amp;amp;sc=stm32cubef0-pr STM32CubeF0] software bundle, which contains a more up-to-date TouchSensing Library... Hm.&lt;br /&gt;
&lt;br /&gt;
Also, note that most of the provided code by ST is only documented in the source files themselves... And there are at least two vastly differing versions of the basic functions out there, what makes copy/pasting/sharing a bit difficult. I even don&#039;t know if they continue working on this code base, or if they switch over to [https://www.mbed.com/en/ mbed]. That seems to be the focus of those newer [http://www.st.com/web/catalog/tools/FM116/SC959/SS1532/LN1847?sc=stm32nucleo Nucleo] evaluation boards.&lt;br /&gt;
)&lt;br /&gt;
&lt;br /&gt;
=== Debugging: GDB ===&lt;br /&gt;
&lt;br /&gt;
GDB can be used to debug the code right on the hardware. While OpenOCD is running, you can connect to the target like this and step through the program:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
$ arm-none-eabi-gdb -tui build/STM32F072RBT6.elf&lt;br /&gt;
(...)&lt;br /&gt;
Reading symbols from build/STM32F072RBT6.elf...done.&lt;br /&gt;
&lt;br /&gt;
(gdb) target remote :3333&lt;br /&gt;
Remote debugging using :3333&lt;br /&gt;
Python Exception &amp;lt;type &#039;exceptions.NameError&#039;&amp;gt; Installation error: gdb.execute_u&lt;br /&gt;
nwinders function is missing:&lt;br /&gt;
HAL_GetTick () at Drivers/STM32F0xx_HAL_Driver/Src/stm32f0xx_hal.c:298&lt;br /&gt;
&lt;br /&gt;
(gdb) c&lt;br /&gt;
Continuing.&lt;br /&gt;
&lt;br /&gt;
Program received signal SIGINT, Interrupt.&lt;br /&gt;
0x080002f6 in HAL_Delay (Python Exception &amp;lt;type &#039;exceptions.NameError&#039;&amp;gt; Installa&lt;br /&gt;
tion error: gdb.execute_unwinders function is missing:&lt;br /&gt;
Delay=250)&lt;br /&gt;
    at Drivers/STM32F0xx_HAL_Driver/Src/stm32f0xx_hal.c:317&lt;br /&gt;
&lt;br /&gt;
(gdb) break main.c:91&lt;br /&gt;
Breakpoint 1 at 0x8001392: file Src/main.c, line 91.&lt;br /&gt;
&lt;br /&gt;
(gdb) c&lt;br /&gt;
Continuing.&lt;br /&gt;
Note: automatically using hardware breakpoints for read-only addresses.&lt;br /&gt;
Python Exception &amp;lt;type &#039;exceptions.NameError&#039;&amp;gt; Installation error: gdb.execute_u&lt;br /&gt;
nwinders function is missing:&lt;br /&gt;
&lt;br /&gt;
Breakpoint 1, main () at Src/main.c:91&lt;br /&gt;
&lt;br /&gt;
(...)&lt;br /&gt;
(gdb) detach&lt;br /&gt;
(qdb) quit&lt;br /&gt;
$&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
(Note: the -tui option is really great to inspect the code... see [http://ftp.gnu.org/old-gnu/Manuals/gdb-5.1.1/html_chapter/gdb_19.html GDB Text User Interface])&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== IDE: Eclipse SW4STM32 ===&lt;br /&gt;
&lt;br /&gt;
GOOD NEWS: This officially supported Eclipse variant works out of the box with STM32CubeMX generated project! You simply need to register on that site, and you&#039;ll get a software package that should work:&lt;br /&gt;
&lt;br /&gt;
[http://www.st.com/content/st_com/en/products/development-tools/software-development-tools/stm32-software-development-tools/stm32-ides/sw4stm32.html SW4STM32 - System Workbench for STM32: free IDE on Windows, Linux and OS X ]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
(Side note: I don&#039;t know how well it works when you have another Eclipse installed on your system... currently testing this out.)&lt;br /&gt;
&lt;br /&gt;
=== IDE: Eclipse with GNU ARM Eclipse plugin ===&lt;br /&gt;
&lt;br /&gt;
To use Eclipse as an IDE for the STM32s, just install Eclipse and a the GNU ARM Eclipse Plugin.&lt;br /&gt;
&lt;br /&gt;
* Eclipse IDE for C/C++ (CDT). This can be installed manually or with your package manager.&lt;br /&gt;
* Eclipse Plugin: [https://gnuarmeclipse.github.io/ GNU ARM Eclipse]. - This can be done in the Eclipse Marketplace (under &#039;&#039;Help &amp;gt; Eclipse Marketplace&#039;&#039; (use the default options)).&lt;br /&gt;
* Create a new Eclipse project with the GNU ARM Eclipse (Choose STM32Fxxx C/C++ Project in the Wizard)&lt;br /&gt;
&lt;br /&gt;
With some minor adjustments in the settings (OpenOCD), the basic Blinky example that comes with the plugin should work out of the box, with a STLink v2 programmer. Code completion etc. works fine too.&lt;br /&gt;
&lt;br /&gt;
(/todo: show every step)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
But there&#039;s quite annoying problem with this workflow!:&lt;br /&gt;
&lt;br /&gt;
http://www.carminenoviello.com/en/2015/06/04/stm32-applications-eclipse-gcc-stcube/:&lt;br /&gt;
&amp;lt;blockquote&amp;gt;&lt;br /&gt;
Unfortunately, the plug-in author has updated just the template for STM32-F4 family to the more recently STM32Cube-F4 HAL framework from ST (which still supports only commercial IDE.....), leaving the other templates still based on the old Standard Peripheral Library, which is no longer supported by ST and STM32CubeMX tool used in my tutorial. This causes my instructions to be wrong for processor families different from STM32-F4. &lt;br /&gt;
&amp;lt;/blockquote&amp;gt;&lt;br /&gt;
&lt;br /&gt;
So, several manual setup steps will be required to get started with your own STM32 project. To goal is to configure the project in STM32CubeMX, and use up-to-date HAL code, and not the deprecated Standard Peripheral Library.&lt;br /&gt;
&lt;br /&gt;
The GNU ARM Eclipse plugin is great, but doesn&#039;t create projects with up-to-date code. So we need to modify the manually created GNU ARM Eclipse project. - I used a custom STM32F072C8 board, and all steps below assum this hardware. The steps would be slightly different for other hardware.&lt;br /&gt;
&lt;br /&gt;
([http://www.carminenoviello.com/en/2015/06/04/stm32-applications-eclipse-gcc-stcube This tutorial] was helping here...)&lt;br /&gt;
&lt;br /&gt;
* First create a new &#039;C Project&#039; in your Eclipse workspace.&lt;br /&gt;
* In Wizard slide &#039;&#039;C Project&#039;&#039;: Choose Executable &amp;gt; &#039;&#039;Hello World ARM Cortex-M C/C++ Project&#039;&#039; and give it a name (e.g. testSTM32_00). This will generate a generic ARM project instead of an STM32Fxxx one. - Then hit &#039;&#039;Next&#039;&#039;.&lt;br /&gt;
* In Wizard slide &#039;&#039;Target processor settings&#039;&#039;: Configure the target processor: For the STM32F072C8: Change the defaults to Flash size (kB): 64, RAM size (kB): 16, Use system calls: Freestanding (no POSIX system calls), Trace output: None (no trace output). - Then hit &#039;&#039;Next&#039;&#039;.&lt;br /&gt;
* In Wizard slide &#039;&#039;Folders&#039;&#039;: Change Vendor CMSIS name to stm32f0xx. - Then hit next.&lt;br /&gt;
* In Wizard slide &#039;&#039;Select Configurations&#039;&#039;: Leave as is. - Then hit &#039;&#039;Next&#039;&#039;.&lt;br /&gt;
* In Wizard slide &#039;&#039;Cross GNU ARM Toolchain&#039;&#039;: Select &#039;&#039;GNU Tools for ARM Embedded Processors (arm-none-eabi-gcc)&#039;&#039; and either choose the global, system wide toolchain (probably in /usr/bin) or enter the path to your custom one. - Then hit &#039;&#039;Finish&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
This will create a generic ARM project, which should build without errors (hit Ctrl+B). &lt;br /&gt;
&lt;br /&gt;
Next, we need to add the vendor specific HAL code by ST generated with STM32CubeMX and/or downloaded in a more specific firmware package (STM32CubeF0, STM32CubeF4 etc.).&lt;br /&gt;
&lt;br /&gt;
...&lt;br /&gt;
So, after configuring a generic Eclipse project, we&#039;re ready to modify it.&lt;br /&gt;
&lt;br /&gt;
* Configure and export an EWARM project in [http://www.st.com/web/en/catalog/tools/PF259242 STM32CubeMX] (with default settings).&lt;br /&gt;
&lt;br /&gt;
* Extract the [http://www.st.com/web/en/catalog/tools/PF260612 STM32CubeF0] archive. ([http://www.st.com/web/en/catalog/tools/PF260820 STM32CubeF1], [http://www.st.com/web/en/catalog/tools/PF260266 STM32CubeF2], [http://www.st.com/web/en/catalog/tools/PF260613 STMCubeF3], [http://www.st.com/web/en/catalog/tools/PF259243 STMCubeF4]).&lt;br /&gt;
&lt;br /&gt;
As a starting point, here&#039;s a bash script, that modifies the previously created Eclipse project:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
#!/usr/bin/env bash&lt;br /&gt;
&lt;br /&gt;
set -e&lt;br /&gt;
&lt;br /&gt;
#echo &amp;quot;Press CTRL+C to proceed.&amp;quot;&lt;br /&gt;
#trap &amp;quot;pkill -f &#039;sleep 1h&#039;&amp;quot; INT&lt;br /&gt;
#trap &amp;quot;set +x ; sleep 1h ; set -x&amp;quot; DEBUG&lt;br /&gt;
&lt;br /&gt;
# MODIFY THIS!&lt;br /&gt;
ECLIPSE_PROJECT=/run/media/rel/prc/code/workspace_testSTM32_01/testSTM32_00&lt;br /&gt;
STM32CUBEF0=/home/rel/src/STM32Cube_FW_F0_V1.4.0&lt;br /&gt;
STM32CUBEMX=/home/rel/Desktop/test_stm32cubemx_ewarm&lt;br /&gt;
&lt;br /&gt;
echo --------------------------------------------------------------------------------&lt;br /&gt;
echo Eclipse Project Initializer for STM32F072 Dev&lt;br /&gt;
echo --------------------------------------------------------------------------------&lt;br /&gt;
&lt;br /&gt;
echo&lt;br /&gt;
echo The script is using the following paths:&lt;br /&gt;
echo&lt;br /&gt;
echo Eclipse Project:&lt;br /&gt;
echo $ECLIPSE_PROJECT&lt;br /&gt;
echo&lt;br /&gt;
echo STM32Cube:&lt;br /&gt;
echo $STM32CUBEF0&lt;br /&gt;
echo&lt;br /&gt;
echo STM32CubeMX:&lt;br /&gt;
echo $STM32CUBEMX&lt;br /&gt;
&lt;br /&gt;
echo&lt;br /&gt;
echo -n &amp;quot;Do you want to proceed? [ENTER]&amp;quot;&lt;br /&gt;
read&lt;br /&gt;
&lt;br /&gt;
echo&lt;br /&gt;
echo Deleting files from eclipse project:&lt;br /&gt;
rm -fv $ECLIPSE_PROJECT/src/main.c&lt;br /&gt;
rm -fv $ECLIPSE_PROJECT/src/Timer.c&lt;br /&gt;
rm -fv $ECLIPSE_PROJECT/include/Timer.h&lt;br /&gt;
&lt;br /&gt;
rm -fv $ECLIPSE_PROJECT/system/include/cmsis/stm32f0xx.h&lt;br /&gt;
rm -fv $ECLIPSE_PROJECT/system/include/cmsis/system_stm32f0xx.h&lt;br /&gt;
&lt;br /&gt;
rm -fv $ECLIPSE_PROJECT/system/src/cmsis/system_stm32f0xx.c&lt;br /&gt;
rm -fv $ECLIPSE_PROJECT/system/src/cmsis/vectors_stm32f0xx.c&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
echo&lt;br /&gt;
echo Copying: ST HAL:&lt;br /&gt;
cp -rfv $STM32CUBEF0/Drivers/STM32F0xx_HAL_Driver/Src/* \&lt;br /&gt;
$ECLIPSE_PROJECT/system/src/stm32f0xx&lt;br /&gt;
&lt;br /&gt;
cp -rfv $STM32CUBEF0/Drivers/STM32F0xx_HAL_Driver/Inc/* \&lt;br /&gt;
$ECLIPSE_PROJECT/system/include/stm32f0xx&lt;br /&gt;
&lt;br /&gt;
cp -rfv $STM32CUBEF0/Drivers/CMSIS/Device/ST/STM32F0xx/Include/* \&lt;br /&gt;
$ECLIPSE_PROJECT/system/include/cmsis&lt;br /&gt;
&lt;br /&gt;
cp -fv $STM32CUBEF0/Drivers/CMSIS/Device/ST/STM32F0xx/Source/Templates/gcc/startup_stm32f072xb.s \&lt;br /&gt;
$ECLIPSE_PROJECT/system/src/cmsis/startup_stm32f072xb.S&lt;br /&gt;
&lt;br /&gt;
cp -fv $STM32CUBEF0/Drivers/CMSIS/Device/ST/STM32F0xx/Source/Templates/system_stm32f0xx.c \&lt;br /&gt;
$ECLIPSE_PROJECT/system/src/cmsis&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
# echo Copying: example project from STM32CubeF0:&lt;br /&gt;
#cp $STM32CUBEF0/Projects/STM32F072B-Discovery/Examples/GPIO/GPIO_IOToggle/Inc/* \&lt;br /&gt;
#$ECLIPSE_PROJECT/include&lt;br /&gt;
&lt;br /&gt;
#cp $STM32CUBEF0/Projects/STM32F072B-Discovery/Examples/GPIO/GPIO_IOToggle/Src/main.c \&lt;br /&gt;
#$ECLIPSE_PROJECT/src&lt;br /&gt;
&lt;br /&gt;
#cp $STM32CUBEF0/Projects/STM32F072B-Discovery/Examples/GPIO/GPIO_IOToggle/Src/stm32f0xx_it.c \&lt;br /&gt;
#$ECLIPSE_PROJECT/src&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
echo&lt;br /&gt;
echo Copying: example project from STM32CubeMX:&lt;br /&gt;
cp $STM32CUBEMX/Src/* $ECLIPSE_PROJECT/src&lt;br /&gt;
cp $STM32CUBEMX/Inc/* $ECLIPSE_PROJECT/include&lt;br /&gt;
&lt;br /&gt;
echo&lt;br /&gt;
echo Modifiying/fixing the memory map:&lt;br /&gt;
echo $ECLIPSE_PROJECT/ldscripts/mem.ld&lt;br /&gt;
sed -i &#039;s/FLASH (rx) : ORIGIN = 0x00000000/FLASH (rx) : ORIGIN = 0x08000000/g&#039; $ECLIPSE_PROJECT/ldscripts/mem.ld&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
echo&lt;br /&gt;
echo SUCCESS&lt;br /&gt;
echo&lt;br /&gt;
&lt;br /&gt;
echo&lt;br /&gt;
echo Now, exclude the following file from the Eclipse project manually:&lt;br /&gt;
ls $ECLIPSE_PROJECT/system/src/stm32f0xx/stm32f0xx_hal_msp_template.c&lt;br /&gt;
&lt;br /&gt;
echo&lt;br /&gt;
echo And add the following preprocessor constants to the C/C++ compiler settings in Eclipse:&lt;br /&gt;
echo USE_HAL_DRIVER&lt;br /&gt;
echo STM32F072xB&lt;br /&gt;
&lt;br /&gt;
echo&lt;br /&gt;
echo &amp;quot;And add the following config options to the GDB OpenOCD Debugging settings (in Run Configurations):&amp;quot;&lt;br /&gt;
echo &amp;quot;-f interface/stlink-v2.cfg -f target/stm32f0x.cfg&amp;quot;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This script needs to be modified according to your needs! (Currently is working for the STM32F072C8, and contains fixed paths! - Note that there minor inconsistencies in some of these ST projects. For example, all the provided STM32F072xB* files by ST work for both types of chips -- STM32F072x8 and STM32F072xB.)&lt;br /&gt;
&lt;br /&gt;
Like described in the script above, some minor manual changes need to be made in Eclipse after running the script.&lt;br /&gt;
&lt;br /&gt;
This should now be a good basis to start a new STM32 project.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Note that the GNU ARM Eclipse plugin always generates a Makefile for every project configuration (Debug / Release). It can be found in &amp;lt;project_folder&amp;gt;/Debug pr &amp;lt;project_folder&amp;gt;/Release respectively.&lt;br /&gt;
&lt;br /&gt;
==== Semihosting ====&lt;br /&gt;
&lt;br /&gt;
http://infocenter.arm.com/help/index.jsp?topic=/com.arm.doc.dui0471c/Bgbjjgij.html:&lt;br /&gt;
&amp;lt;blockquote&amp;gt;&lt;br /&gt;
What is semihosting?&lt;br /&gt;
&lt;br /&gt;
Semihosting is a mechanism that enables code running on an ARM target to communicate and use the Input/Output facilities on a host computer that is running a debugger.&lt;br /&gt;
&lt;br /&gt;
Examples of these facilities include keyboard input, screen output, and disk I/O.&lt;br /&gt;
&amp;lt;/blockquote&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The GNU ARM Eclipse plugin comes with a really bare-bone implementation of some semihosting print functions that can be used to print logs to the console right in Eclipse (over GDB, without using any additional serial/UART connection whatsoever).&lt;br /&gt;
&lt;br /&gt;
Since I&#039;d always create a project without Semihosting enabled in the GNU ARM Eclipse wizard, you can still easily enable it later on:&lt;br /&gt;
&lt;br /&gt;
The easiest way I&#039;ve found so far, is by defining those Preprocessor constants in the C/C++ Project settings (Projects &amp;gt; Properties &amp;gt; C/C++ Build &amp;gt; Settings &amp;gt; Cross ARM GNU C/C++ Compiler &amp;gt; Preprocessor):&lt;br /&gt;
* TRACE&lt;br /&gt;
* OS_USE_TRACE_SEMIHOSTING_STDOUT&lt;br /&gt;
&lt;br /&gt;
And then, by using the following function calls in your code to log stuff to the Eclipse console right away:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
trace_initialize(); // in fact not required&lt;br /&gt;
// (...)&lt;br /&gt;
static int i = 0;&lt;br /&gt;
trace_puts( &amp;quot;hello&amp;quot; );&lt;br /&gt;
trace_printf( &amp;quot;nr %d\n&amp;quot;, i++ );&lt;br /&gt;
HAL_Delay( 1000 );  &lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
These functions were implemented by the author of GNU ARM Eclipse [https://github.com/ilg-ul Liviu Ionescu], and can be looked up in these files:&lt;br /&gt;
* &amp;lt;eclipse_project&amp;gt;/system/include/arm/semihosting.h&lt;br /&gt;
* &amp;lt;eclipse_project&amp;gt;/system/include/diag/Trace.h&lt;br /&gt;
* &amp;lt;eclipse_project&amp;gt;/system/src/diag/Trace.c&lt;br /&gt;
* &amp;lt;eclipse_project&amp;gt;/system/src/diag/trace_impl.c&lt;br /&gt;
&lt;br /&gt;
An interesting comment in &#039;&#039;trace_impl.c:133&#039;&#039; says:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
// Semihosting is the other output channel that can be used for the trace&lt;br /&gt;
// messages. It comes in two flavours: STDOUT and DEBUG. The STDOUT channel&lt;br /&gt;
// is the equivalent of the stdout in POSIX and in most cases it is forwarded&lt;br /&gt;
// to the GDB server stdout stream. The debug channel is a separate&lt;br /&gt;
// channel. STDOUT is buffered, so nothing is displayed until a \n;&lt;br /&gt;
// DEBUG is not buffered, but can be slow.&lt;br /&gt;
//&lt;br /&gt;
// Choosing between semihosting stdout and debug depends on the capabilities&lt;br /&gt;
// of your GDB server, and also on specific needs. It is recommended to test&lt;br /&gt;
// DEBUG first, and if too slow, try STDOUT.&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Note that semihosting needs to be enabled in your Eclipse run configuration (it is by default), in the Startup tab &amp;gt; Enable ARM semihosting. This will tell GDB to use semihosting. Without enabling, calls to those trace_* functions will throw some kind of exception... and make the processor halt. I couldn&#039;t find out much yet about how this feature really works, somehow it uses a special BKPT instruction...&lt;br /&gt;
&lt;br /&gt;
Semihosting (OS_USE_TRACE_SEMIHOSTING_STDOUT) can also be used in &amp;quot;Release&amp;quot; builds, since the semihosted calls don&#039;t rely on debug symbols.&lt;br /&gt;
&lt;br /&gt;
=== IDE: Code::Blocks ===&lt;br /&gt;
&lt;br /&gt;
My favorite cross-platform IDE for C/C++ is Code::Blocks. - And luckily, it also works well for ARM development! After twiddling around with those confusing Eclipse settings, I&#039;ve almost forgot to try out and setup Code::Blocks.&lt;br /&gt;
&lt;br /&gt;
The steps required are bit unintuitive, but building and debugging projects with full auto-complete and indexer support works now.&lt;br /&gt;
&lt;br /&gt;
The advantages over using Eclipse:&lt;br /&gt;
* Faster GUI.&lt;br /&gt;
* Works with STM32CubeMX generated code.&lt;br /&gt;
* Uses just a plain/manually editable Makefile to build the project.&lt;br /&gt;
* Familiar C/C++ settings and more *transparent* project handling -&amp;gt; Edit + debug. Nothing more. Everything can be done by hand on a console too. No mysterious hidden helpers...&lt;br /&gt;
&lt;br /&gt;
I&#039;m still evaluating this workflow... But to get things up and running, you can do this:&lt;br /&gt;
&lt;br /&gt;
(Assuming you already have a working Makefile based project, e.g. [http://wiki.sgmk-ssam.ch/wiki/STM32_dev#STM32CubeMX_to_Makefile created with STM32CubeMX, like described above]).&lt;br /&gt;
&lt;br /&gt;
* Open Code::Blocks and create an &#039;&#039;&#039;empty&#039;&#039;&#039; project (&#039;&#039;File &amp;gt; New &amp;gt; Project &amp;gt; Empty project&#039;&#039;).&lt;br /&gt;
* Give it a name in the Wizard, and choose the &#039;&#039;GNU GCC Compiler for ARM&#039;&#039;, and save it. &lt;br /&gt;
* Copy all content of the Makefile project over to Code::Blocks project folder.&lt;br /&gt;
* Import all required source files into the Code::Blocks workspace (right click -&amp;gt; &#039;&#039;Add files recursively...&#039;&#039;). &lt;br /&gt;
* Check &#039;&#039;Project &amp;gt; Properties &amp;gt; Project settings &amp;gt; Makefile: This is a custom Makefile&#039;&#039;.&lt;br /&gt;
* Adjust the build settings in &#039;&#039;Project &amp;gt; Build options &amp;gt; &amp;quot;Make commands&amp;quot;&#039;&#039;. - This might either require you to change the Makefile (i.e. add Debug/Release targets), or the commands. - For simplicity&#039;s sake, just ignore those $make, $makefile variables and overwrite them with your actual commands (i.e.&#039;&#039;$make -f $makefile $target&#039;&#039; -&amp;gt; &#039;&#039;make all&#039;&#039;).&lt;br /&gt;
* &#039;&#039;Build&#039;&#039; the project and check in the &#039;&#039;Build log&#039;&#039; if there where any errors/warnings.&lt;br /&gt;
&lt;br /&gt;
So, if this is working now, try to edit a source file and see if those really useful auto-complete and jump to declaration/implementation features are working. - One caveat of using an external Makefile is that the IDE doesn&#039;t know the current settings. So, for example, #defines are not available, and syntax highlighting will not update automatically... So it might be worth it add settings manually at some point.&lt;br /&gt;
&lt;br /&gt;
Now, to get the flashing and debugging working, try this:&lt;br /&gt;
&lt;br /&gt;
* Go to the &#039;&#039;Settings &amp;gt; Debugger&#039;&#039; Settings.&lt;br /&gt;
* Add a new GDB debugger setting (hit &#039;&#039;Create Config&#039;&#039; and call it &#039;&#039;ARM OpenOCD&#039;&#039; for example).&lt;br /&gt;
* Change the &#039;&#039;Executable path&#039;&#039; according to your toolchains location, and check &#039;Do *not* run the debugee&#039;.&lt;br /&gt;
* Go to &#039;&#039;Projects &amp;gt; Properties &amp;gt; Debugger&#039;&#039;.&lt;br /&gt;
** Change the &amp;lt;Project&amp;gt; &#039;&#039;Remote connection&#039;&#039; settings to IP: 127.0.0.1 / Port: 3333.&lt;br /&gt;
** Go to the &amp;lt;Project&amp;gt; &#039;&#039;Additional GDB commands&#039;&#039; tab. And enter those commands into the &#039;&#039;After connection&#039;&#039; box (change filename!):&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
monitor halt&lt;br /&gt;
load ./build/test.elf&lt;br /&gt;
file ./build/test.elf&lt;br /&gt;
monitor sleep 1000&lt;br /&gt;
monitor reset&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
To not run the program automatically, remove the last two commands. Then you need to &#039;&#039;Start / Continue&#039;&#039; the program twice, but you&#039;ll catch the first breakpoint you&#039;ve set!&lt;br /&gt;
* Choose &#039;&#039;Debug &amp;gt; Active Debuggers &amp;gt; GDB/CDB Debugger: ARM OpenOCD&#039;&#039;.&lt;br /&gt;
* Start OpenOCD in a terminal. (Described above).&lt;br /&gt;
* Start debugging by pressing the red arrow (Run / continue) in the debugging toolbar.&lt;br /&gt;
&lt;br /&gt;
The steps are the same as the ones in [http://www.hackvandedam.nl/blog/?p=707 this tutorial &#039;&#039;&#039;with screenshots&#039;&#039;&#039;].&lt;br /&gt;
&lt;br /&gt;
=== stlink ===&lt;br /&gt;
&lt;br /&gt;
[https://github.com/texane/stlink stlink] is a command line tool for programming, inspecting and debugging the STM32 microcontrollers. It also used internally by OpenOCD (I think). - It comes with several small programs (st-flash, st-info, st-term, st-util) that can come in handy while working with the STM32 micros.&lt;br /&gt;
&lt;br /&gt;
There&#039;s a tutorial:&lt;br /&gt;
https://github.com/texane/stlink/blob/master/doc/tutorial/tutorial.pdf&lt;br /&gt;
&lt;br /&gt;
Some useful things I&#039;ve discovered:&lt;br /&gt;
&lt;br /&gt;
Just run st-util can Ctrl-C again to see all relevant uC properties:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
$ st-util&lt;br /&gt;
2016-01-29T13:06:25 INFO src/stlink-common.c: Loading device parameters....&lt;br /&gt;
2016-01-29T13:06:25 INFO src/stlink-common.c: Device connected is: F07x device, id 0x20016448&lt;br /&gt;
2016-01-29T13:06:25 INFO src/stlink-common.c: SRAM size: 0x4000 bytes (16 KiB), Flash: 0x10000 bytes (64 KiB) in pages of 2048 bytes&lt;br /&gt;
2016-01-29T13:06:25 INFO gdbserver/gdb-server.c: Chip ID is 00000448, Core ID is  0bb11477.&lt;br /&gt;
2016-01-29T13:06:25 INFO gdbserver/gdb-server.c: Target voltage is 3554 mV.&lt;br /&gt;
2016-01-29T13:06:25 INFO gdbserver/gdb-server.c: Listening at *:4242...&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Or with st-info:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
$ st-info &lt;br /&gt;
st-info --flash&lt;br /&gt;
st-info --sram&lt;br /&gt;
st-info --descr&lt;br /&gt;
st-info --pagesize&lt;br /&gt;
st-info --chipid&lt;br /&gt;
$ st-info --flash&lt;br /&gt;
0x10000&lt;br /&gt;
$ st-info --sram&lt;br /&gt;
0x4000&lt;br /&gt;
$ st-info --descr&lt;br /&gt;
F07x device&lt;br /&gt;
$ st-info --pagesize&lt;br /&gt;
0x800&lt;br /&gt;
$ st-info --chipid&lt;br /&gt;
0x0448&lt;br /&gt;
&lt;br /&gt;
$ echo `st-info --sram | xargs -I@ printf &amp;quot;%d/1024\n&amp;quot; @ | bc`kB RAM&lt;br /&gt;
16kB RAM&lt;br /&gt;
$ echo `st-info --flash | xargs -I@ printf &amp;quot;%d/1024\n&amp;quot; @ | bc`kB FLASH&lt;br /&gt;
64kB FLASH&lt;br /&gt;
&lt;br /&gt;
$ for a in sram flash pagesize; do echo `st-info --$a | xargs -I@ printf &amp;quot;%d/1024\n&amp;quot; @ | bc`kb $a; done&lt;br /&gt;
16kb sram&lt;br /&gt;
64kb flash&lt;br /&gt;
2kb pagesize&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Links ===&lt;br /&gt;
&lt;br /&gt;
==== Tools ====&lt;br /&gt;
* [https://gnuarmeclipse.github.io/ GNU ARM Eclipse]: [https://gnuarmeclipse.github.io/eclipse/workspace/preferences/ workspace_preferences], [http://gnuarmeclipse.github.io/toolchain/path/ toolchain_path], [http://gnuarmeclipse.github.io/eclipse/project/portability/ project_portability]&lt;br /&gt;
&lt;br /&gt;
==== Tutorials ====&lt;br /&gt;
* Great introduction: [http://www.triplespark.net/elec/pdev/arm/stm32.html Programming STM32 F2, F4 ARMs under Linux: A Tutorial from Scratch]&lt;br /&gt;
* STM32Cube to GNU ARM Eclipse tips: http://www.carminenoviello.com/en/2015/06/04/stm32-applications-eclipse-gcc-stcube/&lt;br /&gt;
* Micro Python on STM32F4-Discovery: http://gpio.kaltpost.de/?p=2082&lt;br /&gt;
* Logs: https://hackaday.io/project/4277/logs?page=2&lt;br /&gt;
* Code::Blocks tutorial: http://www.hackvandedam.nl/blog/?p=707&lt;br /&gt;
* Eclipse tutorial: http://www.carminenoviello.com/en/2015/06/04/stm32-applications-eclipse-gcc-stcube&lt;br /&gt;
* http://sigalrm.blogspot.ch/2013/12/using-ccm-memory-on-stm32.html&lt;br /&gt;
* http://stm32f4-discovery.com/2014/08/stm32f4-external-interrupts-tutorial/&lt;br /&gt;
* ...&lt;br /&gt;
&lt;br /&gt;
==== Projects / Demos / Code ====&lt;br /&gt;
* MrBlueXav&#039;s Synths: https://github.com/MrBlueXav&lt;br /&gt;
* cliffle&#039;s VGA stuff: https://github.com/cbiffle/m4vgalib-demos, http://cliffle.com/article/2015/06/05/introducing-glitch/&lt;br /&gt;
* ESPruino code: https://github.com/espruino/Espruino -&amp;gt; STM32F401CDU6&lt;br /&gt;
* STM32F4 Audio Codec Board: http://ebrombaugh.studionebula.com/synth/stm32f4_codec/&lt;br /&gt;
* ESPRUINO: http://www.espruino.com/ReferenceSTM32F4DISCOVERY&lt;br /&gt;
* micropython: https://github.com/micropython/micropython&lt;br /&gt;
* STM32F4 DIY: http://mikrocontroller.bplaced.net/wordpress/?page_id=1482&lt;br /&gt;
* STM32F4 overclocking: http://sigalrm.blogspot.ch/2014/01/overclocking-stm32f4.html&lt;br /&gt;
* thermal camera: http://www.theresistornetwork.com/2014/11/flir-lepton-thermal-imaging-sensor.html&lt;br /&gt;
* STM32F7: http://hackaday.com/2015/06/26/new-part-day-stm32f7-an-arm-cortex-m7/&lt;br /&gt;
* Karsten Schmidt: http://workshop.thi.ng/ [https://soundcloud.com/forthcharlie soundcloud] https://github.com/thi-ng/ws-ldn-4 https://github.com/thi-ng/ws-ldn-3 http://asm.thi.ng/&lt;br /&gt;
* Peridrummmm Demo: http://www.pouet.net/prod.php?which=59095 with sources: http://aka-san.halcy.de/revision2012/peridiummmm-src.zip&lt;br /&gt;
* Andy&#039;s Workshop: http://andybrown.me.uk/&lt;br /&gt;
* axoloti: http://axoloti.com/&lt;br /&gt;
&lt;br /&gt;
==== Libraries ====&lt;br /&gt;
* libopencm3 http://libopencm3.org/wiki/Main_Page&lt;br /&gt;
* list of libs: http://mikrocontroller.bplaced.net/wordpress/?page_id=2736&lt;br /&gt;
&lt;br /&gt;
==== OS ====&lt;br /&gt;
* FreeRTOS: http://www.freertos.org/index.html&lt;br /&gt;
* Embedded Linux on STM32: https://github.com/EmcraftSystems&lt;br /&gt;
* ChibiOS: http://www.chibios.org/dokuwiki/&lt;br /&gt;
&lt;br /&gt;
==== General ====&lt;br /&gt;
* ARM Related Books: http://www.arm.com/support/resources/arm-books/&lt;br /&gt;
* STM32 Overview http://www.st.com/web/en/catalog/mmc/FM141/SC1169?sc=stm32&lt;br /&gt;
* mbed https://en.wikipedia.org/wiki/Mbed&lt;br /&gt;
* CMSIS: http://www.keil.com/pack/doc/cmsis/Core/html/index.html&lt;br /&gt;
&lt;br /&gt;
== Hardware ==&lt;br /&gt;
&lt;br /&gt;
All about hardware and hardware tools for STM32 dev. Chips, programmers etc.&lt;br /&gt;
&lt;br /&gt;
=== ST-Link V2 Programmer ===&lt;br /&gt;
&lt;br /&gt;
There are two popular ST-Link V2 Progammers on the market. They have a different pinout but work both well like described above.&lt;br /&gt;
&lt;br /&gt;
[[File:ST-LinkV2_pinout_01.jpg]]&lt;br /&gt;
&lt;br /&gt;
Alternatively, STM32Discovery/[http://jeelabs.org/book/1547a/index.html Nucleo boards too can be used as SWD programmers].&lt;br /&gt;
&lt;br /&gt;
Luckily, only 4 pins have to be used to program and debug the target!&lt;br /&gt;
To find out more about this protocol, have a look into [http://www.arm.com/products/system-ip/debug-trace/coresight-soc-components/serial-wire-debug.php Serial Debug Wire (SWD)] as an alternative to JTAG.&lt;br /&gt;
&lt;br /&gt;
Connect to following pins of the programmer to the corresponding pins on the PCB:&lt;br /&gt;
&lt;br /&gt;
* V3V&lt;br /&gt;
* GND&lt;br /&gt;
* SWCLK&lt;br /&gt;
* SWDIO&lt;br /&gt;
&lt;br /&gt;
-&amp;gt; NRST can be important too on some STM32 chips!&lt;br /&gt;
&lt;br /&gt;
Remember: These are &#039;&#039;&#039;not&#039;&#039;&#039; the [http://www.st.com/web/catalog/tools/FM146/CL1984/SC724/SS1677/PF251168 official ST-Link V2 Programmers], sold by ST.&lt;br /&gt;
&lt;br /&gt;
== Projects ==&lt;br /&gt;
&lt;br /&gt;
STM32 based projects.&lt;br /&gt;
&lt;br /&gt;
=== STM32basic ===&lt;br /&gt;
&lt;br /&gt;
STM32basic is a test board to see how STM32 chips can be used in DIY circuits.&lt;br /&gt;
&lt;br /&gt;
==== STM32basic rev0.01 ====&lt;br /&gt;
&lt;br /&gt;
An initial list of tests:&lt;br /&gt;
&lt;br /&gt;
* JTAG: See how we can program the thing. Do we need all JTAG pins? Or only the SWD pins? What about reset? - Do the cheapo Chinese STLink V2 programmer really work?&lt;br /&gt;
* Basic I/O: LED and push button.&lt;br /&gt;
* U(S)ART: Check whether it&#039;s possible to hook up an FTDI to send/receive characters to/from the STM32basic?&lt;br /&gt;
* BOOT0/1: What about those boot modes?&lt;br /&gt;
* Power Usage : 3V3 Regulator: ..&lt;br /&gt;
&lt;br /&gt;
[[File:STM32basic_pcb1b.jpg]]&lt;br /&gt;
&lt;br /&gt;
Board at OSH Park:&amp;lt;br /&amp;gt;&lt;br /&gt;
https://oshpark.com/shared_projects/kCD7Yr0A&lt;br /&gt;
&lt;br /&gt;
KiCad project and everything else:&amp;lt;br /&amp;gt;&lt;br /&gt;
Remark: this has been made in hurry and is just a test:&amp;lt;br /&amp;gt;&lt;br /&gt;
http://0rel.com/prj/STM32basic/STM32basic_rev0.01.zip&lt;br /&gt;
&lt;br /&gt;
[[File:Stm32basic1.jpg]]&lt;br /&gt;
&lt;br /&gt;
So far, the tests have been working ok.&lt;br /&gt;
&lt;br /&gt;
* STLink V2 programmers seem to work fine, and only require 2 pins + VCC/GND! SWDIO and SWCLK, that&#039;s it! For programming and on-chip debugging.&lt;br /&gt;
* I/O works as well. External interrupts can be configured.&lt;br /&gt;
* UART works, but I have not yet tested it with a proper code. It was working with some echo snippet I&#039;ve found somewhere.&lt;br /&gt;
* Power usage is low. ~15 mA at 3.3 V.&lt;br /&gt;
* BOOT0 jumper has to be set (connected to ground) in order to run code... - Other boot modes have not been tested yet. More tests are needed there... What are the other available boot modes, what about those built-in boot loaders?&lt;br /&gt;
&lt;br /&gt;
However, the board has several flaws:&lt;br /&gt;
* 1.27 mm pin-pitch headers cannot be arranged like that (GPIOs). They need to be further apart to make sockets/headers fit.&lt;br /&gt;
* 3V3 LDO doesn&#039;t make much sense like this. Add add a buck/boost converter. Also remove 5V label.&lt;br /&gt;
* This BOOT0 jumper isn&#039;t nice like this...&lt;br /&gt;
* Remove unnecessary JTAG pins. SWD only.&lt;br /&gt;
* Remove unnecessary USART pins.&lt;br /&gt;
* Add crystal.&lt;br /&gt;
* Add USB plug.&lt;br /&gt;
&lt;br /&gt;
Probably, this will not be remade, since it was enough for a test. I&#039;d like to make a very basic USB touch device next.&lt;br /&gt;
&lt;br /&gt;
==== STM32basic Eclipse project ====&lt;br /&gt;
&lt;br /&gt;
Test project to see if GPIOs with External interrupts and semi hosting works. Sloppy and not cleaned up yet...&amp;lt;br /&amp;gt;&lt;br /&gt;
http://0rel.com/prj/STM32basic/testSTM32F072_interrupt_test0.zip&lt;br /&gt;
&lt;br /&gt;
Note: Eclipse projects can be imported in an existing or new workspace with: &#039;&#039;File &amp;gt; Import &amp;gt; General &amp;gt; Existing Projects into Workspace&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
=== todo ===&lt;br /&gt;
&lt;br /&gt;
* I2C peripherals&lt;br /&gt;
* I2S peripherals&lt;br /&gt;
* SPI peripherals&lt;br /&gt;
* touch&lt;br /&gt;
* usb&lt;br /&gt;
* external memory (sram, flash, eeprom...) -&amp;gt; RTOS / Linux / ChibiOS? (similar to this http://hforsten.com/making-embedded-linux-computer.html)?&lt;br /&gt;
.....&lt;/div&gt;</summary>
		<author><name>0rel</name></author>
	</entry>
	<entry>
		<id>https://wiki.sgmk-ssam.ch/index.php?title=STM32_dev&amp;diff=6571</id>
		<title>STM32 dev</title>
		<link rel="alternate" type="text/html" href="https://wiki.sgmk-ssam.ch/index.php?title=STM32_dev&amp;diff=6571"/>
		<updated>2016-10-15T16:27:22Z</updated>

		<summary type="html">&lt;p&gt;0rel: /* IDE: Eclipse SW4STM32 */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Overview ==&lt;br /&gt;
&lt;br /&gt;
Notes on STM32 microcontrollers and on how to get them working in DIY projects.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;/// this is a work in progress draft ///&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
== Software ==&lt;br /&gt;
&lt;br /&gt;
All about software tools for STM32 dev. Development environments, compilers, debuggers, IDEs etc.&lt;br /&gt;
&lt;br /&gt;
=== ARM toolchains ===&lt;br /&gt;
&lt;br /&gt;
==== gcc-arm-embedded Toolchain ====&lt;br /&gt;
&lt;br /&gt;
Install the GCC arm-none-eabi toolchain for your OS. On Arch Linux this can be done with the package manager:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
$ sudo pacman -S arm-none-eabi-gcc arm-none-eabi-gdb arm-none-eabi-binutils arm-none-eabi-newlib&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Alternatively, it can be built from scratch, to have all tools and their sources in one place.&lt;br /&gt;
&lt;br /&gt;
* Download the sources here: https://launchpad.net/gcc-arm-embedded/+download&lt;br /&gt;
* Install the &#039;&#039;common tools and libraries&#039;&#039; like described in the [https://launchpadlibrarian.net/231136652/How-to-build-toolchain.pdf documentation].&lt;br /&gt;
* Build the toolchain. - On my system, the following steps were required:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
$ cp gcc-arm-none-eabi-5_2-2015q4-20151219-src.tar.bz2 ~/toolchain&lt;br /&gt;
$ cd ~/toolchain&lt;br /&gt;
$ tar -xjf gcc-arm-none-eabi-5_2-2015q4-20151219-src.tar.bz2&lt;br /&gt;
$ cd ./gcc-arm-none-eabi-5_2-2015q4-20151219/src&lt;br /&gt;
$ find -name &#039;*.tar.*&#039; | xargs -I% tar -xf %&lt;br /&gt;
$ cd ..&lt;br /&gt;
$ ./build-prerequisites.sh --skip_steps=mingw32&lt;br /&gt;
$ ./build-toolchain.sh --skip_steps=mingw32,manual&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
Note that those &#039;&#039;skip_steps&#039;&#039; options were required in my case.&lt;br /&gt;
&lt;br /&gt;
==== Linaro Toolchain ====&lt;br /&gt;
&lt;br /&gt;
The [https://en.wikipedia.org/wiki/Linaro Linaro] toolchain seems to be famous as well.&lt;br /&gt;
&lt;br /&gt;
Install it with your package manager if available, or build it yourself:&amp;lt;br /&amp;gt;&lt;br /&gt;
https://wiki.linaro.org/WorkingGroups/ToolChain&amp;lt;br /&amp;gt;&lt;br /&gt;
https://wiki.linaro.org/WorkingGroups/ToolChain/FAQ&lt;br /&gt;
&lt;br /&gt;
==== devkitpro devkitARM toolchain ====&lt;br /&gt;
&lt;br /&gt;
Another gcc variant: http://devkitpro.org/&lt;br /&gt;
&lt;br /&gt;
Used in the homebrew scene for game consoles like the GP32, Nintendo (3)DS and GBA. It can [http://www.pouet.net/prod.php?which=59095 apparently] also be used for the STM32s as well! And generates probably more optimized binaries?&lt;br /&gt;
&lt;br /&gt;
(On Arch it can be installed from the AUR: https://aur.archlinux.org/packages/devkitarm-bin/ . But beware, the compiler, link, binutils have all the same name as the ones from the official GCC arm-none-eabi toolchain. So it&#039;s probably better to install it manually.)&lt;br /&gt;
&lt;br /&gt;
=== STM32CubeMX on Linux ===&lt;br /&gt;
&lt;br /&gt;
STM32CubeMX is a code generator for STM32 micros that can come in handy when you start a new project. It generates all the necessary init and HAL code, library and custom pin mux code for your specific MCU.&lt;br /&gt;
&lt;br /&gt;
Unfortunately, it comes as a Windows EXE and ST doesn&#039;t mention that it actually is a Java application. Luckily it can be installed on Linux by hand (thanks to 5V Joe&#039;s great note [http://fivevolt.blogspot.ch/2014/07/installing-stm32cubemx-on-linux.html there]):&lt;br /&gt;
&lt;br /&gt;
* Download [http://www.st.com/web/catalog/tools/FM147/CL1794/SC961/SS1743/PF259242?icmp=stm32cubemx_pron_prcube_feb2014&amp;amp;sc=stm32cube-pr STM32CubeMX].&lt;br /&gt;
* Install the application (tested in January 2016):&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
$ unzip SetupSTM32CubeMX-4.12.0.exe -d stm32cube&lt;br /&gt;
$ cd stm32cube&lt;br /&gt;
$ java -cp . com.izforge.izpack.installer.bootstrap.Installer&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
* Run:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
$ cd &amp;lt;install_dir&amp;gt;&lt;br /&gt;
$ unzip STM32CubeMX.exe&lt;br /&gt;
$ java -cp . com.st.microxplorer.maingui.STM32CubeMX&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== STM32CubeMX to Makefile ===&lt;br /&gt;
&lt;br /&gt;
For whatever reason, STM32CubeMX does not export plain GCC/Makefiles along with the initialization code. But instead, it supports an unpopular IDE called [http://www.st.com/web/catalog/tools/FM147/CL1794/SC961/SS1533/PF261797 SW4STM32], which is also based on free GNU tools. So after installing STM32CubeMX, these are the steps to get the GCC/Makefile project running:&lt;br /&gt;
&lt;br /&gt;
* Get this nice Python script by [http://www.ba0sh1.com/ Baoshi] to generate the Makefile for an exported SW4STM32 project:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
$ git clone https://github.com/baoshi/CubeMX2Makefile&lt;br /&gt;
$ cd CubeMX2Makefile&lt;br /&gt;
$ python2 CubeMX2Makefile.py &amp;lt;your_sw4stm32_prject_dir&amp;gt;&lt;br /&gt;
$ cd &amp;lt;your_sw4stm32_prject_dir&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* Fix a tiny bug in the generated Makefile (tested in January 2016). More can be read [http://www.ba0sh1.com/stm32cubemx-gcc-makefile/ here].&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
$ grep __weak Makefile &lt;br /&gt;
C_DEFS = -D__weak=&amp;quot;__attribute__\(\(weak\)\)&amp;quot; -D__packed=&amp;quot;__attribute__\(\(__packed__\)\)&amp;quot; -DUSE_HAL_DRIVER -DSTM32F072xB&lt;br /&gt;
$ sed -i &#039;s/\\(\\(weak\\)\\)/((weak))/g&#039; Makefile &lt;br /&gt;
$ sed -i &#039;s/\\(\\(packed\\)\\)/((packed))/g&#039; Makefile &lt;br /&gt;
$ grep __weak Makefile &lt;br /&gt;
C_DEFS = -D__weak=&amp;quot;__attribute__((weak))&amp;quot; -D__packed=&amp;quot;__attribute__\(\(__packed__\)\)&amp;quot; -DUSE_HAL_DRIVER -DSTM32F072xB&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* Then build the binary:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
$ make&lt;br /&gt;
(...)&lt;br /&gt;
arm-none-eabi-size build/STM32F072RBT6.elf&lt;br /&gt;
   text	   data	    bss	    dec	    hex	filename&lt;br /&gt;
   4568	     12	   1572	   6152	   1808	build/STM32F072RBT6.elf&lt;br /&gt;
arm-none-eabi-objcopy -O ihex build/STM32F072RBT6.elf build/STM32F072RBT6.hex&lt;br /&gt;
arm-none-eabi-objcopy -O binary -S build/STM32F072RBT6.elf build/STM32F072RBT6.bin	&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Flash ===&lt;br /&gt;
&lt;br /&gt;
Install OpenOCD and STLINK. On Arch Linux:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
sudo pacman -S stlink openocd&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now [http://openocd.org/ OpenOCD] and (arm-none-eabi-)gdb can be used to program and debug the MCU. All discovery boards also come with an ST-LINK/V2 programmer right built in speaking over USB to the host and over JTAG/[http://www.arm.com/products/system-ip/debug-trace/coresight-soc-components/serial-wire-debug.php SWD] to the target (note: only two pins are actually required for SWD debugging/flashing (SWDIO/SWCLK), but that for later (see also [[#Hardware]])). STM32 Discovery Boards should show up in the lsusb list like that:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
$ lsusb&lt;br /&gt;
(...)&lt;br /&gt;
Bus 003 Device 006: ID 0483:3748 STMicroelectronics ST-LINK/V2&lt;br /&gt;
(...)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
OpenOCD can now act as a &amp;quot;middleman&amp;quot; between the ST-LINK programmer and the user. As a server on the host, to which you can connect with telnet and GDB.&lt;br /&gt;
&lt;br /&gt;
To configure OpenOCD, put a configuration file called opencd.cfg into the project folder and start OpenOCD. While working on the project, let it run there in the foreground to see all the logs...&lt;br /&gt;
&lt;br /&gt;
For the [http://www.st.com/st-web-ui/static/active/jp/resource/technical/document/user_manual/DM00099401.pdf STM32 F072 Discovery] board this should work, for example:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
$ cd &amp;lt;project_directory&amp;gt;&lt;br /&gt;
$ echo &amp;quot;source [find board/stm32f0discovery.cfg]&amp;quot; &amp;gt; openocd.cfg&lt;br /&gt;
$ openocd&lt;br /&gt;
Open On-Chip Debugger 0.9.0 (2015-05-19-13:50)&lt;br /&gt;
Licensed under GNU GPL v2&lt;br /&gt;
For bug reports, read&lt;br /&gt;
	http://openocd.org/doc/doxygen/bugs.html&lt;br /&gt;
Info : The selected transport took over low-level target control. The results might differ compared to plain JTAG/SWD&lt;br /&gt;
adapter speed: 1000 kHz&lt;br /&gt;
adapter_nsrst_delay: 100&lt;br /&gt;
none separate&lt;br /&gt;
srst_only separate srst_nogate srst_open_drain connect_deassert_srst&lt;br /&gt;
Info : Unable to match requested speed 1000 kHz, using 950 kHz&lt;br /&gt;
Info : Unable to match requested speed 1000 kHz, using 950 kHz&lt;br /&gt;
Info : clock speed 950 kHz&lt;br /&gt;
Info : STLINK v2 JTAG v17 API v2 SWIM v0 VID 0x0483 PID 0x3748&lt;br /&gt;
Info : using stlink api v2&lt;br /&gt;
Info : Target voltage: 2.896454&lt;br /&gt;
Info : stm32f0x.cpu: hardware has 4 breakpoints, 2 watchpoints&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
(Don&#039;t worry about those warnings about the wrong clock speed for now...)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
In order to program the flash, connect to OpenOCD via telnet in another terminal:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
$ telnet 127.0.0.1 4444&lt;br /&gt;
Trying 127.0.0.1...&lt;br /&gt;
Connected to 127.0.0.1.&lt;br /&gt;
Escape character is &#039;^]&#039;.&lt;br /&gt;
Open On-Chip Debugger&lt;br /&gt;
&amp;gt; &lt;br /&gt;
&amp;gt; reset halt&lt;br /&gt;
target state: halted&lt;br /&gt;
target halted due to debug-request, current mode: Thread &lt;br /&gt;
xPSR: 0xc1000000 pc: 0x080014d0 msp: 0x20004000&lt;br /&gt;
&amp;gt; flash probe 0&lt;br /&gt;
device id = 0x20016448&lt;br /&gt;
flash size = 128kbytes&lt;br /&gt;
flash &#039;stm32f1x&#039; found at 0x08000000&lt;br /&gt;
&amp;gt; flash write_image erase build/STM32F072RBT6.elf&lt;br /&gt;
auto erase enabled&lt;br /&gt;
target state: halted&lt;br /&gt;
target halted due to breakpoint, current mode: Thread &lt;br /&gt;
xPSR: 0x61000000 pc: 0x2000003a msp: 0x20004000&lt;br /&gt;
wrote 6144 bytes from file build/STM32F072RBT6.elf in 0.503961s (11.906 KiB/s)&lt;br /&gt;
&amp;gt; reset run&lt;br /&gt;
&amp;gt; exit&lt;br /&gt;
Connection closed by foreign host.&lt;br /&gt;
$&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This should write the binary to the flash memory and start the program.&lt;br /&gt;
Of course, all those steps can be automated further and integrated into an IDE, but that&#039;s for later...&lt;br /&gt;
&lt;br /&gt;
To program the STM32F0Discovery board for example, this can be used to just flash the chip:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
$ openocd -f board/stm32f0discovery.cfg -c &amp;quot;program build/STM32F072RBT6.elf verify reset exit&amp;quot; &lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
To program a custom board for example with the STM32F0x chip, a command like this can be used:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
$ openocd -f interface/stlink-v2.cfg -f target/stm32f0x.cfg -c &amp;quot;program testSTM32F072_interrupt_test0.elf verify reset exit&amp;quot;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
To make things more convenient, add a new target &#039;&#039;flash&#039;&#039; to the Makefile with this command, and you can simply run &#039;&#039;make flash&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The exported main.c from STM32CubeMX was only slightly modified to let the user LEDs flash and react to the user pushbutton:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
******************************************************************************&lt;br /&gt;
* main.c *&lt;br /&gt;
******************************************************************************&lt;br /&gt;
&lt;br /&gt;
#include &amp;quot;stm32f0xx_hal.h&amp;quot;&lt;br /&gt;
&lt;br /&gt;
void SystemClock_Config(void);&lt;br /&gt;
static void MX_GPIO_Init(void);&lt;br /&gt;
&lt;br /&gt;
int main(void)&lt;br /&gt;
{&lt;br /&gt;
  /* Reset of all peripherals, Initializes the Flash interface and the Systick. */&lt;br /&gt;
  HAL_Init();&lt;br /&gt;
&lt;br /&gt;
  /* Configure the system clock */&lt;br /&gt;
  SystemClock_Config();&lt;br /&gt;
&lt;br /&gt;
  /* Initialize all configured peripherals */&lt;br /&gt;
  MX_GPIO_Init();&lt;br /&gt;
&lt;br /&gt;
  while (1)&lt;br /&gt;
  {&lt;br /&gt;
    uint32_t delay;&lt;br /&gt;
    if( HAL_GPIO_ReadPin( GPIOA, GPIO_PIN_0 ) == GPIO_PIN_SET )&lt;br /&gt;
      delay = 50;&lt;br /&gt;
    else&lt;br /&gt;
      delay = 250;&lt;br /&gt;
&lt;br /&gt;
    HAL_GPIO_TogglePin( GPIOC, GPIO_PIN_9 );&lt;br /&gt;
    HAL_Delay( delay );&lt;br /&gt;
    HAL_GPIO_TogglePin( GPIOC, GPIO_PIN_8 );&lt;br /&gt;
    HAL_Delay( delay );&lt;br /&gt;
    HAL_GPIO_TogglePin( GPIOC, GPIO_PIN_7 );&lt;br /&gt;
    HAL_Delay( delay );&lt;br /&gt;
    HAL_GPIO_TogglePin( GPIOC, GPIO_PIN_6 );&lt;br /&gt;
    HAL_Delay( delay );&lt;br /&gt;
&lt;br /&gt;
  }&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
/** System Clock Configuration&lt;br /&gt;
*/&lt;br /&gt;
void SystemClock_Config(void)&lt;br /&gt;
{&lt;br /&gt;
&lt;br /&gt;
  RCC_OscInitTypeDef RCC_OscInitStruct;&lt;br /&gt;
  RCC_ClkInitTypeDef RCC_ClkInitStruct;&lt;br /&gt;
&lt;br /&gt;
  RCC_OscInitStruct.OscillatorType = RCC_OSCILLATORTYPE_HSI;&lt;br /&gt;
  RCC_OscInitStruct.HSIState = RCC_HSI_ON;&lt;br /&gt;
  RCC_OscInitStruct.HSICalibrationValue = 16;&lt;br /&gt;
  RCC_OscInitStruct.PLL.PLLState = RCC_PLL_NONE;&lt;br /&gt;
  HAL_RCC_OscConfig(&amp;amp;RCC_OscInitStruct);&lt;br /&gt;
&lt;br /&gt;
  RCC_ClkInitStruct.ClockType = RCC_CLOCKTYPE_SYSCLK;&lt;br /&gt;
  RCC_ClkInitStruct.SYSCLKSource = RCC_SYSCLKSOURCE_HSI;&lt;br /&gt;
  RCC_ClkInitStruct.AHBCLKDivider = RCC_SYSCLK_DIV1;&lt;br /&gt;
  RCC_ClkInitStruct.APB1CLKDivider = RCC_HCLK_DIV1;&lt;br /&gt;
  HAL_RCC_ClockConfig(&amp;amp;RCC_ClkInitStruct, FLASH_LATENCY_0);&lt;br /&gt;
&lt;br /&gt;
  HAL_SYSTICK_Config(HAL_RCC_GetHCLKFreq()/1000);&lt;br /&gt;
&lt;br /&gt;
  HAL_SYSTICK_CLKSourceConfig(SYSTICK_CLKSOURCE_HCLK);&lt;br /&gt;
&lt;br /&gt;
  /* SysTick_IRQn interrupt configuration */&lt;br /&gt;
  HAL_NVIC_SetPriority(SysTick_IRQn, 0, 0);&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
/** Configure pins as&lt;br /&gt;
        * Analog&lt;br /&gt;
        * Input&lt;br /&gt;
        * Output&lt;br /&gt;
        * EVENT_OUT&lt;br /&gt;
        * EXTI&lt;br /&gt;
*/&lt;br /&gt;
void MX_GPIO_Init(void)&lt;br /&gt;
{&lt;br /&gt;
&lt;br /&gt;
  GPIO_InitTypeDef GPIO_InitStruct;&lt;br /&gt;
&lt;br /&gt;
  /* GPIO Ports Clock Enable */&lt;br /&gt;
  __GPIOA_CLK_ENABLE();&lt;br /&gt;
  __GPIOC_CLK_ENABLE();&lt;br /&gt;
&lt;br /&gt;
  /*Configure GPIO pin : PA0 */&lt;br /&gt;
  GPIO_InitStruct.Pin = GPIO_PIN_0;&lt;br /&gt;
  GPIO_InitStruct.Mode = GPIO_MODE_INPUT;&lt;br /&gt;
  GPIO_InitStruct.Pull = GPIO_NOPULL;&lt;br /&gt;
  HAL_GPIO_Init(GPIOA, &amp;amp;GPIO_InitStruct);&lt;br /&gt;
&lt;br /&gt;
  /*Configure GPIO pins : PC6 PC7 PC8 PC9 */&lt;br /&gt;
  GPIO_InitStruct.Pin = GPIO_PIN_6|GPIO_PIN_7|GPIO_PIN_8|GPIO_PIN_9;&lt;br /&gt;
  GPIO_InitStruct.Mode = GPIO_MODE_OUTPUT_PP;&lt;br /&gt;
  GPIO_InitStruct.Pull = GPIO_NOPULL;&lt;br /&gt;
  GPIO_InitStruct.Speed = GPIO_SPEED_LOW;&lt;br /&gt;
  HAL_GPIO_Init(GPIOC, &amp;amp;GPIO_InitStruct);&lt;br /&gt;
&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
(&lt;br /&gt;
Note that pins -- among various other things -- can be customized in the CubeMX editor. Reexporting code to an existing project is straight forward, and can be done easily while the old Makefile keeps valid for minor changes... - However, STM32CubeMX looks still quite unfinished to me. It&#039;s a nice concept, but where are all the ST libraries, for example for the [http://www.st.com/web/en/catalog/tools/FM147/CL1794/SC961/SS1743/LN1734/PF258658# touch functionality]? It still needs to be downloaded separately... and it comes in a bloody EXE file as well! *arghs*&lt;br /&gt;
&lt;br /&gt;
Unfortunately, things seem to be a bit confusing. If you&#039;re using a STM32F0, then probably need to take a look into the [http://www.st.com/web/catalog/tools/FM147/CL1794/SC961/SS1743/LN1897/PF260612?icmp=pf260612_pron_nb_jun2014&amp;amp;sc=stm32cubef0-pr STM32CubeF0] software bundle, which contains a more up-to-date TouchSensing Library... Hm.&lt;br /&gt;
&lt;br /&gt;
Also, note that most of the provided code by ST is only documented in the source files themselves... And there are at least two vastly differing versions of the basic functions out there, what makes copy/pasting/sharing a bit difficult. I even don&#039;t know if they continue working on this code base, or if they switch over to [https://www.mbed.com/en/ mbed]. That seems to be the focus of those newer [http://www.st.com/web/catalog/tools/FM116/SC959/SS1532/LN1847?sc=stm32nucleo Nucleo] evaluation boards.&lt;br /&gt;
)&lt;br /&gt;
&lt;br /&gt;
=== Debugging: GDB ===&lt;br /&gt;
&lt;br /&gt;
GDB can be used to debug the code right on the hardware. While OpenOCD is running, you can connect to the target like this and step through the program:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
$ arm-none-eabi-gdb -tui build/STM32F072RBT6.elf&lt;br /&gt;
(...)&lt;br /&gt;
Reading symbols from build/STM32F072RBT6.elf...done.&lt;br /&gt;
&lt;br /&gt;
(gdb) target remote :3333&lt;br /&gt;
Remote debugging using :3333&lt;br /&gt;
Python Exception &amp;lt;type &#039;exceptions.NameError&#039;&amp;gt; Installation error: gdb.execute_u&lt;br /&gt;
nwinders function is missing:&lt;br /&gt;
HAL_GetTick () at Drivers/STM32F0xx_HAL_Driver/Src/stm32f0xx_hal.c:298&lt;br /&gt;
&lt;br /&gt;
(gdb) c&lt;br /&gt;
Continuing.&lt;br /&gt;
&lt;br /&gt;
Program received signal SIGINT, Interrupt.&lt;br /&gt;
0x080002f6 in HAL_Delay (Python Exception &amp;lt;type &#039;exceptions.NameError&#039;&amp;gt; Installa&lt;br /&gt;
tion error: gdb.execute_unwinders function is missing:&lt;br /&gt;
Delay=250)&lt;br /&gt;
    at Drivers/STM32F0xx_HAL_Driver/Src/stm32f0xx_hal.c:317&lt;br /&gt;
&lt;br /&gt;
(gdb) break main.c:91&lt;br /&gt;
Breakpoint 1 at 0x8001392: file Src/main.c, line 91.&lt;br /&gt;
&lt;br /&gt;
(gdb) c&lt;br /&gt;
Continuing.&lt;br /&gt;
Note: automatically using hardware breakpoints for read-only addresses.&lt;br /&gt;
Python Exception &amp;lt;type &#039;exceptions.NameError&#039;&amp;gt; Installation error: gdb.execute_u&lt;br /&gt;
nwinders function is missing:&lt;br /&gt;
&lt;br /&gt;
Breakpoint 1, main () at Src/main.c:91&lt;br /&gt;
&lt;br /&gt;
(...)&lt;br /&gt;
(gdb) detach&lt;br /&gt;
(qdb) quit&lt;br /&gt;
$&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
(Note: the -tui option is really great to inspect the code... see [http://ftp.gnu.org/old-gnu/Manuals/gdb-5.1.1/html_chapter/gdb_19.html GDB Text User Interface])&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== IDE: Eclipse SW4STM32 ===&lt;br /&gt;
&lt;br /&gt;
GOOD NEWS: This officially supported Eclipse variant works out of the box with STM32CubeMX generated project! You simply need to register on that site, and you&#039;ll get a software package that should work out of the box:&lt;br /&gt;
&lt;br /&gt;
[http://www.st.com/content/st_com/en/products/development-tools/software-development-tools/stm32-software-development-tools/stm32-ides/sw4stm32.html SW4STM32 - System Workbench for STM32: free IDE on Windows, Linux and OS X ]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
(Side note: I don&#039;t know how well it works when you have another Eclipse installed on your system... currently testing this out.)&lt;br /&gt;
&lt;br /&gt;
=== IDE: Eclipse with GNU ARM Eclipse plugin ===&lt;br /&gt;
&lt;br /&gt;
To use Eclipse as an IDE for the STM32s, just install Eclipse and a the GNU ARM Eclipse Plugin.&lt;br /&gt;
&lt;br /&gt;
* Eclipse IDE for C/C++ (CDT). This can be installed manually or with your package manager.&lt;br /&gt;
* Eclipse Plugin: [https://gnuarmeclipse.github.io/ GNU ARM Eclipse]. - This can be done in the Eclipse Marketplace (under &#039;&#039;Help &amp;gt; Eclipse Marketplace&#039;&#039; (use the default options)).&lt;br /&gt;
* Create a new Eclipse project with the GNU ARM Eclipse (Choose STM32Fxxx C/C++ Project in the Wizard)&lt;br /&gt;
&lt;br /&gt;
With some minor adjustments in the settings (OpenOCD), the basic Blinky example that comes with the plugin should work out of the box, with a STLink v2 programmer. Code completion etc. works fine too.&lt;br /&gt;
&lt;br /&gt;
(/todo: show every step)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
But there&#039;s quite annoying problem with this workflow!:&lt;br /&gt;
&lt;br /&gt;
http://www.carminenoviello.com/en/2015/06/04/stm32-applications-eclipse-gcc-stcube/:&lt;br /&gt;
&amp;lt;blockquote&amp;gt;&lt;br /&gt;
Unfortunately, the plug-in author has updated just the template for STM32-F4 family to the more recently STM32Cube-F4 HAL framework from ST (which still supports only commercial IDE.....), leaving the other templates still based on the old Standard Peripheral Library, which is no longer supported by ST and STM32CubeMX tool used in my tutorial. This causes my instructions to be wrong for processor families different from STM32-F4. &lt;br /&gt;
&amp;lt;/blockquote&amp;gt;&lt;br /&gt;
&lt;br /&gt;
So, several manual setup steps will be required to get started with your own STM32 project. To goal is to configure the project in STM32CubeMX, and use up-to-date HAL code, and not the deprecated Standard Peripheral Library.&lt;br /&gt;
&lt;br /&gt;
The GNU ARM Eclipse plugin is great, but doesn&#039;t create projects with up-to-date code. So we need to modify the manually created GNU ARM Eclipse project. - I used a custom STM32F072C8 board, and all steps below assum this hardware. The steps would be slightly different for other hardware.&lt;br /&gt;
&lt;br /&gt;
([http://www.carminenoviello.com/en/2015/06/04/stm32-applications-eclipse-gcc-stcube This tutorial] was helping here...)&lt;br /&gt;
&lt;br /&gt;
* First create a new &#039;C Project&#039; in your Eclipse workspace.&lt;br /&gt;
* In Wizard slide &#039;&#039;C Project&#039;&#039;: Choose Executable &amp;gt; &#039;&#039;Hello World ARM Cortex-M C/C++ Project&#039;&#039; and give it a name (e.g. testSTM32_00). This will generate a generic ARM project instead of an STM32Fxxx one. - Then hit &#039;&#039;Next&#039;&#039;.&lt;br /&gt;
* In Wizard slide &#039;&#039;Target processor settings&#039;&#039;: Configure the target processor: For the STM32F072C8: Change the defaults to Flash size (kB): 64, RAM size (kB): 16, Use system calls: Freestanding (no POSIX system calls), Trace output: None (no trace output). - Then hit &#039;&#039;Next&#039;&#039;.&lt;br /&gt;
* In Wizard slide &#039;&#039;Folders&#039;&#039;: Change Vendor CMSIS name to stm32f0xx. - Then hit next.&lt;br /&gt;
* In Wizard slide &#039;&#039;Select Configurations&#039;&#039;: Leave as is. - Then hit &#039;&#039;Next&#039;&#039;.&lt;br /&gt;
* In Wizard slide &#039;&#039;Cross GNU ARM Toolchain&#039;&#039;: Select &#039;&#039;GNU Tools for ARM Embedded Processors (arm-none-eabi-gcc)&#039;&#039; and either choose the global, system wide toolchain (probably in /usr/bin) or enter the path to your custom one. - Then hit &#039;&#039;Finish&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
This will create a generic ARM project, which should build without errors (hit Ctrl+B). &lt;br /&gt;
&lt;br /&gt;
Next, we need to add the vendor specific HAL code by ST generated with STM32CubeMX and/or downloaded in a more specific firmware package (STM32CubeF0, STM32CubeF4 etc.).&lt;br /&gt;
&lt;br /&gt;
...&lt;br /&gt;
So, after configuring a generic Eclipse project, we&#039;re ready to modify it.&lt;br /&gt;
&lt;br /&gt;
* Configure and export an EWARM project in [http://www.st.com/web/en/catalog/tools/PF259242 STM32CubeMX] (with default settings).&lt;br /&gt;
&lt;br /&gt;
* Extract the [http://www.st.com/web/en/catalog/tools/PF260612 STM32CubeF0] archive. ([http://www.st.com/web/en/catalog/tools/PF260820 STM32CubeF1], [http://www.st.com/web/en/catalog/tools/PF260266 STM32CubeF2], [http://www.st.com/web/en/catalog/tools/PF260613 STMCubeF3], [http://www.st.com/web/en/catalog/tools/PF259243 STMCubeF4]).&lt;br /&gt;
&lt;br /&gt;
As a starting point, here&#039;s a bash script, that modifies the previously created Eclipse project:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
#!/usr/bin/env bash&lt;br /&gt;
&lt;br /&gt;
set -e&lt;br /&gt;
&lt;br /&gt;
#echo &amp;quot;Press CTRL+C to proceed.&amp;quot;&lt;br /&gt;
#trap &amp;quot;pkill -f &#039;sleep 1h&#039;&amp;quot; INT&lt;br /&gt;
#trap &amp;quot;set +x ; sleep 1h ; set -x&amp;quot; DEBUG&lt;br /&gt;
&lt;br /&gt;
# MODIFY THIS!&lt;br /&gt;
ECLIPSE_PROJECT=/run/media/rel/prc/code/workspace_testSTM32_01/testSTM32_00&lt;br /&gt;
STM32CUBEF0=/home/rel/src/STM32Cube_FW_F0_V1.4.0&lt;br /&gt;
STM32CUBEMX=/home/rel/Desktop/test_stm32cubemx_ewarm&lt;br /&gt;
&lt;br /&gt;
echo --------------------------------------------------------------------------------&lt;br /&gt;
echo Eclipse Project Initializer for STM32F072 Dev&lt;br /&gt;
echo --------------------------------------------------------------------------------&lt;br /&gt;
&lt;br /&gt;
echo&lt;br /&gt;
echo The script is using the following paths:&lt;br /&gt;
echo&lt;br /&gt;
echo Eclipse Project:&lt;br /&gt;
echo $ECLIPSE_PROJECT&lt;br /&gt;
echo&lt;br /&gt;
echo STM32Cube:&lt;br /&gt;
echo $STM32CUBEF0&lt;br /&gt;
echo&lt;br /&gt;
echo STM32CubeMX:&lt;br /&gt;
echo $STM32CUBEMX&lt;br /&gt;
&lt;br /&gt;
echo&lt;br /&gt;
echo -n &amp;quot;Do you want to proceed? [ENTER]&amp;quot;&lt;br /&gt;
read&lt;br /&gt;
&lt;br /&gt;
echo&lt;br /&gt;
echo Deleting files from eclipse project:&lt;br /&gt;
rm -fv $ECLIPSE_PROJECT/src/main.c&lt;br /&gt;
rm -fv $ECLIPSE_PROJECT/src/Timer.c&lt;br /&gt;
rm -fv $ECLIPSE_PROJECT/include/Timer.h&lt;br /&gt;
&lt;br /&gt;
rm -fv $ECLIPSE_PROJECT/system/include/cmsis/stm32f0xx.h&lt;br /&gt;
rm -fv $ECLIPSE_PROJECT/system/include/cmsis/system_stm32f0xx.h&lt;br /&gt;
&lt;br /&gt;
rm -fv $ECLIPSE_PROJECT/system/src/cmsis/system_stm32f0xx.c&lt;br /&gt;
rm -fv $ECLIPSE_PROJECT/system/src/cmsis/vectors_stm32f0xx.c&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
echo&lt;br /&gt;
echo Copying: ST HAL:&lt;br /&gt;
cp -rfv $STM32CUBEF0/Drivers/STM32F0xx_HAL_Driver/Src/* \&lt;br /&gt;
$ECLIPSE_PROJECT/system/src/stm32f0xx&lt;br /&gt;
&lt;br /&gt;
cp -rfv $STM32CUBEF0/Drivers/STM32F0xx_HAL_Driver/Inc/* \&lt;br /&gt;
$ECLIPSE_PROJECT/system/include/stm32f0xx&lt;br /&gt;
&lt;br /&gt;
cp -rfv $STM32CUBEF0/Drivers/CMSIS/Device/ST/STM32F0xx/Include/* \&lt;br /&gt;
$ECLIPSE_PROJECT/system/include/cmsis&lt;br /&gt;
&lt;br /&gt;
cp -fv $STM32CUBEF0/Drivers/CMSIS/Device/ST/STM32F0xx/Source/Templates/gcc/startup_stm32f072xb.s \&lt;br /&gt;
$ECLIPSE_PROJECT/system/src/cmsis/startup_stm32f072xb.S&lt;br /&gt;
&lt;br /&gt;
cp -fv $STM32CUBEF0/Drivers/CMSIS/Device/ST/STM32F0xx/Source/Templates/system_stm32f0xx.c \&lt;br /&gt;
$ECLIPSE_PROJECT/system/src/cmsis&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
# echo Copying: example project from STM32CubeF0:&lt;br /&gt;
#cp $STM32CUBEF0/Projects/STM32F072B-Discovery/Examples/GPIO/GPIO_IOToggle/Inc/* \&lt;br /&gt;
#$ECLIPSE_PROJECT/include&lt;br /&gt;
&lt;br /&gt;
#cp $STM32CUBEF0/Projects/STM32F072B-Discovery/Examples/GPIO/GPIO_IOToggle/Src/main.c \&lt;br /&gt;
#$ECLIPSE_PROJECT/src&lt;br /&gt;
&lt;br /&gt;
#cp $STM32CUBEF0/Projects/STM32F072B-Discovery/Examples/GPIO/GPIO_IOToggle/Src/stm32f0xx_it.c \&lt;br /&gt;
#$ECLIPSE_PROJECT/src&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
echo&lt;br /&gt;
echo Copying: example project from STM32CubeMX:&lt;br /&gt;
cp $STM32CUBEMX/Src/* $ECLIPSE_PROJECT/src&lt;br /&gt;
cp $STM32CUBEMX/Inc/* $ECLIPSE_PROJECT/include&lt;br /&gt;
&lt;br /&gt;
echo&lt;br /&gt;
echo Modifiying/fixing the memory map:&lt;br /&gt;
echo $ECLIPSE_PROJECT/ldscripts/mem.ld&lt;br /&gt;
sed -i &#039;s/FLASH (rx) : ORIGIN = 0x00000000/FLASH (rx) : ORIGIN = 0x08000000/g&#039; $ECLIPSE_PROJECT/ldscripts/mem.ld&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
echo&lt;br /&gt;
echo SUCCESS&lt;br /&gt;
echo&lt;br /&gt;
&lt;br /&gt;
echo&lt;br /&gt;
echo Now, exclude the following file from the Eclipse project manually:&lt;br /&gt;
ls $ECLIPSE_PROJECT/system/src/stm32f0xx/stm32f0xx_hal_msp_template.c&lt;br /&gt;
&lt;br /&gt;
echo&lt;br /&gt;
echo And add the following preprocessor constants to the C/C++ compiler settings in Eclipse:&lt;br /&gt;
echo USE_HAL_DRIVER&lt;br /&gt;
echo STM32F072xB&lt;br /&gt;
&lt;br /&gt;
echo&lt;br /&gt;
echo &amp;quot;And add the following config options to the GDB OpenOCD Debugging settings (in Run Configurations):&amp;quot;&lt;br /&gt;
echo &amp;quot;-f interface/stlink-v2.cfg -f target/stm32f0x.cfg&amp;quot;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This script needs to be modified according to your needs! (Currently is working for the STM32F072C8, and contains fixed paths! - Note that there minor inconsistencies in some of these ST projects. For example, all the provided STM32F072xB* files by ST work for both types of chips -- STM32F072x8 and STM32F072xB.)&lt;br /&gt;
&lt;br /&gt;
Like described in the script above, some minor manual changes need to be made in Eclipse after running the script.&lt;br /&gt;
&lt;br /&gt;
This should now be a good basis to start a new STM32 project.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Note that the GNU ARM Eclipse plugin always generates a Makefile for every project configuration (Debug / Release). It can be found in &amp;lt;project_folder&amp;gt;/Debug pr &amp;lt;project_folder&amp;gt;/Release respectively.&lt;br /&gt;
&lt;br /&gt;
==== Semihosting ====&lt;br /&gt;
&lt;br /&gt;
http://infocenter.arm.com/help/index.jsp?topic=/com.arm.doc.dui0471c/Bgbjjgij.html:&lt;br /&gt;
&amp;lt;blockquote&amp;gt;&lt;br /&gt;
What is semihosting?&lt;br /&gt;
&lt;br /&gt;
Semihosting is a mechanism that enables code running on an ARM target to communicate and use the Input/Output facilities on a host computer that is running a debugger.&lt;br /&gt;
&lt;br /&gt;
Examples of these facilities include keyboard input, screen output, and disk I/O.&lt;br /&gt;
&amp;lt;/blockquote&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The GNU ARM Eclipse plugin comes with a really bare-bone implementation of some semihosting print functions that can be used to print logs to the console right in Eclipse (over GDB, without using any additional serial/UART connection whatsoever).&lt;br /&gt;
&lt;br /&gt;
Since I&#039;d always create a project without Semihosting enabled in the GNU ARM Eclipse wizard, you can still easily enable it later on:&lt;br /&gt;
&lt;br /&gt;
The easiest way I&#039;ve found so far, is by defining those Preprocessor constants in the C/C++ Project settings (Projects &amp;gt; Properties &amp;gt; C/C++ Build &amp;gt; Settings &amp;gt; Cross ARM GNU C/C++ Compiler &amp;gt; Preprocessor):&lt;br /&gt;
* TRACE&lt;br /&gt;
* OS_USE_TRACE_SEMIHOSTING_STDOUT&lt;br /&gt;
&lt;br /&gt;
And then, by using the following function calls in your code to log stuff to the Eclipse console right away:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
trace_initialize(); // in fact not required&lt;br /&gt;
// (...)&lt;br /&gt;
static int i = 0;&lt;br /&gt;
trace_puts( &amp;quot;hello&amp;quot; );&lt;br /&gt;
trace_printf( &amp;quot;nr %d\n&amp;quot;, i++ );&lt;br /&gt;
HAL_Delay( 1000 );  &lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
These functions were implemented by the author of GNU ARM Eclipse [https://github.com/ilg-ul Liviu Ionescu], and can be looked up in these files:&lt;br /&gt;
* &amp;lt;eclipse_project&amp;gt;/system/include/arm/semihosting.h&lt;br /&gt;
* &amp;lt;eclipse_project&amp;gt;/system/include/diag/Trace.h&lt;br /&gt;
* &amp;lt;eclipse_project&amp;gt;/system/src/diag/Trace.c&lt;br /&gt;
* &amp;lt;eclipse_project&amp;gt;/system/src/diag/trace_impl.c&lt;br /&gt;
&lt;br /&gt;
An interesting comment in &#039;&#039;trace_impl.c:133&#039;&#039; says:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
// Semihosting is the other output channel that can be used for the trace&lt;br /&gt;
// messages. It comes in two flavours: STDOUT and DEBUG. The STDOUT channel&lt;br /&gt;
// is the equivalent of the stdout in POSIX and in most cases it is forwarded&lt;br /&gt;
// to the GDB server stdout stream. The debug channel is a separate&lt;br /&gt;
// channel. STDOUT is buffered, so nothing is displayed until a \n;&lt;br /&gt;
// DEBUG is not buffered, but can be slow.&lt;br /&gt;
//&lt;br /&gt;
// Choosing between semihosting stdout and debug depends on the capabilities&lt;br /&gt;
// of your GDB server, and also on specific needs. It is recommended to test&lt;br /&gt;
// DEBUG first, and if too slow, try STDOUT.&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Note that semihosting needs to be enabled in your Eclipse run configuration (it is by default), in the Startup tab &amp;gt; Enable ARM semihosting. This will tell GDB to use semihosting. Without enabling, calls to those trace_* functions will throw some kind of exception... and make the processor halt. I couldn&#039;t find out much yet about how this feature really works, somehow it uses a special BKPT instruction...&lt;br /&gt;
&lt;br /&gt;
Semihosting (OS_USE_TRACE_SEMIHOSTING_STDOUT) can also be used in &amp;quot;Release&amp;quot; builds, since the semihosted calls don&#039;t rely on debug symbols.&lt;br /&gt;
&lt;br /&gt;
=== IDE: Code::Blocks ===&lt;br /&gt;
&lt;br /&gt;
My favorite cross-platform IDE for C/C++ is Code::Blocks. - And luckily, it also works well for ARM development! After twiddling around with those confusing Eclipse settings, I&#039;ve almost forgot to try out and setup Code::Blocks.&lt;br /&gt;
&lt;br /&gt;
The steps required are bit unintuitive, but building and debugging projects with full auto-complete and indexer support works now.&lt;br /&gt;
&lt;br /&gt;
The advantages over using Eclipse:&lt;br /&gt;
* Faster GUI.&lt;br /&gt;
* Works with STM32CubeMX generated code.&lt;br /&gt;
* Uses just a plain/manually editable Makefile to build the project.&lt;br /&gt;
* Familiar C/C++ settings and more *transparent* project handling -&amp;gt; Edit + debug. Nothing more. Everything can be done by hand on a console too. No mysterious hidden helpers...&lt;br /&gt;
&lt;br /&gt;
I&#039;m still evaluating this workflow... But to get things up and running, you can do this:&lt;br /&gt;
&lt;br /&gt;
(Assuming you already have a working Makefile based project, e.g. [http://wiki.sgmk-ssam.ch/wiki/STM32_dev#STM32CubeMX_to_Makefile created with STM32CubeMX, like described above]).&lt;br /&gt;
&lt;br /&gt;
* Open Code::Blocks and create an &#039;&#039;&#039;empty&#039;&#039;&#039; project (&#039;&#039;File &amp;gt; New &amp;gt; Project &amp;gt; Empty project&#039;&#039;).&lt;br /&gt;
* Give it a name in the Wizard, and choose the &#039;&#039;GNU GCC Compiler for ARM&#039;&#039;, and save it. &lt;br /&gt;
* Copy all content of the Makefile project over to Code::Blocks project folder.&lt;br /&gt;
* Import all required source files into the Code::Blocks workspace (right click -&amp;gt; &#039;&#039;Add files recursively...&#039;&#039;). &lt;br /&gt;
* Check &#039;&#039;Project &amp;gt; Properties &amp;gt; Project settings &amp;gt; Makefile: This is a custom Makefile&#039;&#039;.&lt;br /&gt;
* Adjust the build settings in &#039;&#039;Project &amp;gt; Build options &amp;gt; &amp;quot;Make commands&amp;quot;&#039;&#039;. - This might either require you to change the Makefile (i.e. add Debug/Release targets), or the commands. - For simplicity&#039;s sake, just ignore those $make, $makefile variables and overwrite them with your actual commands (i.e.&#039;&#039;$make -f $makefile $target&#039;&#039; -&amp;gt; &#039;&#039;make all&#039;&#039;).&lt;br /&gt;
* &#039;&#039;Build&#039;&#039; the project and check in the &#039;&#039;Build log&#039;&#039; if there where any errors/warnings.&lt;br /&gt;
&lt;br /&gt;
So, if this is working now, try to edit a source file and see if those really useful auto-complete and jump to declaration/implementation features are working. - One caveat of using an external Makefile is that the IDE doesn&#039;t know the current settings. So, for example, #defines are not available, and syntax highlighting will not update automatically... So it might be worth it add settings manually at some point.&lt;br /&gt;
&lt;br /&gt;
Now, to get the flashing and debugging working, try this:&lt;br /&gt;
&lt;br /&gt;
* Go to the &#039;&#039;Settings &amp;gt; Debugger&#039;&#039; Settings.&lt;br /&gt;
* Add a new GDB debugger setting (hit &#039;&#039;Create Config&#039;&#039; and call it &#039;&#039;ARM OpenOCD&#039;&#039; for example).&lt;br /&gt;
* Change the &#039;&#039;Executable path&#039;&#039; according to your toolchains location, and check &#039;Do *not* run the debugee&#039;.&lt;br /&gt;
* Go to &#039;&#039;Projects &amp;gt; Properties &amp;gt; Debugger&#039;&#039;.&lt;br /&gt;
** Change the &amp;lt;Project&amp;gt; &#039;&#039;Remote connection&#039;&#039; settings to IP: 127.0.0.1 / Port: 3333.&lt;br /&gt;
** Go to the &amp;lt;Project&amp;gt; &#039;&#039;Additional GDB commands&#039;&#039; tab. And enter those commands into the &#039;&#039;After connection&#039;&#039; box (change filename!):&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
monitor halt&lt;br /&gt;
load ./build/test.elf&lt;br /&gt;
file ./build/test.elf&lt;br /&gt;
monitor sleep 1000&lt;br /&gt;
monitor reset&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
To not run the program automatically, remove the last two commands. Then you need to &#039;&#039;Start / Continue&#039;&#039; the program twice, but you&#039;ll catch the first breakpoint you&#039;ve set!&lt;br /&gt;
* Choose &#039;&#039;Debug &amp;gt; Active Debuggers &amp;gt; GDB/CDB Debugger: ARM OpenOCD&#039;&#039;.&lt;br /&gt;
* Start OpenOCD in a terminal. (Described above).&lt;br /&gt;
* Start debugging by pressing the red arrow (Run / continue) in the debugging toolbar.&lt;br /&gt;
&lt;br /&gt;
The steps are the same as the ones in [http://www.hackvandedam.nl/blog/?p=707 this tutorial &#039;&#039;&#039;with screenshots&#039;&#039;&#039;].&lt;br /&gt;
&lt;br /&gt;
=== stlink ===&lt;br /&gt;
&lt;br /&gt;
[https://github.com/texane/stlink stlink] is a command line tool for programming, inspecting and debugging the STM32 microcontrollers. It also used internally by OpenOCD (I think). - It comes with several small programs (st-flash, st-info, st-term, st-util) that can come in handy while working with the STM32 micros.&lt;br /&gt;
&lt;br /&gt;
There&#039;s a tutorial:&lt;br /&gt;
https://github.com/texane/stlink/blob/master/doc/tutorial/tutorial.pdf&lt;br /&gt;
&lt;br /&gt;
Some useful things I&#039;ve discovered:&lt;br /&gt;
&lt;br /&gt;
Just run st-util can Ctrl-C again to see all relevant uC properties:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
$ st-util&lt;br /&gt;
2016-01-29T13:06:25 INFO src/stlink-common.c: Loading device parameters....&lt;br /&gt;
2016-01-29T13:06:25 INFO src/stlink-common.c: Device connected is: F07x device, id 0x20016448&lt;br /&gt;
2016-01-29T13:06:25 INFO src/stlink-common.c: SRAM size: 0x4000 bytes (16 KiB), Flash: 0x10000 bytes (64 KiB) in pages of 2048 bytes&lt;br /&gt;
2016-01-29T13:06:25 INFO gdbserver/gdb-server.c: Chip ID is 00000448, Core ID is  0bb11477.&lt;br /&gt;
2016-01-29T13:06:25 INFO gdbserver/gdb-server.c: Target voltage is 3554 mV.&lt;br /&gt;
2016-01-29T13:06:25 INFO gdbserver/gdb-server.c: Listening at *:4242...&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Or with st-info:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
$ st-info &lt;br /&gt;
st-info --flash&lt;br /&gt;
st-info --sram&lt;br /&gt;
st-info --descr&lt;br /&gt;
st-info --pagesize&lt;br /&gt;
st-info --chipid&lt;br /&gt;
$ st-info --flash&lt;br /&gt;
0x10000&lt;br /&gt;
$ st-info --sram&lt;br /&gt;
0x4000&lt;br /&gt;
$ st-info --descr&lt;br /&gt;
F07x device&lt;br /&gt;
$ st-info --pagesize&lt;br /&gt;
0x800&lt;br /&gt;
$ st-info --chipid&lt;br /&gt;
0x0448&lt;br /&gt;
&lt;br /&gt;
$ echo `st-info --sram | xargs -I@ printf &amp;quot;%d/1024\n&amp;quot; @ | bc`kB RAM&lt;br /&gt;
16kB RAM&lt;br /&gt;
$ echo `st-info --flash | xargs -I@ printf &amp;quot;%d/1024\n&amp;quot; @ | bc`kB FLASH&lt;br /&gt;
64kB FLASH&lt;br /&gt;
&lt;br /&gt;
$ for a in sram flash pagesize; do echo `st-info --$a | xargs -I@ printf &amp;quot;%d/1024\n&amp;quot; @ | bc`kb $a; done&lt;br /&gt;
16kb sram&lt;br /&gt;
64kb flash&lt;br /&gt;
2kb pagesize&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Links ===&lt;br /&gt;
&lt;br /&gt;
==== Tools ====&lt;br /&gt;
* [https://gnuarmeclipse.github.io/ GNU ARM Eclipse]: [https://gnuarmeclipse.github.io/eclipse/workspace/preferences/ workspace_preferences], [http://gnuarmeclipse.github.io/toolchain/path/ toolchain_path], [http://gnuarmeclipse.github.io/eclipse/project/portability/ project_portability]&lt;br /&gt;
&lt;br /&gt;
==== Tutorials ====&lt;br /&gt;
* Great introduction: [http://www.triplespark.net/elec/pdev/arm/stm32.html Programming STM32 F2, F4 ARMs under Linux: A Tutorial from Scratch]&lt;br /&gt;
* STM32Cube to GNU ARM Eclipse tips: http://www.carminenoviello.com/en/2015/06/04/stm32-applications-eclipse-gcc-stcube/&lt;br /&gt;
* Micro Python on STM32F4-Discovery: http://gpio.kaltpost.de/?p=2082&lt;br /&gt;
* Logs: https://hackaday.io/project/4277/logs?page=2&lt;br /&gt;
* Code::Blocks tutorial: http://www.hackvandedam.nl/blog/?p=707&lt;br /&gt;
* Eclipse tutorial: http://www.carminenoviello.com/en/2015/06/04/stm32-applications-eclipse-gcc-stcube&lt;br /&gt;
* http://sigalrm.blogspot.ch/2013/12/using-ccm-memory-on-stm32.html&lt;br /&gt;
* http://stm32f4-discovery.com/2014/08/stm32f4-external-interrupts-tutorial/&lt;br /&gt;
* ...&lt;br /&gt;
&lt;br /&gt;
==== Projects / Demos / Code ====&lt;br /&gt;
* MrBlueXav&#039;s Synths: https://github.com/MrBlueXav&lt;br /&gt;
* cliffle&#039;s VGA stuff: https://github.com/cbiffle/m4vgalib-demos, http://cliffle.com/article/2015/06/05/introducing-glitch/&lt;br /&gt;
* ESPruino code: https://github.com/espruino/Espruino -&amp;gt; STM32F401CDU6&lt;br /&gt;
* STM32F4 Audio Codec Board: http://ebrombaugh.studionebula.com/synth/stm32f4_codec/&lt;br /&gt;
* ESPRUINO: http://www.espruino.com/ReferenceSTM32F4DISCOVERY&lt;br /&gt;
* micropython: https://github.com/micropython/micropython&lt;br /&gt;
* STM32F4 DIY: http://mikrocontroller.bplaced.net/wordpress/?page_id=1482&lt;br /&gt;
* STM32F4 overclocking: http://sigalrm.blogspot.ch/2014/01/overclocking-stm32f4.html&lt;br /&gt;
* thermal camera: http://www.theresistornetwork.com/2014/11/flir-lepton-thermal-imaging-sensor.html&lt;br /&gt;
* STM32F7: http://hackaday.com/2015/06/26/new-part-day-stm32f7-an-arm-cortex-m7/&lt;br /&gt;
* Karsten Schmidt: http://workshop.thi.ng/ [https://soundcloud.com/forthcharlie soundcloud] https://github.com/thi-ng/ws-ldn-4 https://github.com/thi-ng/ws-ldn-3 http://asm.thi.ng/&lt;br /&gt;
* Peridrummmm Demo: http://www.pouet.net/prod.php?which=59095 with sources: http://aka-san.halcy.de/revision2012/peridiummmm-src.zip&lt;br /&gt;
* Andy&#039;s Workshop: http://andybrown.me.uk/&lt;br /&gt;
* axoloti: http://axoloti.com/&lt;br /&gt;
&lt;br /&gt;
==== Libraries ====&lt;br /&gt;
* libopencm3 http://libopencm3.org/wiki/Main_Page&lt;br /&gt;
* list of libs: http://mikrocontroller.bplaced.net/wordpress/?page_id=2736&lt;br /&gt;
&lt;br /&gt;
==== OS ====&lt;br /&gt;
* FreeRTOS: http://www.freertos.org/index.html&lt;br /&gt;
* Embedded Linux on STM32: https://github.com/EmcraftSystems&lt;br /&gt;
* ChibiOS: http://www.chibios.org/dokuwiki/&lt;br /&gt;
&lt;br /&gt;
==== General ====&lt;br /&gt;
* ARM Related Books: http://www.arm.com/support/resources/arm-books/&lt;br /&gt;
* STM32 Overview http://www.st.com/web/en/catalog/mmc/FM141/SC1169?sc=stm32&lt;br /&gt;
* mbed https://en.wikipedia.org/wiki/Mbed&lt;br /&gt;
* CMSIS: http://www.keil.com/pack/doc/cmsis/Core/html/index.html&lt;br /&gt;
&lt;br /&gt;
== Hardware ==&lt;br /&gt;
&lt;br /&gt;
All about hardware and hardware tools for STM32 dev. Chips, programmers etc.&lt;br /&gt;
&lt;br /&gt;
=== ST-Link V2 Programmer ===&lt;br /&gt;
&lt;br /&gt;
There are two popular ST-Link V2 Progammers on the market. They have a different pinout but work both well like described above.&lt;br /&gt;
&lt;br /&gt;
[[File:ST-LinkV2_pinout_01.jpg]]&lt;br /&gt;
&lt;br /&gt;
Alternatively, STM32Discovery/[http://jeelabs.org/book/1547a/index.html Nucleo boards too can be used as SWD programmers].&lt;br /&gt;
&lt;br /&gt;
Luckily, only 4 pins have to be used to program and debug the target!&lt;br /&gt;
To find out more about this protocol, have a look into [http://www.arm.com/products/system-ip/debug-trace/coresight-soc-components/serial-wire-debug.php Serial Debug Wire (SWD)] as an alternative to JTAG.&lt;br /&gt;
&lt;br /&gt;
Connect to following pins of the programmer to the corresponding pins on the PCB:&lt;br /&gt;
&lt;br /&gt;
* V3V&lt;br /&gt;
* GND&lt;br /&gt;
* SWCLK&lt;br /&gt;
* SWDIO&lt;br /&gt;
&lt;br /&gt;
-&amp;gt; NRST can be important too on some STM32 chips!&lt;br /&gt;
&lt;br /&gt;
Remember: These are &#039;&#039;&#039;not&#039;&#039;&#039; the [http://www.st.com/web/catalog/tools/FM146/CL1984/SC724/SS1677/PF251168 official ST-Link V2 Programmers], sold by ST.&lt;br /&gt;
&lt;br /&gt;
== Projects ==&lt;br /&gt;
&lt;br /&gt;
STM32 based projects.&lt;br /&gt;
&lt;br /&gt;
=== STM32basic ===&lt;br /&gt;
&lt;br /&gt;
STM32basic is a test board to see how STM32 chips can be used in DIY circuits.&lt;br /&gt;
&lt;br /&gt;
==== STM32basic rev0.01 ====&lt;br /&gt;
&lt;br /&gt;
An initial list of tests:&lt;br /&gt;
&lt;br /&gt;
* JTAG: See how we can program the thing. Do we need all JTAG pins? Or only the SWD pins? What about reset? - Do the cheapo Chinese STLink V2 programmer really work?&lt;br /&gt;
* Basic I/O: LED and push button.&lt;br /&gt;
* U(S)ART: Check whether it&#039;s possible to hook up an FTDI to send/receive characters to/from the STM32basic?&lt;br /&gt;
* BOOT0/1: What about those boot modes?&lt;br /&gt;
* Power Usage : 3V3 Regulator: ..&lt;br /&gt;
&lt;br /&gt;
[[File:STM32basic_pcb1b.jpg]]&lt;br /&gt;
&lt;br /&gt;
Board at OSH Park:&amp;lt;br /&amp;gt;&lt;br /&gt;
https://oshpark.com/shared_projects/kCD7Yr0A&lt;br /&gt;
&lt;br /&gt;
KiCad project and everything else:&amp;lt;br /&amp;gt;&lt;br /&gt;
Remark: this has been made in hurry and is just a test:&amp;lt;br /&amp;gt;&lt;br /&gt;
http://0rel.com/prj/STM32basic/STM32basic_rev0.01.zip&lt;br /&gt;
&lt;br /&gt;
[[File:Stm32basic1.jpg]]&lt;br /&gt;
&lt;br /&gt;
So far, the tests have been working ok.&lt;br /&gt;
&lt;br /&gt;
* STLink V2 programmers seem to work fine, and only require 2 pins + VCC/GND! SWDIO and SWCLK, that&#039;s it! For programming and on-chip debugging.&lt;br /&gt;
* I/O works as well. External interrupts can be configured.&lt;br /&gt;
* UART works, but I have not yet tested it with a proper code. It was working with some echo snippet I&#039;ve found somewhere.&lt;br /&gt;
* Power usage is low. ~15 mA at 3.3 V.&lt;br /&gt;
* BOOT0 jumper has to be set (connected to ground) in order to run code... - Other boot modes have not been tested yet. More tests are needed there... What are the other available boot modes, what about those built-in boot loaders?&lt;br /&gt;
&lt;br /&gt;
However, the board has several flaws:&lt;br /&gt;
* 1.27 mm pin-pitch headers cannot be arranged like that (GPIOs). They need to be further apart to make sockets/headers fit.&lt;br /&gt;
* 3V3 LDO doesn&#039;t make much sense like this. Add add a buck/boost converter. Also remove 5V label.&lt;br /&gt;
* This BOOT0 jumper isn&#039;t nice like this...&lt;br /&gt;
* Remove unnecessary JTAG pins. SWD only.&lt;br /&gt;
* Remove unnecessary USART pins.&lt;br /&gt;
* Add crystal.&lt;br /&gt;
* Add USB plug.&lt;br /&gt;
&lt;br /&gt;
Probably, this will not be remade, since it was enough for a test. I&#039;d like to make a very basic USB touch device next.&lt;br /&gt;
&lt;br /&gt;
==== STM32basic Eclipse project ====&lt;br /&gt;
&lt;br /&gt;
Test project to see if GPIOs with External interrupts and semi hosting works. Sloppy and not cleaned up yet...&amp;lt;br /&amp;gt;&lt;br /&gt;
http://0rel.com/prj/STM32basic/testSTM32F072_interrupt_test0.zip&lt;br /&gt;
&lt;br /&gt;
Note: Eclipse projects can be imported in an existing or new workspace with: &#039;&#039;File &amp;gt; Import &amp;gt; General &amp;gt; Existing Projects into Workspace&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
=== todo ===&lt;br /&gt;
&lt;br /&gt;
* I2C peripherals&lt;br /&gt;
* I2S peripherals&lt;br /&gt;
* SPI peripherals&lt;br /&gt;
* touch&lt;br /&gt;
* usb&lt;br /&gt;
* external memory (sram, flash, eeprom...) -&amp;gt; RTOS / Linux / ChibiOS? (similar to this http://hforsten.com/making-embedded-linux-computer.html)?&lt;br /&gt;
.....&lt;/div&gt;</summary>
		<author><name>0rel</name></author>
	</entry>
	<entry>
		<id>https://wiki.sgmk-ssam.ch/index.php?title=STM32_dev&amp;diff=6570</id>
		<title>STM32 dev</title>
		<link rel="alternate" type="text/html" href="https://wiki.sgmk-ssam.ch/index.php?title=STM32_dev&amp;diff=6570"/>
		<updated>2016-10-15T16:27:05Z</updated>

		<summary type="html">&lt;p&gt;0rel: /* IDE: Eclipse SW4STM32 */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Overview ==&lt;br /&gt;
&lt;br /&gt;
Notes on STM32 microcontrollers and on how to get them working in DIY projects.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;/// this is a work in progress draft ///&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
== Software ==&lt;br /&gt;
&lt;br /&gt;
All about software tools for STM32 dev. Development environments, compilers, debuggers, IDEs etc.&lt;br /&gt;
&lt;br /&gt;
=== ARM toolchains ===&lt;br /&gt;
&lt;br /&gt;
==== gcc-arm-embedded Toolchain ====&lt;br /&gt;
&lt;br /&gt;
Install the GCC arm-none-eabi toolchain for your OS. On Arch Linux this can be done with the package manager:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
$ sudo pacman -S arm-none-eabi-gcc arm-none-eabi-gdb arm-none-eabi-binutils arm-none-eabi-newlib&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Alternatively, it can be built from scratch, to have all tools and their sources in one place.&lt;br /&gt;
&lt;br /&gt;
* Download the sources here: https://launchpad.net/gcc-arm-embedded/+download&lt;br /&gt;
* Install the &#039;&#039;common tools and libraries&#039;&#039; like described in the [https://launchpadlibrarian.net/231136652/How-to-build-toolchain.pdf documentation].&lt;br /&gt;
* Build the toolchain. - On my system, the following steps were required:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
$ cp gcc-arm-none-eabi-5_2-2015q4-20151219-src.tar.bz2 ~/toolchain&lt;br /&gt;
$ cd ~/toolchain&lt;br /&gt;
$ tar -xjf gcc-arm-none-eabi-5_2-2015q4-20151219-src.tar.bz2&lt;br /&gt;
$ cd ./gcc-arm-none-eabi-5_2-2015q4-20151219/src&lt;br /&gt;
$ find -name &#039;*.tar.*&#039; | xargs -I% tar -xf %&lt;br /&gt;
$ cd ..&lt;br /&gt;
$ ./build-prerequisites.sh --skip_steps=mingw32&lt;br /&gt;
$ ./build-toolchain.sh --skip_steps=mingw32,manual&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
Note that those &#039;&#039;skip_steps&#039;&#039; options were required in my case.&lt;br /&gt;
&lt;br /&gt;
==== Linaro Toolchain ====&lt;br /&gt;
&lt;br /&gt;
The [https://en.wikipedia.org/wiki/Linaro Linaro] toolchain seems to be famous as well.&lt;br /&gt;
&lt;br /&gt;
Install it with your package manager if available, or build it yourself:&amp;lt;br /&amp;gt;&lt;br /&gt;
https://wiki.linaro.org/WorkingGroups/ToolChain&amp;lt;br /&amp;gt;&lt;br /&gt;
https://wiki.linaro.org/WorkingGroups/ToolChain/FAQ&lt;br /&gt;
&lt;br /&gt;
==== devkitpro devkitARM toolchain ====&lt;br /&gt;
&lt;br /&gt;
Another gcc variant: http://devkitpro.org/&lt;br /&gt;
&lt;br /&gt;
Used in the homebrew scene for game consoles like the GP32, Nintendo (3)DS and GBA. It can [http://www.pouet.net/prod.php?which=59095 apparently] also be used for the STM32s as well! And generates probably more optimized binaries?&lt;br /&gt;
&lt;br /&gt;
(On Arch it can be installed from the AUR: https://aur.archlinux.org/packages/devkitarm-bin/ . But beware, the compiler, link, binutils have all the same name as the ones from the official GCC arm-none-eabi toolchain. So it&#039;s probably better to install it manually.)&lt;br /&gt;
&lt;br /&gt;
=== STM32CubeMX on Linux ===&lt;br /&gt;
&lt;br /&gt;
STM32CubeMX is a code generator for STM32 micros that can come in handy when you start a new project. It generates all the necessary init and HAL code, library and custom pin mux code for your specific MCU.&lt;br /&gt;
&lt;br /&gt;
Unfortunately, it comes as a Windows EXE and ST doesn&#039;t mention that it actually is a Java application. Luckily it can be installed on Linux by hand (thanks to 5V Joe&#039;s great note [http://fivevolt.blogspot.ch/2014/07/installing-stm32cubemx-on-linux.html there]):&lt;br /&gt;
&lt;br /&gt;
* Download [http://www.st.com/web/catalog/tools/FM147/CL1794/SC961/SS1743/PF259242?icmp=stm32cubemx_pron_prcube_feb2014&amp;amp;sc=stm32cube-pr STM32CubeMX].&lt;br /&gt;
* Install the application (tested in January 2016):&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
$ unzip SetupSTM32CubeMX-4.12.0.exe -d stm32cube&lt;br /&gt;
$ cd stm32cube&lt;br /&gt;
$ java -cp . com.izforge.izpack.installer.bootstrap.Installer&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
* Run:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
$ cd &amp;lt;install_dir&amp;gt;&lt;br /&gt;
$ unzip STM32CubeMX.exe&lt;br /&gt;
$ java -cp . com.st.microxplorer.maingui.STM32CubeMX&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== STM32CubeMX to Makefile ===&lt;br /&gt;
&lt;br /&gt;
For whatever reason, STM32CubeMX does not export plain GCC/Makefiles along with the initialization code. But instead, it supports an unpopular IDE called [http://www.st.com/web/catalog/tools/FM147/CL1794/SC961/SS1533/PF261797 SW4STM32], which is also based on free GNU tools. So after installing STM32CubeMX, these are the steps to get the GCC/Makefile project running:&lt;br /&gt;
&lt;br /&gt;
* Get this nice Python script by [http://www.ba0sh1.com/ Baoshi] to generate the Makefile for an exported SW4STM32 project:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
$ git clone https://github.com/baoshi/CubeMX2Makefile&lt;br /&gt;
$ cd CubeMX2Makefile&lt;br /&gt;
$ python2 CubeMX2Makefile.py &amp;lt;your_sw4stm32_prject_dir&amp;gt;&lt;br /&gt;
$ cd &amp;lt;your_sw4stm32_prject_dir&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* Fix a tiny bug in the generated Makefile (tested in January 2016). More can be read [http://www.ba0sh1.com/stm32cubemx-gcc-makefile/ here].&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
$ grep __weak Makefile &lt;br /&gt;
C_DEFS = -D__weak=&amp;quot;__attribute__\(\(weak\)\)&amp;quot; -D__packed=&amp;quot;__attribute__\(\(__packed__\)\)&amp;quot; -DUSE_HAL_DRIVER -DSTM32F072xB&lt;br /&gt;
$ sed -i &#039;s/\\(\\(weak\\)\\)/((weak))/g&#039; Makefile &lt;br /&gt;
$ sed -i &#039;s/\\(\\(packed\\)\\)/((packed))/g&#039; Makefile &lt;br /&gt;
$ grep __weak Makefile &lt;br /&gt;
C_DEFS = -D__weak=&amp;quot;__attribute__((weak))&amp;quot; -D__packed=&amp;quot;__attribute__\(\(__packed__\)\)&amp;quot; -DUSE_HAL_DRIVER -DSTM32F072xB&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* Then build the binary:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
$ make&lt;br /&gt;
(...)&lt;br /&gt;
arm-none-eabi-size build/STM32F072RBT6.elf&lt;br /&gt;
   text	   data	    bss	    dec	    hex	filename&lt;br /&gt;
   4568	     12	   1572	   6152	   1808	build/STM32F072RBT6.elf&lt;br /&gt;
arm-none-eabi-objcopy -O ihex build/STM32F072RBT6.elf build/STM32F072RBT6.hex&lt;br /&gt;
arm-none-eabi-objcopy -O binary -S build/STM32F072RBT6.elf build/STM32F072RBT6.bin	&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Flash ===&lt;br /&gt;
&lt;br /&gt;
Install OpenOCD and STLINK. On Arch Linux:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
sudo pacman -S stlink openocd&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now [http://openocd.org/ OpenOCD] and (arm-none-eabi-)gdb can be used to program and debug the MCU. All discovery boards also come with an ST-LINK/V2 programmer right built in speaking over USB to the host and over JTAG/[http://www.arm.com/products/system-ip/debug-trace/coresight-soc-components/serial-wire-debug.php SWD] to the target (note: only two pins are actually required for SWD debugging/flashing (SWDIO/SWCLK), but that for later (see also [[#Hardware]])). STM32 Discovery Boards should show up in the lsusb list like that:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
$ lsusb&lt;br /&gt;
(...)&lt;br /&gt;
Bus 003 Device 006: ID 0483:3748 STMicroelectronics ST-LINK/V2&lt;br /&gt;
(...)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
OpenOCD can now act as a &amp;quot;middleman&amp;quot; between the ST-LINK programmer and the user. As a server on the host, to which you can connect with telnet and GDB.&lt;br /&gt;
&lt;br /&gt;
To configure OpenOCD, put a configuration file called opencd.cfg into the project folder and start OpenOCD. While working on the project, let it run there in the foreground to see all the logs...&lt;br /&gt;
&lt;br /&gt;
For the [http://www.st.com/st-web-ui/static/active/jp/resource/technical/document/user_manual/DM00099401.pdf STM32 F072 Discovery] board this should work, for example:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
$ cd &amp;lt;project_directory&amp;gt;&lt;br /&gt;
$ echo &amp;quot;source [find board/stm32f0discovery.cfg]&amp;quot; &amp;gt; openocd.cfg&lt;br /&gt;
$ openocd&lt;br /&gt;
Open On-Chip Debugger 0.9.0 (2015-05-19-13:50)&lt;br /&gt;
Licensed under GNU GPL v2&lt;br /&gt;
For bug reports, read&lt;br /&gt;
	http://openocd.org/doc/doxygen/bugs.html&lt;br /&gt;
Info : The selected transport took over low-level target control. The results might differ compared to plain JTAG/SWD&lt;br /&gt;
adapter speed: 1000 kHz&lt;br /&gt;
adapter_nsrst_delay: 100&lt;br /&gt;
none separate&lt;br /&gt;
srst_only separate srst_nogate srst_open_drain connect_deassert_srst&lt;br /&gt;
Info : Unable to match requested speed 1000 kHz, using 950 kHz&lt;br /&gt;
Info : Unable to match requested speed 1000 kHz, using 950 kHz&lt;br /&gt;
Info : clock speed 950 kHz&lt;br /&gt;
Info : STLINK v2 JTAG v17 API v2 SWIM v0 VID 0x0483 PID 0x3748&lt;br /&gt;
Info : using stlink api v2&lt;br /&gt;
Info : Target voltage: 2.896454&lt;br /&gt;
Info : stm32f0x.cpu: hardware has 4 breakpoints, 2 watchpoints&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
(Don&#039;t worry about those warnings about the wrong clock speed for now...)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
In order to program the flash, connect to OpenOCD via telnet in another terminal:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
$ telnet 127.0.0.1 4444&lt;br /&gt;
Trying 127.0.0.1...&lt;br /&gt;
Connected to 127.0.0.1.&lt;br /&gt;
Escape character is &#039;^]&#039;.&lt;br /&gt;
Open On-Chip Debugger&lt;br /&gt;
&amp;gt; &lt;br /&gt;
&amp;gt; reset halt&lt;br /&gt;
target state: halted&lt;br /&gt;
target halted due to debug-request, current mode: Thread &lt;br /&gt;
xPSR: 0xc1000000 pc: 0x080014d0 msp: 0x20004000&lt;br /&gt;
&amp;gt; flash probe 0&lt;br /&gt;
device id = 0x20016448&lt;br /&gt;
flash size = 128kbytes&lt;br /&gt;
flash &#039;stm32f1x&#039; found at 0x08000000&lt;br /&gt;
&amp;gt; flash write_image erase build/STM32F072RBT6.elf&lt;br /&gt;
auto erase enabled&lt;br /&gt;
target state: halted&lt;br /&gt;
target halted due to breakpoint, current mode: Thread &lt;br /&gt;
xPSR: 0x61000000 pc: 0x2000003a msp: 0x20004000&lt;br /&gt;
wrote 6144 bytes from file build/STM32F072RBT6.elf in 0.503961s (11.906 KiB/s)&lt;br /&gt;
&amp;gt; reset run&lt;br /&gt;
&amp;gt; exit&lt;br /&gt;
Connection closed by foreign host.&lt;br /&gt;
$&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This should write the binary to the flash memory and start the program.&lt;br /&gt;
Of course, all those steps can be automated further and integrated into an IDE, but that&#039;s for later...&lt;br /&gt;
&lt;br /&gt;
To program the STM32F0Discovery board for example, this can be used to just flash the chip:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
$ openocd -f board/stm32f0discovery.cfg -c &amp;quot;program build/STM32F072RBT6.elf verify reset exit&amp;quot; &lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
To program a custom board for example with the STM32F0x chip, a command like this can be used:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
$ openocd -f interface/stlink-v2.cfg -f target/stm32f0x.cfg -c &amp;quot;program testSTM32F072_interrupt_test0.elf verify reset exit&amp;quot;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
To make things more convenient, add a new target &#039;&#039;flash&#039;&#039; to the Makefile with this command, and you can simply run &#039;&#039;make flash&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The exported main.c from STM32CubeMX was only slightly modified to let the user LEDs flash and react to the user pushbutton:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
******************************************************************************&lt;br /&gt;
* main.c *&lt;br /&gt;
******************************************************************************&lt;br /&gt;
&lt;br /&gt;
#include &amp;quot;stm32f0xx_hal.h&amp;quot;&lt;br /&gt;
&lt;br /&gt;
void SystemClock_Config(void);&lt;br /&gt;
static void MX_GPIO_Init(void);&lt;br /&gt;
&lt;br /&gt;
int main(void)&lt;br /&gt;
{&lt;br /&gt;
  /* Reset of all peripherals, Initializes the Flash interface and the Systick. */&lt;br /&gt;
  HAL_Init();&lt;br /&gt;
&lt;br /&gt;
  /* Configure the system clock */&lt;br /&gt;
  SystemClock_Config();&lt;br /&gt;
&lt;br /&gt;
  /* Initialize all configured peripherals */&lt;br /&gt;
  MX_GPIO_Init();&lt;br /&gt;
&lt;br /&gt;
  while (1)&lt;br /&gt;
  {&lt;br /&gt;
    uint32_t delay;&lt;br /&gt;
    if( HAL_GPIO_ReadPin( GPIOA, GPIO_PIN_0 ) == GPIO_PIN_SET )&lt;br /&gt;
      delay = 50;&lt;br /&gt;
    else&lt;br /&gt;
      delay = 250;&lt;br /&gt;
&lt;br /&gt;
    HAL_GPIO_TogglePin( GPIOC, GPIO_PIN_9 );&lt;br /&gt;
    HAL_Delay( delay );&lt;br /&gt;
    HAL_GPIO_TogglePin( GPIOC, GPIO_PIN_8 );&lt;br /&gt;
    HAL_Delay( delay );&lt;br /&gt;
    HAL_GPIO_TogglePin( GPIOC, GPIO_PIN_7 );&lt;br /&gt;
    HAL_Delay( delay );&lt;br /&gt;
    HAL_GPIO_TogglePin( GPIOC, GPIO_PIN_6 );&lt;br /&gt;
    HAL_Delay( delay );&lt;br /&gt;
&lt;br /&gt;
  }&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
/** System Clock Configuration&lt;br /&gt;
*/&lt;br /&gt;
void SystemClock_Config(void)&lt;br /&gt;
{&lt;br /&gt;
&lt;br /&gt;
  RCC_OscInitTypeDef RCC_OscInitStruct;&lt;br /&gt;
  RCC_ClkInitTypeDef RCC_ClkInitStruct;&lt;br /&gt;
&lt;br /&gt;
  RCC_OscInitStruct.OscillatorType = RCC_OSCILLATORTYPE_HSI;&lt;br /&gt;
  RCC_OscInitStruct.HSIState = RCC_HSI_ON;&lt;br /&gt;
  RCC_OscInitStruct.HSICalibrationValue = 16;&lt;br /&gt;
  RCC_OscInitStruct.PLL.PLLState = RCC_PLL_NONE;&lt;br /&gt;
  HAL_RCC_OscConfig(&amp;amp;RCC_OscInitStruct);&lt;br /&gt;
&lt;br /&gt;
  RCC_ClkInitStruct.ClockType = RCC_CLOCKTYPE_SYSCLK;&lt;br /&gt;
  RCC_ClkInitStruct.SYSCLKSource = RCC_SYSCLKSOURCE_HSI;&lt;br /&gt;
  RCC_ClkInitStruct.AHBCLKDivider = RCC_SYSCLK_DIV1;&lt;br /&gt;
  RCC_ClkInitStruct.APB1CLKDivider = RCC_HCLK_DIV1;&lt;br /&gt;
  HAL_RCC_ClockConfig(&amp;amp;RCC_ClkInitStruct, FLASH_LATENCY_0);&lt;br /&gt;
&lt;br /&gt;
  HAL_SYSTICK_Config(HAL_RCC_GetHCLKFreq()/1000);&lt;br /&gt;
&lt;br /&gt;
  HAL_SYSTICK_CLKSourceConfig(SYSTICK_CLKSOURCE_HCLK);&lt;br /&gt;
&lt;br /&gt;
  /* SysTick_IRQn interrupt configuration */&lt;br /&gt;
  HAL_NVIC_SetPriority(SysTick_IRQn, 0, 0);&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
/** Configure pins as&lt;br /&gt;
        * Analog&lt;br /&gt;
        * Input&lt;br /&gt;
        * Output&lt;br /&gt;
        * EVENT_OUT&lt;br /&gt;
        * EXTI&lt;br /&gt;
*/&lt;br /&gt;
void MX_GPIO_Init(void)&lt;br /&gt;
{&lt;br /&gt;
&lt;br /&gt;
  GPIO_InitTypeDef GPIO_InitStruct;&lt;br /&gt;
&lt;br /&gt;
  /* GPIO Ports Clock Enable */&lt;br /&gt;
  __GPIOA_CLK_ENABLE();&lt;br /&gt;
  __GPIOC_CLK_ENABLE();&lt;br /&gt;
&lt;br /&gt;
  /*Configure GPIO pin : PA0 */&lt;br /&gt;
  GPIO_InitStruct.Pin = GPIO_PIN_0;&lt;br /&gt;
  GPIO_InitStruct.Mode = GPIO_MODE_INPUT;&lt;br /&gt;
  GPIO_InitStruct.Pull = GPIO_NOPULL;&lt;br /&gt;
  HAL_GPIO_Init(GPIOA, &amp;amp;GPIO_InitStruct);&lt;br /&gt;
&lt;br /&gt;
  /*Configure GPIO pins : PC6 PC7 PC8 PC9 */&lt;br /&gt;
  GPIO_InitStruct.Pin = GPIO_PIN_6|GPIO_PIN_7|GPIO_PIN_8|GPIO_PIN_9;&lt;br /&gt;
  GPIO_InitStruct.Mode = GPIO_MODE_OUTPUT_PP;&lt;br /&gt;
  GPIO_InitStruct.Pull = GPIO_NOPULL;&lt;br /&gt;
  GPIO_InitStruct.Speed = GPIO_SPEED_LOW;&lt;br /&gt;
  HAL_GPIO_Init(GPIOC, &amp;amp;GPIO_InitStruct);&lt;br /&gt;
&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
(&lt;br /&gt;
Note that pins -- among various other things -- can be customized in the CubeMX editor. Reexporting code to an existing project is straight forward, and can be done easily while the old Makefile keeps valid for minor changes... - However, STM32CubeMX looks still quite unfinished to me. It&#039;s a nice concept, but where are all the ST libraries, for example for the [http://www.st.com/web/en/catalog/tools/FM147/CL1794/SC961/SS1743/LN1734/PF258658# touch functionality]? It still needs to be downloaded separately... and it comes in a bloody EXE file as well! *arghs*&lt;br /&gt;
&lt;br /&gt;
Unfortunately, things seem to be a bit confusing. If you&#039;re using a STM32F0, then probably need to take a look into the [http://www.st.com/web/catalog/tools/FM147/CL1794/SC961/SS1743/LN1897/PF260612?icmp=pf260612_pron_nb_jun2014&amp;amp;sc=stm32cubef0-pr STM32CubeF0] software bundle, which contains a more up-to-date TouchSensing Library... Hm.&lt;br /&gt;
&lt;br /&gt;
Also, note that most of the provided code by ST is only documented in the source files themselves... And there are at least two vastly differing versions of the basic functions out there, what makes copy/pasting/sharing a bit difficult. I even don&#039;t know if they continue working on this code base, or if they switch over to [https://www.mbed.com/en/ mbed]. That seems to be the focus of those newer [http://www.st.com/web/catalog/tools/FM116/SC959/SS1532/LN1847?sc=stm32nucleo Nucleo] evaluation boards.&lt;br /&gt;
)&lt;br /&gt;
&lt;br /&gt;
=== Debugging: GDB ===&lt;br /&gt;
&lt;br /&gt;
GDB can be used to debug the code right on the hardware. While OpenOCD is running, you can connect to the target like this and step through the program:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
$ arm-none-eabi-gdb -tui build/STM32F072RBT6.elf&lt;br /&gt;
(...)&lt;br /&gt;
Reading symbols from build/STM32F072RBT6.elf...done.&lt;br /&gt;
&lt;br /&gt;
(gdb) target remote :3333&lt;br /&gt;
Remote debugging using :3333&lt;br /&gt;
Python Exception &amp;lt;type &#039;exceptions.NameError&#039;&amp;gt; Installation error: gdb.execute_u&lt;br /&gt;
nwinders function is missing:&lt;br /&gt;
HAL_GetTick () at Drivers/STM32F0xx_HAL_Driver/Src/stm32f0xx_hal.c:298&lt;br /&gt;
&lt;br /&gt;
(gdb) c&lt;br /&gt;
Continuing.&lt;br /&gt;
&lt;br /&gt;
Program received signal SIGINT, Interrupt.&lt;br /&gt;
0x080002f6 in HAL_Delay (Python Exception &amp;lt;type &#039;exceptions.NameError&#039;&amp;gt; Installa&lt;br /&gt;
tion error: gdb.execute_unwinders function is missing:&lt;br /&gt;
Delay=250)&lt;br /&gt;
    at Drivers/STM32F0xx_HAL_Driver/Src/stm32f0xx_hal.c:317&lt;br /&gt;
&lt;br /&gt;
(gdb) break main.c:91&lt;br /&gt;
Breakpoint 1 at 0x8001392: file Src/main.c, line 91.&lt;br /&gt;
&lt;br /&gt;
(gdb) c&lt;br /&gt;
Continuing.&lt;br /&gt;
Note: automatically using hardware breakpoints for read-only addresses.&lt;br /&gt;
Python Exception &amp;lt;type &#039;exceptions.NameError&#039;&amp;gt; Installation error: gdb.execute_u&lt;br /&gt;
nwinders function is missing:&lt;br /&gt;
&lt;br /&gt;
Breakpoint 1, main () at Src/main.c:91&lt;br /&gt;
&lt;br /&gt;
(...)&lt;br /&gt;
(gdb) detach&lt;br /&gt;
(qdb) quit&lt;br /&gt;
$&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
(Note: the -tui option is really great to inspect the code... see [http://ftp.gnu.org/old-gnu/Manuals/gdb-5.1.1/html_chapter/gdb_19.html GDB Text User Interface])&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== IDE: Eclipse SW4STM32 ===&lt;br /&gt;
&lt;br /&gt;
GOOD NEWS: This officially supported Eclipse variant works out of the box with STM32CubeMX generated project! You simply need to register on that site, and you&#039;ll get a software package that should work:&lt;br /&gt;
&lt;br /&gt;
[http://www.st.com/content/st_com/en/products/development-tools/software-development-tools/stm32-software-development-tools/stm32-ides/sw4stm32.html SW4STM32 - System Workbench for STM32: free IDE on Windows, Linux and OS X ]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
(Side note: I don&#039;t know how well it works when you have another Eclipse installed on your system... currently testing this out.)&lt;br /&gt;
&lt;br /&gt;
=== IDE: Eclipse with GNU ARM Eclipse plugin ===&lt;br /&gt;
&lt;br /&gt;
To use Eclipse as an IDE for the STM32s, just install Eclipse and a the GNU ARM Eclipse Plugin.&lt;br /&gt;
&lt;br /&gt;
* Eclipse IDE for C/C++ (CDT). This can be installed manually or with your package manager.&lt;br /&gt;
* Eclipse Plugin: [https://gnuarmeclipse.github.io/ GNU ARM Eclipse]. - This can be done in the Eclipse Marketplace (under &#039;&#039;Help &amp;gt; Eclipse Marketplace&#039;&#039; (use the default options)).&lt;br /&gt;
* Create a new Eclipse project with the GNU ARM Eclipse (Choose STM32Fxxx C/C++ Project in the Wizard)&lt;br /&gt;
&lt;br /&gt;
With some minor adjustments in the settings (OpenOCD), the basic Blinky example that comes with the plugin should work out of the box, with a STLink v2 programmer. Code completion etc. works fine too.&lt;br /&gt;
&lt;br /&gt;
(/todo: show every step)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
But there&#039;s quite annoying problem with this workflow!:&lt;br /&gt;
&lt;br /&gt;
http://www.carminenoviello.com/en/2015/06/04/stm32-applications-eclipse-gcc-stcube/:&lt;br /&gt;
&amp;lt;blockquote&amp;gt;&lt;br /&gt;
Unfortunately, the plug-in author has updated just the template for STM32-F4 family to the more recently STM32Cube-F4 HAL framework from ST (which still supports only commercial IDE.....), leaving the other templates still based on the old Standard Peripheral Library, which is no longer supported by ST and STM32CubeMX tool used in my tutorial. This causes my instructions to be wrong for processor families different from STM32-F4. &lt;br /&gt;
&amp;lt;/blockquote&amp;gt;&lt;br /&gt;
&lt;br /&gt;
So, several manual setup steps will be required to get started with your own STM32 project. To goal is to configure the project in STM32CubeMX, and use up-to-date HAL code, and not the deprecated Standard Peripheral Library.&lt;br /&gt;
&lt;br /&gt;
The GNU ARM Eclipse plugin is great, but doesn&#039;t create projects with up-to-date code. So we need to modify the manually created GNU ARM Eclipse project. - I used a custom STM32F072C8 board, and all steps below assum this hardware. The steps would be slightly different for other hardware.&lt;br /&gt;
&lt;br /&gt;
([http://www.carminenoviello.com/en/2015/06/04/stm32-applications-eclipse-gcc-stcube This tutorial] was helping here...)&lt;br /&gt;
&lt;br /&gt;
* First create a new &#039;C Project&#039; in your Eclipse workspace.&lt;br /&gt;
* In Wizard slide &#039;&#039;C Project&#039;&#039;: Choose Executable &amp;gt; &#039;&#039;Hello World ARM Cortex-M C/C++ Project&#039;&#039; and give it a name (e.g. testSTM32_00). This will generate a generic ARM project instead of an STM32Fxxx one. - Then hit &#039;&#039;Next&#039;&#039;.&lt;br /&gt;
* In Wizard slide &#039;&#039;Target processor settings&#039;&#039;: Configure the target processor: For the STM32F072C8: Change the defaults to Flash size (kB): 64, RAM size (kB): 16, Use system calls: Freestanding (no POSIX system calls), Trace output: None (no trace output). - Then hit &#039;&#039;Next&#039;&#039;.&lt;br /&gt;
* In Wizard slide &#039;&#039;Folders&#039;&#039;: Change Vendor CMSIS name to stm32f0xx. - Then hit next.&lt;br /&gt;
* In Wizard slide &#039;&#039;Select Configurations&#039;&#039;: Leave as is. - Then hit &#039;&#039;Next&#039;&#039;.&lt;br /&gt;
* In Wizard slide &#039;&#039;Cross GNU ARM Toolchain&#039;&#039;: Select &#039;&#039;GNU Tools for ARM Embedded Processors (arm-none-eabi-gcc)&#039;&#039; and either choose the global, system wide toolchain (probably in /usr/bin) or enter the path to your custom one. - Then hit &#039;&#039;Finish&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
This will create a generic ARM project, which should build without errors (hit Ctrl+B). &lt;br /&gt;
&lt;br /&gt;
Next, we need to add the vendor specific HAL code by ST generated with STM32CubeMX and/or downloaded in a more specific firmware package (STM32CubeF0, STM32CubeF4 etc.).&lt;br /&gt;
&lt;br /&gt;
...&lt;br /&gt;
So, after configuring a generic Eclipse project, we&#039;re ready to modify it.&lt;br /&gt;
&lt;br /&gt;
* Configure and export an EWARM project in [http://www.st.com/web/en/catalog/tools/PF259242 STM32CubeMX] (with default settings).&lt;br /&gt;
&lt;br /&gt;
* Extract the [http://www.st.com/web/en/catalog/tools/PF260612 STM32CubeF0] archive. ([http://www.st.com/web/en/catalog/tools/PF260820 STM32CubeF1], [http://www.st.com/web/en/catalog/tools/PF260266 STM32CubeF2], [http://www.st.com/web/en/catalog/tools/PF260613 STMCubeF3], [http://www.st.com/web/en/catalog/tools/PF259243 STMCubeF4]).&lt;br /&gt;
&lt;br /&gt;
As a starting point, here&#039;s a bash script, that modifies the previously created Eclipse project:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
#!/usr/bin/env bash&lt;br /&gt;
&lt;br /&gt;
set -e&lt;br /&gt;
&lt;br /&gt;
#echo &amp;quot;Press CTRL+C to proceed.&amp;quot;&lt;br /&gt;
#trap &amp;quot;pkill -f &#039;sleep 1h&#039;&amp;quot; INT&lt;br /&gt;
#trap &amp;quot;set +x ; sleep 1h ; set -x&amp;quot; DEBUG&lt;br /&gt;
&lt;br /&gt;
# MODIFY THIS!&lt;br /&gt;
ECLIPSE_PROJECT=/run/media/rel/prc/code/workspace_testSTM32_01/testSTM32_00&lt;br /&gt;
STM32CUBEF0=/home/rel/src/STM32Cube_FW_F0_V1.4.0&lt;br /&gt;
STM32CUBEMX=/home/rel/Desktop/test_stm32cubemx_ewarm&lt;br /&gt;
&lt;br /&gt;
echo --------------------------------------------------------------------------------&lt;br /&gt;
echo Eclipse Project Initializer for STM32F072 Dev&lt;br /&gt;
echo --------------------------------------------------------------------------------&lt;br /&gt;
&lt;br /&gt;
echo&lt;br /&gt;
echo The script is using the following paths:&lt;br /&gt;
echo&lt;br /&gt;
echo Eclipse Project:&lt;br /&gt;
echo $ECLIPSE_PROJECT&lt;br /&gt;
echo&lt;br /&gt;
echo STM32Cube:&lt;br /&gt;
echo $STM32CUBEF0&lt;br /&gt;
echo&lt;br /&gt;
echo STM32CubeMX:&lt;br /&gt;
echo $STM32CUBEMX&lt;br /&gt;
&lt;br /&gt;
echo&lt;br /&gt;
echo -n &amp;quot;Do you want to proceed? [ENTER]&amp;quot;&lt;br /&gt;
read&lt;br /&gt;
&lt;br /&gt;
echo&lt;br /&gt;
echo Deleting files from eclipse project:&lt;br /&gt;
rm -fv $ECLIPSE_PROJECT/src/main.c&lt;br /&gt;
rm -fv $ECLIPSE_PROJECT/src/Timer.c&lt;br /&gt;
rm -fv $ECLIPSE_PROJECT/include/Timer.h&lt;br /&gt;
&lt;br /&gt;
rm -fv $ECLIPSE_PROJECT/system/include/cmsis/stm32f0xx.h&lt;br /&gt;
rm -fv $ECLIPSE_PROJECT/system/include/cmsis/system_stm32f0xx.h&lt;br /&gt;
&lt;br /&gt;
rm -fv $ECLIPSE_PROJECT/system/src/cmsis/system_stm32f0xx.c&lt;br /&gt;
rm -fv $ECLIPSE_PROJECT/system/src/cmsis/vectors_stm32f0xx.c&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
echo&lt;br /&gt;
echo Copying: ST HAL:&lt;br /&gt;
cp -rfv $STM32CUBEF0/Drivers/STM32F0xx_HAL_Driver/Src/* \&lt;br /&gt;
$ECLIPSE_PROJECT/system/src/stm32f0xx&lt;br /&gt;
&lt;br /&gt;
cp -rfv $STM32CUBEF0/Drivers/STM32F0xx_HAL_Driver/Inc/* \&lt;br /&gt;
$ECLIPSE_PROJECT/system/include/stm32f0xx&lt;br /&gt;
&lt;br /&gt;
cp -rfv $STM32CUBEF0/Drivers/CMSIS/Device/ST/STM32F0xx/Include/* \&lt;br /&gt;
$ECLIPSE_PROJECT/system/include/cmsis&lt;br /&gt;
&lt;br /&gt;
cp -fv $STM32CUBEF0/Drivers/CMSIS/Device/ST/STM32F0xx/Source/Templates/gcc/startup_stm32f072xb.s \&lt;br /&gt;
$ECLIPSE_PROJECT/system/src/cmsis/startup_stm32f072xb.S&lt;br /&gt;
&lt;br /&gt;
cp -fv $STM32CUBEF0/Drivers/CMSIS/Device/ST/STM32F0xx/Source/Templates/system_stm32f0xx.c \&lt;br /&gt;
$ECLIPSE_PROJECT/system/src/cmsis&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
# echo Copying: example project from STM32CubeF0:&lt;br /&gt;
#cp $STM32CUBEF0/Projects/STM32F072B-Discovery/Examples/GPIO/GPIO_IOToggle/Inc/* \&lt;br /&gt;
#$ECLIPSE_PROJECT/include&lt;br /&gt;
&lt;br /&gt;
#cp $STM32CUBEF0/Projects/STM32F072B-Discovery/Examples/GPIO/GPIO_IOToggle/Src/main.c \&lt;br /&gt;
#$ECLIPSE_PROJECT/src&lt;br /&gt;
&lt;br /&gt;
#cp $STM32CUBEF0/Projects/STM32F072B-Discovery/Examples/GPIO/GPIO_IOToggle/Src/stm32f0xx_it.c \&lt;br /&gt;
#$ECLIPSE_PROJECT/src&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
echo&lt;br /&gt;
echo Copying: example project from STM32CubeMX:&lt;br /&gt;
cp $STM32CUBEMX/Src/* $ECLIPSE_PROJECT/src&lt;br /&gt;
cp $STM32CUBEMX/Inc/* $ECLIPSE_PROJECT/include&lt;br /&gt;
&lt;br /&gt;
echo&lt;br /&gt;
echo Modifiying/fixing the memory map:&lt;br /&gt;
echo $ECLIPSE_PROJECT/ldscripts/mem.ld&lt;br /&gt;
sed -i &#039;s/FLASH (rx) : ORIGIN = 0x00000000/FLASH (rx) : ORIGIN = 0x08000000/g&#039; $ECLIPSE_PROJECT/ldscripts/mem.ld&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
echo&lt;br /&gt;
echo SUCCESS&lt;br /&gt;
echo&lt;br /&gt;
&lt;br /&gt;
echo&lt;br /&gt;
echo Now, exclude the following file from the Eclipse project manually:&lt;br /&gt;
ls $ECLIPSE_PROJECT/system/src/stm32f0xx/stm32f0xx_hal_msp_template.c&lt;br /&gt;
&lt;br /&gt;
echo&lt;br /&gt;
echo And add the following preprocessor constants to the C/C++ compiler settings in Eclipse:&lt;br /&gt;
echo USE_HAL_DRIVER&lt;br /&gt;
echo STM32F072xB&lt;br /&gt;
&lt;br /&gt;
echo&lt;br /&gt;
echo &amp;quot;And add the following config options to the GDB OpenOCD Debugging settings (in Run Configurations):&amp;quot;&lt;br /&gt;
echo &amp;quot;-f interface/stlink-v2.cfg -f target/stm32f0x.cfg&amp;quot;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This script needs to be modified according to your needs! (Currently is working for the STM32F072C8, and contains fixed paths! - Note that there minor inconsistencies in some of these ST projects. For example, all the provided STM32F072xB* files by ST work for both types of chips -- STM32F072x8 and STM32F072xB.)&lt;br /&gt;
&lt;br /&gt;
Like described in the script above, some minor manual changes need to be made in Eclipse after running the script.&lt;br /&gt;
&lt;br /&gt;
This should now be a good basis to start a new STM32 project.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Note that the GNU ARM Eclipse plugin always generates a Makefile for every project configuration (Debug / Release). It can be found in &amp;lt;project_folder&amp;gt;/Debug pr &amp;lt;project_folder&amp;gt;/Release respectively.&lt;br /&gt;
&lt;br /&gt;
==== Semihosting ====&lt;br /&gt;
&lt;br /&gt;
http://infocenter.arm.com/help/index.jsp?topic=/com.arm.doc.dui0471c/Bgbjjgij.html:&lt;br /&gt;
&amp;lt;blockquote&amp;gt;&lt;br /&gt;
What is semihosting?&lt;br /&gt;
&lt;br /&gt;
Semihosting is a mechanism that enables code running on an ARM target to communicate and use the Input/Output facilities on a host computer that is running a debugger.&lt;br /&gt;
&lt;br /&gt;
Examples of these facilities include keyboard input, screen output, and disk I/O.&lt;br /&gt;
&amp;lt;/blockquote&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The GNU ARM Eclipse plugin comes with a really bare-bone implementation of some semihosting print functions that can be used to print logs to the console right in Eclipse (over GDB, without using any additional serial/UART connection whatsoever).&lt;br /&gt;
&lt;br /&gt;
Since I&#039;d always create a project without Semihosting enabled in the GNU ARM Eclipse wizard, you can still easily enable it later on:&lt;br /&gt;
&lt;br /&gt;
The easiest way I&#039;ve found so far, is by defining those Preprocessor constants in the C/C++ Project settings (Projects &amp;gt; Properties &amp;gt; C/C++ Build &amp;gt; Settings &amp;gt; Cross ARM GNU C/C++ Compiler &amp;gt; Preprocessor):&lt;br /&gt;
* TRACE&lt;br /&gt;
* OS_USE_TRACE_SEMIHOSTING_STDOUT&lt;br /&gt;
&lt;br /&gt;
And then, by using the following function calls in your code to log stuff to the Eclipse console right away:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
trace_initialize(); // in fact not required&lt;br /&gt;
// (...)&lt;br /&gt;
static int i = 0;&lt;br /&gt;
trace_puts( &amp;quot;hello&amp;quot; );&lt;br /&gt;
trace_printf( &amp;quot;nr %d\n&amp;quot;, i++ );&lt;br /&gt;
HAL_Delay( 1000 );  &lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
These functions were implemented by the author of GNU ARM Eclipse [https://github.com/ilg-ul Liviu Ionescu], and can be looked up in these files:&lt;br /&gt;
* &amp;lt;eclipse_project&amp;gt;/system/include/arm/semihosting.h&lt;br /&gt;
* &amp;lt;eclipse_project&amp;gt;/system/include/diag/Trace.h&lt;br /&gt;
* &amp;lt;eclipse_project&amp;gt;/system/src/diag/Trace.c&lt;br /&gt;
* &amp;lt;eclipse_project&amp;gt;/system/src/diag/trace_impl.c&lt;br /&gt;
&lt;br /&gt;
An interesting comment in &#039;&#039;trace_impl.c:133&#039;&#039; says:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
// Semihosting is the other output channel that can be used for the trace&lt;br /&gt;
// messages. It comes in two flavours: STDOUT and DEBUG. The STDOUT channel&lt;br /&gt;
// is the equivalent of the stdout in POSIX and in most cases it is forwarded&lt;br /&gt;
// to the GDB server stdout stream. The debug channel is a separate&lt;br /&gt;
// channel. STDOUT is buffered, so nothing is displayed until a \n;&lt;br /&gt;
// DEBUG is not buffered, but can be slow.&lt;br /&gt;
//&lt;br /&gt;
// Choosing between semihosting stdout and debug depends on the capabilities&lt;br /&gt;
// of your GDB server, and also on specific needs. It is recommended to test&lt;br /&gt;
// DEBUG first, and if too slow, try STDOUT.&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Note that semihosting needs to be enabled in your Eclipse run configuration (it is by default), in the Startup tab &amp;gt; Enable ARM semihosting. This will tell GDB to use semihosting. Without enabling, calls to those trace_* functions will throw some kind of exception... and make the processor halt. I couldn&#039;t find out much yet about how this feature really works, somehow it uses a special BKPT instruction...&lt;br /&gt;
&lt;br /&gt;
Semihosting (OS_USE_TRACE_SEMIHOSTING_STDOUT) can also be used in &amp;quot;Release&amp;quot; builds, since the semihosted calls don&#039;t rely on debug symbols.&lt;br /&gt;
&lt;br /&gt;
=== IDE: Code::Blocks ===&lt;br /&gt;
&lt;br /&gt;
My favorite cross-platform IDE for C/C++ is Code::Blocks. - And luckily, it also works well for ARM development! After twiddling around with those confusing Eclipse settings, I&#039;ve almost forgot to try out and setup Code::Blocks.&lt;br /&gt;
&lt;br /&gt;
The steps required are bit unintuitive, but building and debugging projects with full auto-complete and indexer support works now.&lt;br /&gt;
&lt;br /&gt;
The advantages over using Eclipse:&lt;br /&gt;
* Faster GUI.&lt;br /&gt;
* Works with STM32CubeMX generated code.&lt;br /&gt;
* Uses just a plain/manually editable Makefile to build the project.&lt;br /&gt;
* Familiar C/C++ settings and more *transparent* project handling -&amp;gt; Edit + debug. Nothing more. Everything can be done by hand on a console too. No mysterious hidden helpers...&lt;br /&gt;
&lt;br /&gt;
I&#039;m still evaluating this workflow... But to get things up and running, you can do this:&lt;br /&gt;
&lt;br /&gt;
(Assuming you already have a working Makefile based project, e.g. [http://wiki.sgmk-ssam.ch/wiki/STM32_dev#STM32CubeMX_to_Makefile created with STM32CubeMX, like described above]).&lt;br /&gt;
&lt;br /&gt;
* Open Code::Blocks and create an &#039;&#039;&#039;empty&#039;&#039;&#039; project (&#039;&#039;File &amp;gt; New &amp;gt; Project &amp;gt; Empty project&#039;&#039;).&lt;br /&gt;
* Give it a name in the Wizard, and choose the &#039;&#039;GNU GCC Compiler for ARM&#039;&#039;, and save it. &lt;br /&gt;
* Copy all content of the Makefile project over to Code::Blocks project folder.&lt;br /&gt;
* Import all required source files into the Code::Blocks workspace (right click -&amp;gt; &#039;&#039;Add files recursively...&#039;&#039;). &lt;br /&gt;
* Check &#039;&#039;Project &amp;gt; Properties &amp;gt; Project settings &amp;gt; Makefile: This is a custom Makefile&#039;&#039;.&lt;br /&gt;
* Adjust the build settings in &#039;&#039;Project &amp;gt; Build options &amp;gt; &amp;quot;Make commands&amp;quot;&#039;&#039;. - This might either require you to change the Makefile (i.e. add Debug/Release targets), or the commands. - For simplicity&#039;s sake, just ignore those $make, $makefile variables and overwrite them with your actual commands (i.e.&#039;&#039;$make -f $makefile $target&#039;&#039; -&amp;gt; &#039;&#039;make all&#039;&#039;).&lt;br /&gt;
* &#039;&#039;Build&#039;&#039; the project and check in the &#039;&#039;Build log&#039;&#039; if there where any errors/warnings.&lt;br /&gt;
&lt;br /&gt;
So, if this is working now, try to edit a source file and see if those really useful auto-complete and jump to declaration/implementation features are working. - One caveat of using an external Makefile is that the IDE doesn&#039;t know the current settings. So, for example, #defines are not available, and syntax highlighting will not update automatically... So it might be worth it add settings manually at some point.&lt;br /&gt;
&lt;br /&gt;
Now, to get the flashing and debugging working, try this:&lt;br /&gt;
&lt;br /&gt;
* Go to the &#039;&#039;Settings &amp;gt; Debugger&#039;&#039; Settings.&lt;br /&gt;
* Add a new GDB debugger setting (hit &#039;&#039;Create Config&#039;&#039; and call it &#039;&#039;ARM OpenOCD&#039;&#039; for example).&lt;br /&gt;
* Change the &#039;&#039;Executable path&#039;&#039; according to your toolchains location, and check &#039;Do *not* run the debugee&#039;.&lt;br /&gt;
* Go to &#039;&#039;Projects &amp;gt; Properties &amp;gt; Debugger&#039;&#039;.&lt;br /&gt;
** Change the &amp;lt;Project&amp;gt; &#039;&#039;Remote connection&#039;&#039; settings to IP: 127.0.0.1 / Port: 3333.&lt;br /&gt;
** Go to the &amp;lt;Project&amp;gt; &#039;&#039;Additional GDB commands&#039;&#039; tab. And enter those commands into the &#039;&#039;After connection&#039;&#039; box (change filename!):&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
monitor halt&lt;br /&gt;
load ./build/test.elf&lt;br /&gt;
file ./build/test.elf&lt;br /&gt;
monitor sleep 1000&lt;br /&gt;
monitor reset&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
To not run the program automatically, remove the last two commands. Then you need to &#039;&#039;Start / Continue&#039;&#039; the program twice, but you&#039;ll catch the first breakpoint you&#039;ve set!&lt;br /&gt;
* Choose &#039;&#039;Debug &amp;gt; Active Debuggers &amp;gt; GDB/CDB Debugger: ARM OpenOCD&#039;&#039;.&lt;br /&gt;
* Start OpenOCD in a terminal. (Described above).&lt;br /&gt;
* Start debugging by pressing the red arrow (Run / continue) in the debugging toolbar.&lt;br /&gt;
&lt;br /&gt;
The steps are the same as the ones in [http://www.hackvandedam.nl/blog/?p=707 this tutorial &#039;&#039;&#039;with screenshots&#039;&#039;&#039;].&lt;br /&gt;
&lt;br /&gt;
=== stlink ===&lt;br /&gt;
&lt;br /&gt;
[https://github.com/texane/stlink stlink] is a command line tool for programming, inspecting and debugging the STM32 microcontrollers. It also used internally by OpenOCD (I think). - It comes with several small programs (st-flash, st-info, st-term, st-util) that can come in handy while working with the STM32 micros.&lt;br /&gt;
&lt;br /&gt;
There&#039;s a tutorial:&lt;br /&gt;
https://github.com/texane/stlink/blob/master/doc/tutorial/tutorial.pdf&lt;br /&gt;
&lt;br /&gt;
Some useful things I&#039;ve discovered:&lt;br /&gt;
&lt;br /&gt;
Just run st-util can Ctrl-C again to see all relevant uC properties:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
$ st-util&lt;br /&gt;
2016-01-29T13:06:25 INFO src/stlink-common.c: Loading device parameters....&lt;br /&gt;
2016-01-29T13:06:25 INFO src/stlink-common.c: Device connected is: F07x device, id 0x20016448&lt;br /&gt;
2016-01-29T13:06:25 INFO src/stlink-common.c: SRAM size: 0x4000 bytes (16 KiB), Flash: 0x10000 bytes (64 KiB) in pages of 2048 bytes&lt;br /&gt;
2016-01-29T13:06:25 INFO gdbserver/gdb-server.c: Chip ID is 00000448, Core ID is  0bb11477.&lt;br /&gt;
2016-01-29T13:06:25 INFO gdbserver/gdb-server.c: Target voltage is 3554 mV.&lt;br /&gt;
2016-01-29T13:06:25 INFO gdbserver/gdb-server.c: Listening at *:4242...&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Or with st-info:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
$ st-info &lt;br /&gt;
st-info --flash&lt;br /&gt;
st-info --sram&lt;br /&gt;
st-info --descr&lt;br /&gt;
st-info --pagesize&lt;br /&gt;
st-info --chipid&lt;br /&gt;
$ st-info --flash&lt;br /&gt;
0x10000&lt;br /&gt;
$ st-info --sram&lt;br /&gt;
0x4000&lt;br /&gt;
$ st-info --descr&lt;br /&gt;
F07x device&lt;br /&gt;
$ st-info --pagesize&lt;br /&gt;
0x800&lt;br /&gt;
$ st-info --chipid&lt;br /&gt;
0x0448&lt;br /&gt;
&lt;br /&gt;
$ echo `st-info --sram | xargs -I@ printf &amp;quot;%d/1024\n&amp;quot; @ | bc`kB RAM&lt;br /&gt;
16kB RAM&lt;br /&gt;
$ echo `st-info --flash | xargs -I@ printf &amp;quot;%d/1024\n&amp;quot; @ | bc`kB FLASH&lt;br /&gt;
64kB FLASH&lt;br /&gt;
&lt;br /&gt;
$ for a in sram flash pagesize; do echo `st-info --$a | xargs -I@ printf &amp;quot;%d/1024\n&amp;quot; @ | bc`kb $a; done&lt;br /&gt;
16kb sram&lt;br /&gt;
64kb flash&lt;br /&gt;
2kb pagesize&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Links ===&lt;br /&gt;
&lt;br /&gt;
==== Tools ====&lt;br /&gt;
* [https://gnuarmeclipse.github.io/ GNU ARM Eclipse]: [https://gnuarmeclipse.github.io/eclipse/workspace/preferences/ workspace_preferences], [http://gnuarmeclipse.github.io/toolchain/path/ toolchain_path], [http://gnuarmeclipse.github.io/eclipse/project/portability/ project_portability]&lt;br /&gt;
&lt;br /&gt;
==== Tutorials ====&lt;br /&gt;
* Great introduction: [http://www.triplespark.net/elec/pdev/arm/stm32.html Programming STM32 F2, F4 ARMs under Linux: A Tutorial from Scratch]&lt;br /&gt;
* STM32Cube to GNU ARM Eclipse tips: http://www.carminenoviello.com/en/2015/06/04/stm32-applications-eclipse-gcc-stcube/&lt;br /&gt;
* Micro Python on STM32F4-Discovery: http://gpio.kaltpost.de/?p=2082&lt;br /&gt;
* Logs: https://hackaday.io/project/4277/logs?page=2&lt;br /&gt;
* Code::Blocks tutorial: http://www.hackvandedam.nl/blog/?p=707&lt;br /&gt;
* Eclipse tutorial: http://www.carminenoviello.com/en/2015/06/04/stm32-applications-eclipse-gcc-stcube&lt;br /&gt;
* http://sigalrm.blogspot.ch/2013/12/using-ccm-memory-on-stm32.html&lt;br /&gt;
* http://stm32f4-discovery.com/2014/08/stm32f4-external-interrupts-tutorial/&lt;br /&gt;
* ...&lt;br /&gt;
&lt;br /&gt;
==== Projects / Demos / Code ====&lt;br /&gt;
* MrBlueXav&#039;s Synths: https://github.com/MrBlueXav&lt;br /&gt;
* cliffle&#039;s VGA stuff: https://github.com/cbiffle/m4vgalib-demos, http://cliffle.com/article/2015/06/05/introducing-glitch/&lt;br /&gt;
* ESPruino code: https://github.com/espruino/Espruino -&amp;gt; STM32F401CDU6&lt;br /&gt;
* STM32F4 Audio Codec Board: http://ebrombaugh.studionebula.com/synth/stm32f4_codec/&lt;br /&gt;
* ESPRUINO: http://www.espruino.com/ReferenceSTM32F4DISCOVERY&lt;br /&gt;
* micropython: https://github.com/micropython/micropython&lt;br /&gt;
* STM32F4 DIY: http://mikrocontroller.bplaced.net/wordpress/?page_id=1482&lt;br /&gt;
* STM32F4 overclocking: http://sigalrm.blogspot.ch/2014/01/overclocking-stm32f4.html&lt;br /&gt;
* thermal camera: http://www.theresistornetwork.com/2014/11/flir-lepton-thermal-imaging-sensor.html&lt;br /&gt;
* STM32F7: http://hackaday.com/2015/06/26/new-part-day-stm32f7-an-arm-cortex-m7/&lt;br /&gt;
* Karsten Schmidt: http://workshop.thi.ng/ [https://soundcloud.com/forthcharlie soundcloud] https://github.com/thi-ng/ws-ldn-4 https://github.com/thi-ng/ws-ldn-3 http://asm.thi.ng/&lt;br /&gt;
* Peridrummmm Demo: http://www.pouet.net/prod.php?which=59095 with sources: http://aka-san.halcy.de/revision2012/peridiummmm-src.zip&lt;br /&gt;
* Andy&#039;s Workshop: http://andybrown.me.uk/&lt;br /&gt;
* axoloti: http://axoloti.com/&lt;br /&gt;
&lt;br /&gt;
==== Libraries ====&lt;br /&gt;
* libopencm3 http://libopencm3.org/wiki/Main_Page&lt;br /&gt;
* list of libs: http://mikrocontroller.bplaced.net/wordpress/?page_id=2736&lt;br /&gt;
&lt;br /&gt;
==== OS ====&lt;br /&gt;
* FreeRTOS: http://www.freertos.org/index.html&lt;br /&gt;
* Embedded Linux on STM32: https://github.com/EmcraftSystems&lt;br /&gt;
* ChibiOS: http://www.chibios.org/dokuwiki/&lt;br /&gt;
&lt;br /&gt;
==== General ====&lt;br /&gt;
* ARM Related Books: http://www.arm.com/support/resources/arm-books/&lt;br /&gt;
* STM32 Overview http://www.st.com/web/en/catalog/mmc/FM141/SC1169?sc=stm32&lt;br /&gt;
* mbed https://en.wikipedia.org/wiki/Mbed&lt;br /&gt;
* CMSIS: http://www.keil.com/pack/doc/cmsis/Core/html/index.html&lt;br /&gt;
&lt;br /&gt;
== Hardware ==&lt;br /&gt;
&lt;br /&gt;
All about hardware and hardware tools for STM32 dev. Chips, programmers etc.&lt;br /&gt;
&lt;br /&gt;
=== ST-Link V2 Programmer ===&lt;br /&gt;
&lt;br /&gt;
There are two popular ST-Link V2 Progammers on the market. They have a different pinout but work both well like described above.&lt;br /&gt;
&lt;br /&gt;
[[File:ST-LinkV2_pinout_01.jpg]]&lt;br /&gt;
&lt;br /&gt;
Alternatively, STM32Discovery/[http://jeelabs.org/book/1547a/index.html Nucleo boards too can be used as SWD programmers].&lt;br /&gt;
&lt;br /&gt;
Luckily, only 4 pins have to be used to program and debug the target!&lt;br /&gt;
To find out more about this protocol, have a look into [http://www.arm.com/products/system-ip/debug-trace/coresight-soc-components/serial-wire-debug.php Serial Debug Wire (SWD)] as an alternative to JTAG.&lt;br /&gt;
&lt;br /&gt;
Connect to following pins of the programmer to the corresponding pins on the PCB:&lt;br /&gt;
&lt;br /&gt;
* V3V&lt;br /&gt;
* GND&lt;br /&gt;
* SWCLK&lt;br /&gt;
* SWDIO&lt;br /&gt;
&lt;br /&gt;
-&amp;gt; NRST can be important too on some STM32 chips!&lt;br /&gt;
&lt;br /&gt;
Remember: These are &#039;&#039;&#039;not&#039;&#039;&#039; the [http://www.st.com/web/catalog/tools/FM146/CL1984/SC724/SS1677/PF251168 official ST-Link V2 Programmers], sold by ST.&lt;br /&gt;
&lt;br /&gt;
== Projects ==&lt;br /&gt;
&lt;br /&gt;
STM32 based projects.&lt;br /&gt;
&lt;br /&gt;
=== STM32basic ===&lt;br /&gt;
&lt;br /&gt;
STM32basic is a test board to see how STM32 chips can be used in DIY circuits.&lt;br /&gt;
&lt;br /&gt;
==== STM32basic rev0.01 ====&lt;br /&gt;
&lt;br /&gt;
An initial list of tests:&lt;br /&gt;
&lt;br /&gt;
* JTAG: See how we can program the thing. Do we need all JTAG pins? Or only the SWD pins? What about reset? - Do the cheapo Chinese STLink V2 programmer really work?&lt;br /&gt;
* Basic I/O: LED and push button.&lt;br /&gt;
* U(S)ART: Check whether it&#039;s possible to hook up an FTDI to send/receive characters to/from the STM32basic?&lt;br /&gt;
* BOOT0/1: What about those boot modes?&lt;br /&gt;
* Power Usage : 3V3 Regulator: ..&lt;br /&gt;
&lt;br /&gt;
[[File:STM32basic_pcb1b.jpg]]&lt;br /&gt;
&lt;br /&gt;
Board at OSH Park:&amp;lt;br /&amp;gt;&lt;br /&gt;
https://oshpark.com/shared_projects/kCD7Yr0A&lt;br /&gt;
&lt;br /&gt;
KiCad project and everything else:&amp;lt;br /&amp;gt;&lt;br /&gt;
Remark: this has been made in hurry and is just a test:&amp;lt;br /&amp;gt;&lt;br /&gt;
http://0rel.com/prj/STM32basic/STM32basic_rev0.01.zip&lt;br /&gt;
&lt;br /&gt;
[[File:Stm32basic1.jpg]]&lt;br /&gt;
&lt;br /&gt;
So far, the tests have been working ok.&lt;br /&gt;
&lt;br /&gt;
* STLink V2 programmers seem to work fine, and only require 2 pins + VCC/GND! SWDIO and SWCLK, that&#039;s it! For programming and on-chip debugging.&lt;br /&gt;
* I/O works as well. External interrupts can be configured.&lt;br /&gt;
* UART works, but I have not yet tested it with a proper code. It was working with some echo snippet I&#039;ve found somewhere.&lt;br /&gt;
* Power usage is low. ~15 mA at 3.3 V.&lt;br /&gt;
* BOOT0 jumper has to be set (connected to ground) in order to run code... - Other boot modes have not been tested yet. More tests are needed there... What are the other available boot modes, what about those built-in boot loaders?&lt;br /&gt;
&lt;br /&gt;
However, the board has several flaws:&lt;br /&gt;
* 1.27 mm pin-pitch headers cannot be arranged like that (GPIOs). They need to be further apart to make sockets/headers fit.&lt;br /&gt;
* 3V3 LDO doesn&#039;t make much sense like this. Add add a buck/boost converter. Also remove 5V label.&lt;br /&gt;
* This BOOT0 jumper isn&#039;t nice like this...&lt;br /&gt;
* Remove unnecessary JTAG pins. SWD only.&lt;br /&gt;
* Remove unnecessary USART pins.&lt;br /&gt;
* Add crystal.&lt;br /&gt;
* Add USB plug.&lt;br /&gt;
&lt;br /&gt;
Probably, this will not be remade, since it was enough for a test. I&#039;d like to make a very basic USB touch device next.&lt;br /&gt;
&lt;br /&gt;
==== STM32basic Eclipse project ====&lt;br /&gt;
&lt;br /&gt;
Test project to see if GPIOs with External interrupts and semi hosting works. Sloppy and not cleaned up yet...&amp;lt;br /&amp;gt;&lt;br /&gt;
http://0rel.com/prj/STM32basic/testSTM32F072_interrupt_test0.zip&lt;br /&gt;
&lt;br /&gt;
Note: Eclipse projects can be imported in an existing or new workspace with: &#039;&#039;File &amp;gt; Import &amp;gt; General &amp;gt; Existing Projects into Workspace&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
=== todo ===&lt;br /&gt;
&lt;br /&gt;
* I2C peripherals&lt;br /&gt;
* I2S peripherals&lt;br /&gt;
* SPI peripherals&lt;br /&gt;
* touch&lt;br /&gt;
* usb&lt;br /&gt;
* external memory (sram, flash, eeprom...) -&amp;gt; RTOS / Linux / ChibiOS? (similar to this http://hforsten.com/making-embedded-linux-computer.html)?&lt;br /&gt;
.....&lt;/div&gt;</summary>
		<author><name>0rel</name></author>
	</entry>
</feed>