Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

stm32f429i-disco: slightly interactive display demo with fonts and vector graphics #141

Open
wants to merge 7 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,11 @@
*.list
*.map
*.stylecheck
nbproject
generated.*.ld
.gdb_history
.DS_Store

# Project files from idea/netbeans/eclipse
nbproject/
.idea/
.project
16 changes: 16 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
language: c
script:
- make

addons:
apt:
sources:
- sourceline: 'ppa:team-gcc-arm-embedded/ppa'
packages:
- gcc-arm-embedded

notifications:
irc:
channels:
- "chat.freenode.net#libopencm3"
use_notice: true
5 changes: 4 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ TARGETS += lpc/lpc13xx lpc/lpc17xx #lpc/lpc43xx
TARGETS += tiva/lm3s tiva/lm4f
TARGETS += efm32/efm32tg efm32/efm32g efm32/efm32lg efm32/efm32gg
TARGETS += vf6xx
TARGETS += sam/d

# Be silent per default, but 'make V=1' will show all compiler calls.
ifneq ($(V),1)
Expand Down Expand Up @@ -73,7 +74,9 @@ $(EXAMPLE_DIRS): lib
examples: $(EXAMPLE_DIRS)
$(Q)true

clean: $(EXAMPLE_DIRS:=.clean) styleclean
examplesclean: $(EXAMPLE_DIRS:=.clean)

clean: examplesclean styleclean
$(Q)$(MAKE) -C libopencm3 clean

stylecheck: $(EXAMPLE_DIRS:=.stylecheck)
Expand Down
84 changes: 14 additions & 70 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
# README
[![Build Status](https://travis-ci.org/libopencm3/libopencm3-examples.svg?branch=master)](https://travis-ci.org/libopencm3/libopencm3-examples)

[![Gitter channel](https://badges.gitter.im/libopencm3/discuss.svg)](https://gitter.im/libopencm3/discuss)

Expand All @@ -10,7 +11,9 @@ various ARM Cortex-M microcontrollers.
For more information visit http://libopencm3.org

The examples are meant as starting points for different subsystems on multitude
of platforms.
of platforms. If you're just looking to test your build environment and hardware,
the [libopencm3-miniblink](https://github.com/libopencm3/libopencm3-miniblink)
may be more useful, as it covers _many_ more boards, but it is much more limited.

Feel free to add new examples and send them to us either via the mailinglist or
preferably via a github pull request.
Expand All @@ -29,34 +32,30 @@ The makefiles are generally useable for your own projects with
only minimal changes for the libopencm3 install path (See Reuse)

## Make Flash Target

Please note, the "make flash" target is complicated and not always self-consistent. Please see: https://github.com/libopencm3/libopencm3-examples/issues/34

For flashing the 'miniblink' example (after you built libopencm3 and the
examples by typing 'make' at the top-level directory) onto the Olimex
STM32-H103 eval board (ST STM32F1 series microcontroller), you can execute:

cd examples/stm32/f1/stm32-h103/miniblink
make flash
make flash V=1

The Makefiles of the examples are configured to use a certain OpenOCD
flash programmer, you might need to change some of the variables in the
Makefile if you use a different one.

The make flash target also supports a few other programmers. If you provide the
Black Magic Probe serial port the target will automatically choose to program
via Black Magic Probe. For example on linux you would do the following:
To program via a Black Magic Probe, simply provide the serial port, eg:

cd examples/stm32/f1/stm32-h103/miniblink
make flash BMP_PORT=/dev/ttyACM0

This will also work with discovery boards that got the st-link firmware
replaced with the Black Magic Probe firmware.

In case you did not replace the firmware you can program using the st-flash
program by invoking the stlink-flash target:
To program via texane/stlink (st-flash utility), use the special target:

cd examples/stm32/f1/stm32vl-discovery/miniblink
make miniblink.stlink-flash


If you rather use GDB to connect to the st-util you can provide the STLINK\_PORT
to the flash target.

Expand Down Expand Up @@ -114,69 +113,14 @@ This example uses the st-util by texane that you can find on [GitHub](https://gi

cd examples/stm32/f1/stm32vl-discovery/miniblink
arm-none-eabi-gdb miniblink.elf
tar extended-remote :4242
target extended-remote :4242
load
run

## Reuse

If you want to use libopencm3 in your own project, this examples repository
shows the general way. (If there's interest, we can make a stub template
repository)

1. Create an empty repository

mkdir mycoolrobot && cd mycoolrobot && git init .

2. Add libopencm3 as a submodule

git submodule add https://github.com/libopencm3/libopencm3


3. Grab a copy of the basic rules
These urls grab the latest from the libopencm3-examples repository

wget \
https://raw.githubusercontent.com/libopencm3/libopencm3-examples/master/examples/Makefile.rules \
-O libopencm3.rules.mk

4. Grab a copy of your target Makefile in this case, for STM32L1

wget \
https://raw.githubusercontent.com/libopencm3/libopencm3-examples/master/examples/stm32/l1/Makefile.include \
-O libopencm3.target.mk

5. Edit paths in `libopencm3.target.mk`
Edit the _last_ line of `libopencm3.target.mk` and change the include to read
include `../libopencm3.rules.mk` (the amount of .. depends on where you put your
project in the next step..

6. beg/borrow/steal an example project
For sanity's sake, use the same target as the makefile you grabbed up above)

cp -a \
somewhere/libopencm3-examples/examples/stm32/l1/stm32ldiscovery/miniblink \
myproject

Add the path to OPENCM3\_DIR, and modify the path to makefile include

If you want to use libopencm3 in your own project, the _easiest_ way is
to use the template repository we created for this purpose.

diff -u
---
2014-01-24 21:10:52.687477831 +0000
+++ Makefile 2014-03-23 12:27:57.696088076 +0000
@@ -19,7 +19,8 @@

BINARY = miniblink

+OPENCM3_DIR=../libopencm3
LDSCRIPT = $(OPENCM3_DIR)/lib/stm32/l1/stm32l15xxb.ld

-include ../../Makefile.include
+include ../libopencm3.target.mk

You're done :)
See https://github.com/libopencm3/libopencm3-template

You need to run "make" inside the libopencm3 directory once to build the
library, then you can just run make/make clean in your project directory as
often as you like.
4 changes: 2 additions & 2 deletions examples/lpc/lpc13xx/Makefile.include
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ ARCH_FLAGS = -mthumb -mcpu=cortex-m3 $(FP_FLAGS) -mfix-cortex-m3-ldrd

OOCD ?= openocd
OOCD_INTERFACE ?= flossjtag
OOCD_BOARD ?= olimex_stm32_h103
OOCD_TARGET ?= lpc13xx

################################################################################
# Black Magic Probe specific variables
Expand All @@ -41,4 +41,4 @@ BMP_PORT ?=
#STLINK_PORT ?= :4242


include ../../../../Makefile.rules
include ../../../../rules.mk
2 changes: 1 addition & 1 deletion examples/lpc/lpc13xx/lpc-p1343/lpc-p1343.ld
Original file line number Diff line number Diff line change
Expand Up @@ -27,4 +27,4 @@ MEMORY
}

/* Include the common ld script. */
INCLUDE libopencm3_lpc13xx.ld
INCLUDE cortex-m-generic.ld
4 changes: 2 additions & 2 deletions examples/lpc/lpc17xx/Makefile.include
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ ARCH_FLAGS = -mthumb -mcpu=cortex-m3 $(FP_FLAGS) -mfix-cortex-m3-ldrd

OOCD ?= openocd
OOCD_INTERFACE ?= flossjtag
OOCD_BOARD ?= olimex_stm32_h103
OOCD_TARGET ?= lpc17xx

################################################################################
# Black Magic Probe specific variables
Expand All @@ -42,4 +42,4 @@ BMP_PORT ?=
#STLINK_PORT ?= :4242


include ../../../../Makefile.rules
include ../../../../rules.mk
Original file line number Diff line number Diff line change
Expand Up @@ -29,4 +29,4 @@ MEMORY
}

/* Include the common ld script. */
INCLUDE libopencm3_lpc17xx.ld
INCLUDE cortex-m-generic.ld
4 changes: 2 additions & 2 deletions examples/lpc/lpc43xx/Makefile.include
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ ARCH_FLAGS = -mthumb -mcpu=cortex-m4 $(FP_FLAGS)

OOCD ?= openocd
OOCD_INTERFACE ?= flossjtag
OOCD_BOARD ?= olimex_stm32_h103
OOCD_TARGET ?= lpc4357

################################################################################
# Black Magic Probe specific variables
Expand All @@ -44,4 +44,4 @@ BMP_PORT ?=
#STLINK_PORT ?= :4242


include ../../../../Makefile.rules
include ../../../../rules.mk
Loading