• Stars
    star
    123
  • Rank 290,145 (Top 6 %)
  • Language
    C
  • Created over 12 years ago
  • Updated about 2 years ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

A template for builting STM23F0 ARM projects with GCC

#STM32F0-Discovery Application Template This package is for use when compiling programs for STM32F05xx ARM microcontrollers using arm-none-eabi-gcc (I'm using the Code Sourcery G++:Lite Edition toolchain). The Makefile in the main directory will call the Make file in the Libraries directory, thereby automatically building the STM peripheral library. However, running 'make clean' will not affect the peripherals library (the same command can be run from the Libraries directory to do this).

This template will serve as a quick-start for those who do not wish to use an IDE, but rather develop in a text editor of choice and build from the command line. It is based on an example template for the F4 Discovery board put together by Jeremy Herbert.

##Subfolders:

  1. Library/

    • This is the Library/ folder from the STM32F0xx_StdPeriph_Lib_V1.0.0 standard peripheral driver library produced by STM. This preserves the original structure which should make it easy to roll in library upgrades as they are published
    • Makefile is not part of the STM release, and must be copied over if the library is upgraded.
    • stm32f0xx_conf.h is used to configure the peripheral library. It must be copied here if the library is upgraded. The file was file taken from the STM32F0-Discovery firmware package. It is found in the following directory:
      • Project/Demonstration/
    • Abstracting the libraries: You may place this folder anywhere you like in order to use it for multiple projects. Just change the path of the STD_PERIPH_LIB variable in the Makefile
  2. Device/

    • Folder contains device specific files:
    • startup_stm32f0xx.s is the startup file taken from the STM32F0-Discovery firmware package. It is found in the following directory:
      • Libraries/CMSIS/ST/STM32F0xx/Source/Templates/TrueSTUDIO/
    • Linker Scripts (Device/ldscripts)
      • These linker scripts are used instead of the stm32_flash.ld script which is included in the STM demo code. This is because the original file contains an unreasonably restrictive copyright assertion.
  3. inc/

    • All include files for this particular project.
  4. src/

    • All source files for this particular project (including main.c).
    • system_stm32f0xx.c can be generated using an XLS file developed by STM. This sets up the system clock values for the project. The file included in this repository is taken from the STM32F0-Discovery firmware package. It is found in the following directory:
      • Libraries/CMSIS/ST/STM32F0xx/Source/Templates/
  5. extra/

    • This contains a procedure file used to write the image to the board via OpenOCD
    • Abstracting the extra folder: the .cfg file in the extra folder may be placed anywhere so that multiple projects can use one file. Just change the OPENOCD_PROC_FILE variable in the Make file to match the new location.

##Loading the image on the board

If you have OpenOCD installed 'make program' can be used to flash the .bin file to the board. OpenOCD must be installed with stlink enabled. Clone the git repository and use these commands to compile/install it:

./bootstrap
./configure --prefix=/usr --enable-maintainer-mode --enable-stlink
make 
sudo make install

If there is an error finding the .cfg file, please double-check the OPENOCD_BOARD_DIR constant at the top of the Makefile (in this template directory, not in OpenOCD).

###UDEV Rule for the Discovery Board

If you are not able to communicate with the STM32F0-Discovery board without root privileges you should follow the step from the stlink repo readme file for adding a udev rule for this hardware.

##Compiling your own toolchain It might be best to use a precompiled toolchain liked CodeSourcery G++: Lite Edition. But if you would prefer to compile your own, give this guide (link dead, try the Internet Archive)a try. Just google for the source code to make sure you're using the most recent versions. GCC now comes with the core and g++ code all in one archive.

###Possible compiling errors:

  • You may encouter unfulfilled dependecies when it comes to GMP, MPFR and MPC. According to the GCC installation Wiki you should install the following packages: libgmp-dev libmpfr-dev libmpc-dev. If that doesn't work, read the linked Wiki for further options.
  • If you get the error: "configure: error: Link tests are not allowed after GCC_NO_EXECUTABLES" try adding the following flags when configuring GCC: "--with-system-zlib --disable-shared"

More Repositories

1

matrixman

A pixel-sized game for 32x32 Matrix
C
31
star
2

tiva-c-launchpad-hardware-pwm

This is an example of how to use hardware PWM on a Tiva C Launchpad board
C
16
star
3

Shift-Registers-SPI

Driving shift registers with AVR SPI
C
16
star
4

had_AVRtut_2

Hackaday AVR programming tutorial part 2
C
14
star
5

bluepill-opencm3

STM32F103 "Bluepill" Framework using libopencm3
Makefile
10
star
6

stm32-snake-game

Classic game of snake for STM32 F0 Discovery board
C
8
star
7

Conway-s-Game-of-Life--Python-

Python implementation of Conway's Game of Life using pygame
Python
7
star
8

tiva-c-launchpad-template

Template for Tiva C Launchpad using GCC; depends on TivaWare
Perl
7
star
9

Light-Programmer

Push messages from a webpage to a uC via CdS Photoresistor using Manchester Encoding
C
7
star
10

F2013-hello-world

Hello world using TI eZ430-F2013 and Nokia 3595 LCD
C
6
star
11

sand-ular-automata

Cellular automata for sand
C++
6
star
12

had_launchpad-blink

Programming with the MSP430 Launchpad on Linux
C
6
star
13

Binary-Coded-Modulation

Method of using BCM instead of PWM
Makefile
5
star
14

Larson-Scanner

Larson Scanner using AVR and 8 LEDs
Makefile
5
star
15

stellaris-ks0108

KS0108 Graphic LCD Library for the TI Stellaris Launchpad
C
4
star
16

Automatic-Daylight-Savings-Time

Functions that will allow embedded clocks to make daylight savings time changes automatically
C
4
star
17

had_AVRtut_4

Example files for Hackaday AVR tutorial part 4
C
3
star
18

STM32-rotating-cube

C
3
star
19

kicad_to_neoden

Python script to translate KiCad position file to NeoDen 4 pick and place CSV file
Python
3
star
20

Assembler-Experiments

dabbling with AVR-GCC and assembly code
Assembly
3
star
21

wemoswitch-to-mqtt

MQTT control for a Wemo smart switch
Python
2
star
22

coinop-badge

Hardware badge homage to my favorite coinop video game
C
2
star
23

belgrade-hackaday-badge

Firmware hacking for the Hackaday Belgrade Conference badge
C
2
star
24

trinket-pro-dds

Direct Digital Synthesis examples using a Trinket Pro (ATmega328p)
Makefile
2
star
25

embedded-sieve-of-eratosthenes

Use a microcontroller to find prime numbers
C
2
star
26

arduino-character-life

Conway's Game of Life on an Character LCD using custom characters
Arduino
2
star
27

had_pumpkin

70 LED matrix inside of a real pumpkin
C
2
star
28

LED-menorah

menorah using charliplexed LEDs and an ATtiny13
C
2
star
29

slowmovie

Play one frame per minute of a movie on an ePaper display
Python
2
star
30

Sylvania-LED-firmware

Custom firmware for the ATtiny13 inside of a commercial color changing bulb
C
2
star
31

Button-Debounce

My edited version of Danni Debounce
C
2
star
32

Ping-Pong-Clock

LED clock using ping-pong-balls as diffusers
C
2
star
33

okay-to-wake-clock

Kids' clock that tells time with colors so they know when to stay in or get out of bed
C++
1
star
34

myth2kodi-fuzzy-python

Python implementation of fuzzy search for myth2kodi style TV episode identification
Python
1
star
35

pid_balancer

Balance a ping pong ball using a PID loop
C++
1
star
36

elliptical-mqtt

Connector to read elliptical trainer LCD SPI traffic and convert to MQTT messages
C++
1
star
37

card10-hackaday-logo

Putting the Hackaday logo on the card10 badge
Python
1
star
38

ellipticalDisplay

Building an auxiliary display for an elliptical exercise machine
Python
1
star
39

1080-to-DVD-transcoding

Transcodes ATSC recordings to DVD quality
Shell
1
star
40

esp32-roku-remote

C++
1
star
41

Binary-Burst-Clock

Binary clock that uses spires at each tick mark
C
1
star
42

RecipeBrowser

Android app to collect recipes from an online directory and cache them on the device
Kotlin
1
star
43

apa102-pov

A spinning POV display using APA102 RGB LED pixels
KiCad Layout
1
star
44

radio_show_downloader

Give it a show URL and it'll fetch all segments, concatenate them, and set the MP3 tag
Python
1
star
45

Chumby-Word-Clock

Word clock for the Chumby 8 and Infocast 8
Haxe
1
star
46

SloJak

Interactive messaging badge idea I'm playing around with
C
1
star
47

Android-binary-ASCII-entry-test-app

Demo application for entering binary-encoded ASCII characters
Java
1
star
48

supercon-badge-hourglass

Digital hourglass simulation for the 2022 Hackaday Superconference badge
Assembly
1
star
49

595-Larson-Scanner

Larson Scanner based on 595 shift registers and Binary Coded Modulation
C
1
star
50

avr-i2c

Hardware and software based i2c for AVR microcontroller
Makefile
1
star
51

pennyArt

Playing around with a penny mosaic generator written in python
Python
1
star