added this device.
not result yet because i have no idea what the CPU clock is going
at.
--- a/Makefile Sun Jan 17 19:34:30 2016 +0000
+++ b/Makefile Thu Feb 18 01:19:13 2016 +0000
@@ -1,5 +1,5 @@
#
-# Copyright (C) 2015 Darron Broad
+# Copyright (C) --no-print-directory 2015 Darron Broad
# All rights reserved.
#
# This file is part of Blinky++.
@@ -18,28 +18,28 @@
#
build:
- cd EMW3162 && $(MAKE) V=1
- cd Maple_mini && $(MAKE) V=1
- cd Maple_mini_DFU && $(MAKE) V=1
- cd Nano_3.0 && $(MAKE)
- cd Pro_mini_8M && $(MAKE)
- cd STM32F4-Discovery && $(MAKE) V=1
- cd STM32VL-Discovery && $(MAKE) V=1
- cd STM8S103F3P6 && $(MAKE)
- cd STM8S-Discovery && $(MAKE)
- cd STM8S_Minikit_20 && $(MAKE)
- cd vcc-gnd && $(MAKE) V=1
+ cd EMW3162 && $(MAKE) --no-print-directory V=1
+ cd Maple_mini && $(MAKE) --no-print-directory V=1
+ cd Maple_mini_DFU && $(MAKE) --no-print-directory V=1
+ cd Nano_3.0 && $(MAKE) --no-print-directory
+ cd Pro_mini_8M && $(MAKE) --no-print-directory
+ cd STM32F4-Discovery && $(MAKE) --no-print-directory V=1
+ cd STM32VL-Discovery && $(MAKE) --no-print-directory V=1
+ cd STM8S103F3P6 && $(MAKE) --no-print-directory
+ cd STM8S-Discovery && $(MAKE) --no-print-directory
+ cd STM8S_Minikit_20 && $(MAKE) --no-print-directory
+ cd vcc-gnd && $(MAKE) --no-print-directory V=1
clean:
- cd EMW3162 && $(MAKE) V=1 clean
- cd Maple_mini && $(MAKE) V=1 clean
- cd Maple_mini_DFU && $(MAKE) V=1 clean
- cd Nano_3.0 && $(MAKE) clean
- cd Pro_mini_8M && $(MAKE) clean
- cd STM32F4-Discovery && $(MAKE) V=1 clean
- cd STM32VL-Discovery && $(MAKE) V=1 clean
- cd STM8S103F3P6 && $(MAKE) clean
- cd STM8S-Discovery && $(MAKE) clean
- cd STM8S_Minikit_20 && $(MAKE) clean
- cd vcc-gnd && $(MAKE) V=1 clean
+ cd EMW3162 && $(MAKE) --no-print-directory V=1 clean
+ cd Maple_mini && $(MAKE) --no-print-directory V=1 clean
+ cd Maple_mini_DFU && $(MAKE) --no-print-directory V=1 clean
+ cd Nano_3.0 && $(MAKE) --no-print-directory clean
+ cd Pro_mini_8M && $(MAKE) --no-print-directory clean
+ cd STM32F4-Discovery && $(MAKE) --no-print-directory V=1 clean
+ cd STM32VL-Discovery && $(MAKE) --no-print-directory V=1 clean
+ cd STM8S103F3P6 && $(MAKE) --no-print-directory clean
+ cd STM8S-Discovery && $(MAKE) --no-print-directory clean
+ cd STM8S_Minikit_20 && $(MAKE) --no-print-directory clean
+ cd vcc-gnd && $(MAKE) --no-print-directory V=1 clean
find . -name "*~" -delete
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/NUCLEO-F411RE/Makefile Thu Feb 18 01:19:13 2016 +0000
@@ -0,0 +1,33 @@
+#
+# Copyright (C) 2015 Darron Broad
+# All rights reserved.
+#
+# This file is part of Blinky++
+#
+# Blinky++ is free software: you can redistribute it and/or modify it under the
+# terms of the GNU General Public License as published by the Free Software
+# Foundation.
+#
+# Blinky++ 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 General Public License for more
+# details.
+#
+# You should have received a copy of the GNU General Public License along
+# with Blinky++. If not, see http://www.gnu.org/licenses/
+#
+
+PREFIX := /embedded/arm-cortex/gcc-arm-none-eabi-5_2-2015q4/bin/arm-none-eabi
+OPENCM3_DIR := /embedded/arm-cortex/src/libopencm3
+
+BINARY := blinky
+
+CFLAGS := -std=gnu99
+
+LDSCRIPT := lib/nucleo-f411re.ld
+
+include lib/Makefile.include
+
+install:all
+ $(PREFIX)-objcopy -Obinary blinky.elf blinky.bin
+ st-flash --reset write blinky.bin 0x8000000
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/NUCLEO-F411RE/blinky.c Thu Feb 18 01:19:13 2016 +0000
@@ -0,0 +1,44 @@
+/*
+ * Copyright (C) 2016 Darron Broad
+ * All rights reserved.
+ *
+ * This file is part of Blinky++.
+ *
+ * Blinky++ is free software: you can redistribute it and/or modify it under the
+ * terms of the GNU General Public License as published by the Free Software
+ * Foundation.
+ *
+ * Blinky++ 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 General Public License for more
+ * details.
+ *
+ * You should have received a copy of the GNU General Public License along
+ * with Blinky++. If not, see http://www.gnu.org/licenses/
+ */
+
+#include "blinky.h"
+
+/*
+ * Blink NUCLEO-F411RE LED on PA5
+ */
+
+int
+main(void)
+{
+ uint32_t i;
+
+ rcc_periph_clock_enable(RCC_GPIOA);
+ gpio_mode_setup(GPIOA, GPIO_MODE_OUTPUT, GPIO_PUPD_NONE, GPIO5);
+
+ while (true) {
+ for (i = 0; i < 0x600000; ++i) {
+ GPIOA_ODR ^= (1 << 5); /* TOGGLE */
+ }
+ for (i = 0; i < 0x600000; ++i) {
+ GPIOA_ODR = 0; /* OFF */
+ }
+ }
+
+ return 0;
+}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/NUCLEO-F411RE/blinky.h Thu Feb 18 01:19:13 2016 +0000
@@ -0,0 +1,31 @@
+/*
+ * Copyright (C) 2015 Darron Broad
+ * All rights reserved.
+ *
+ * This file is part of Blinky++.
+ *
+ * Blinky++ is free software: you can redistribute it and/or modify it under the
+ * terms of the GNU General Public License as published by the Free Software
+ * Foundation.
+ *
+ * Blinky++ 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 General Public License for more
+ * details.
+ *
+ * You should have received a copy of the GNU General Public License along
+ * with Blinky++. If not, see http://www.gnu.org/licenses/
+ */
+
+#ifndef _BLINKY_H
+#define _BLINKY_H
+
+#include <stdint.h>
+#include <stdbool.h>
+
+#include <libopencm3/stm32/rcc.h>
+#include <libopencm3/stm32/gpio.h>
+
+int main(void);
+
+#endif
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/NUCLEO-F411RE/lib/Makefile.include Thu Feb 18 01:19:13 2016 +0000
@@ -0,0 +1,45 @@
+##
+## This file is part of the libopencm3 project.
+##
+## Copyright (C) 2009 Uwe Hermann <uwe@hermann-uwe.de>
+## Copyright (C) 2010 Piotr Esden-Tempski <piotr@esden.net>
+## Copyright (C) 2011 Fergus Noble <fergusnoble@gmail.com>
+##
+## 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/>.
+##
+
+LIBNAME = opencm3_stm32f4
+DEFS = -DSTM32F4
+
+FP_FLAGS ?= -mfloat-abi=hard -mfpu=fpv4-sp-d16
+ARCH_FLAGS = -mthumb -mcpu=cortex-m4 $(FP_FLAGS)
+
+################################################################################
+# OpenOCD specific variables
+
+OOCD ?= openocd
+OOCD_INTERFACE ?= stlink-v2
+OOCD_BOARD ?= stm32f4discovery
+
+################################################################################
+# Black Magic Probe specific variables
+# Set the BMP_PORT to a serial port and then BMP is used for flashing
+BMP_PORT ?=
+
+################################################################################
+# texane/stlink specific variables
+#STLINK_PORT ?= :4242
+
+
+include lib/Makefile.rules
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/NUCLEO-F411RE/lib/Makefile.rules Thu Feb 18 01:19:13 2016 +0000
@@ -0,0 +1,239 @@
+##
+## This file is part of the libopencm3 project.
+##
+## Copyright (C) 2009 Uwe Hermann <uwe@hermann-uwe.de>
+## Copyright (C) 2010 Piotr Esden-Tempski <piotr@esden.net>
+## Copyright (C) 2013 Frantisek Burian <BuFran@seznam.cz>
+##
+## 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/>.
+##
+
+# Be silent per default, but 'make V=1' will show all compiler calls.
+ifneq ($(V),1)
+Q := @
+NULL := 2>/dev/null
+endif
+
+###############################################################################
+# Executables
+
+PREFIX ?= arm-none-eabi
+
+CC := $(PREFIX)-gcc
+CXX := $(PREFIX)-g++
+LD := $(PREFIX)-gcc
+AR := $(PREFIX)-ar
+AS := $(PREFIX)-as
+OBJCOPY := $(PREFIX)-objcopy
+OBJDUMP := $(PREFIX)-objdump
+GDB := $(PREFIX)-gdb
+STFLASH = $(shell which st-flash)
+STYLECHECK := /checkpatch.pl
+STYLECHECKFLAGS := --no-tree -f --terse --mailback
+STYLECHECKFILES := $(shell find . -name '*.[ch]')
+
+
+###############################################################################
+# Source files
+
+LDSCRIPT ?= $(BINARY).ld
+
+OBJS += $(BINARY).o
+
+
+ifeq ($(strip $(OPENCM3_DIR)),)
+# user has not specified the library path, so we try to detect it
+
+# where we search for the library
+LIBPATHS := ./libopencm3 ../../../../libopencm3 ../../../../../libopencm3
+
+OPENCM3_DIR := $(wildcard $(LIBPATHS:=/locm3.sublime-project))
+OPENCM3_DIR := $(firstword $(dir $(OPENCM3_DIR)))
+
+ifeq ($(strip $(OPENCM3_DIR)),)
+$(warning Cannot find libopencm3 library in the standard search paths.)
+$(error Please specify it through OPENCM3_DIR variable!)
+endif
+endif
+
+ifeq ($(V),1)
+$(info Using $(OPENCM3_DIR) path to library)
+endif
+
+INCLUDE_DIR = $(OPENCM3_DIR)/include
+LIB_DIR = $(OPENCM3_DIR)/lib
+SCRIPT_DIR = $(OPENCM3_DIR)/scripts
+
+###############################################################################
+# C flags
+
+CFLAGS += -Os -g
+CFLAGS += -Wextra -Wshadow -Wimplicit-function-declaration
+CFLAGS += -Wredundant-decls -Wmissing-prototypes -Wstrict-prototypes
+CFLAGS += -fno-common -ffunction-sections -fdata-sections
+
+###############################################################################
+# C++ flags
+
+CXXFLAGS += -Os -g
+CXXFLAGS += -Wextra -Wshadow -Wredundant-decls -Weffc++
+CXXFLAGS += -fno-common -ffunction-sections -fdata-sections
+
+###############################################################################
+# C & C++ preprocessor common flags
+
+CPPFLAGS += -MD
+CPPFLAGS += -Wall -Wundef
+CPPFLAGS += -I$(INCLUDE_DIR) $(DEFS)
+
+###############################################################################
+# Linker flags
+
+LDFLAGS += --static -nostartfiles
+LDFLAGS += -L$(LIB_DIR)
+LDFLAGS += -T$(LDSCRIPT)
+LDFLAGS += -Wl,-Map=$(*).map
+LDFLAGS += -Wl,--gc-sections
+ifeq ($(V),99)
+LDFLAGS += -Wl,--print-gc-sections
+endif
+
+###############################################################################
+# Used libraries
+
+LDLIBS += -l$(LIBNAME)
+LDLIBS += -Wl,--start-group -lc -lgcc -lnosys -Wl,--end-group
+
+###############################################################################
+###############################################################################
+###############################################################################
+
+.SUFFIXES: .elf .bin .hex .srec .list .map .images
+.SECONDEXPANSION:
+.SECONDARY:
+
+all: elf
+
+elf: $(BINARY).elf
+bin: $(BINARY).bin
+hex: $(BINARY).hex
+srec: $(BINARY).srec
+list: $(BINARY).list
+
+images: $(BINARY).images
+flash: $(BINARY).flash
+
+%.images: %.bin %.hex %.srec %.list %.map
+ @#printf "*** $* images generated ***\n"
+
+%.bin: %.elf
+ @#printf " OBJCOPY $(*).bin\n"
+ $(Q)$(OBJCOPY) -Obinary $(*).elf $(*).bin
+
+%.hex: %.elf
+ @#printf " OBJCOPY $(*).hex\n"
+ $(Q)$(OBJCOPY) -Oihex $(*).elf $(*).hex
+
+%.srec: %.elf
+ @#printf " OBJCOPY $(*).srec\n"
+ $(Q)$(OBJCOPY) -Osrec $(*).elf $(*).srec
+
+%.list: %.elf
+ @#printf " OBJDUMP $(*).list\n"
+ $(Q)$(OBJDUMP) -S $(*).elf > $(*).list
+
+%.elf %.map: $(OBJS) $(LDSCRIPT) $(LIB_DIR)/lib$(LIBNAME).a
+ @#printf " LD $(*).elf\n"
+ $(Q)$(LD) $(LDFLAGS) $(ARCH_FLAGS) $(OBJS) $(LDLIBS) -o $(*).elf
+
+%.o: %.c
+ @#printf " CC $(*).c\n"
+ $(Q)$(CC) $(CFLAGS) $(CPPFLAGS) $(ARCH_FLAGS) -o $(*).o -c $(*).c
+
+%.o: %.cxx
+ @#printf " CXX $(*).cxx\n"
+ $(Q)$(CXX) $(CXXFLAGS) $(CPPFLAGS) $(ARCH_FLAGS) -o $(*).o -c $(*).cxx
+
+%.o: %.cpp
+ @#printf " CXX $(*).cpp\n"
+ $(Q)$(CXX) $(CXXFLAGS) $(CPPFLAGS) $(ARCH_FLAGS) -o $(*).o -c $(*).cpp
+
+clean:
+ @#printf " CLEAN\n"
+ $(Q)$(RM) *.o *.d *.elf *.bin *.hex *.srec *.list *.map
+
+stylecheck: $(STYLECHECKFILES:=.stylecheck)
+styleclean: $(STYLECHECKFILES:=.styleclean)
+
+# the cat is due to multithreaded nature - we like to have consistent chunks of text on the output
+%.stylecheck: %
+ $(Q)$(SCRIPT_DIR)$(STYLECHECK) $(STYLECHECKFLAGS) $* > $*.stylecheck; \
+ if [ -s $*.stylecheck ]; then \
+ cat $*.stylecheck; \
+ else \
+ rm -f $*.stylecheck; \
+ fi;
+
+%.styleclean:
+ $(Q)rm -f $*.stylecheck;
+
+
+%.stlink-flash: %.bin
+ @printf " FLASH $<\n"
+ $(Q)$(STFLASH) write $(*).bin 0x8000000
+
+ifeq ($(STLINK_PORT),)
+ifeq ($(BMP_PORT),)
+ifeq ($(OOCD_SERIAL),)
+%.flash: %.hex
+ @printf " FLASH $<\n"
+ @# IMPORTANT: Don't use "resume", only "reset" will work correctly!
+ $(Q)$(OOCD) -f interface/$(OOCD_INTERFACE).cfg \
+ -f board/$(OOCD_BOARD).cfg \
+ -c "init" -c "reset init" \
+ -c "flash write_image erase $(*).hex" \
+ -c "reset" \
+ -c "shutdown" $(NULL)
+else
+%.flash: %.hex
+ @printf " FLASH $<\n"
+ @# IMPORTANT: Don't use "resume", only "reset" will work correctly!
+ $(Q)$(OOCD) -f interface/$(OOCD_INTERFACE).cfg \
+ -f board/$(OOCD_BOARD).cfg \
+ -c "ft2232_serial $(OOCD_SERIAL)" \
+ -c "init" -c "reset init" \
+ -c "flash write_image erase $(*).hex" \
+ -c "reset" \
+ -c "shutdown" $(NULL)
+endif
+else
+%.flash: %.elf
+ @printf " GDB $(*).elf (flash)\n"
+ $(Q)$(GDB) --batch \
+ -ex 'target extended-remote $(BMP_PORT)' \
+ -x $(SCRIPT_DIR)/black_magic_probe_flash.scr \
+ $(*).elf
+endif
+else
+%.flash: %.elf
+ @printf " GDB $(*).elf (flash)\n"
+ $(Q)$(GDB) --batch \
+ -ex 'target extended-remote $(STLINK_PORT)' \
+ -x $(SCRIPT_DIR)/stlink_flash.scr \
+ $(*).elf
+endif
+
+.PHONY: images clean stylecheck styleclean elf bin hex srec list
+
+-include $(OBJS:.o=.d)
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/NUCLEO-F411RE/lib/nucleo-f411re.ld Thu Feb 18 01:19:13 2016 +0000
@@ -0,0 +1,32 @@
+/*
+ * This file is part of the libopencm3 project.
+ *
+ * Copyright (C) 2009 Uwe Hermann <uwe@hermann-uwe.de>
+ * Copyright (C) 2011 Stephen Caudle <scaudle@doceme.com>
+ *
+ * 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/>.
+ */
+
+/* Linker script for Nucleo F411RE (STM32F411RE, 512K flash, 128K RAM). */
+
+/* Define memory regions. */
+MEMORY
+{
+ rom (rx) : ORIGIN = 0x08000000, LENGTH = 512K
+ ram (rwx) : ORIGIN = 0x20000000, LENGTH = 128K
+}
+
+/* Include the common ld script. */
+INCLUDE libopencm3_stm32f4.ld
+