[stm32l1] Add semihosting example

This is not specifically an L1 example, but it lives beside the L1 "usart"
example to show how easy it is to add semihosting support to existing code.

Tested with the by now relatively old g-a-e 2012q4 release and
OpenOcd 0.8.0-dev-00011-g70a2ffa (2013-05-14-19:41)
This commit is contained in:
Karl Palsson
2013-09-06 22:21:35 +00:00
committed by Piotr Esden-Tempski
parent 26d27497f2
commit ca926f00e0
3 changed files with 185 additions and 0 deletions

View File

@@ -0,0 +1,32 @@
##
## This file is part of the libopencm3 project.
##
## Copyright (C) 2009 Uwe Hermann <uwe@hermann-uwe.de>
##
## This library is free software: you can redistribute it and/or modify
## it under the terms of the GNU Lesser General Public License as published by
## the Free Software Foundation, either version 3 of the License, or
## (at your option) any later version.
##
## This library is distributed in the hope that it will be useful,
## but WITHOUT ANY WARRANTY; without even the implied warranty of
## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
## GNU Lesser General Public License for more details.
##
## You should have received a copy of the GNU Lesser General Public License
## along with this library. If not, see <http://www.gnu.org/licenses/>.
##
BINARY = usart-semihosting
LDSCRIPT = ../../../../../libopencm3/lib/stm32/l1/stm32l15xxb.ld
# To disable, run "make ENABLE_SEMIHOSTING=0" or comment next line out
ENABLE_SEMIHOSTING ?= 1
ifeq ($(ENABLE_SEMIHOSTING),1)
LDFLAGS += --specs=rdimon.specs -lrdimon
CFLAGS += -DENABLE_SEMIHOSTING=1
endif
include ../../Makefile.include