Merge remote-tracking branch 'fnoble/stm32f2'
This commit is contained in:
commit
788f3870c4
2
Makefile
2
Makefile
@ -25,7 +25,7 @@ LIBDIR = $(DESTDIR)/$(PREFIX)/lib
|
|||||||
SHAREDIR = $(DESTDIR)/$(PREFIX)/share/libopencm3/scripts
|
SHAREDIR = $(DESTDIR)/$(PREFIX)/share/libopencm3/scripts
|
||||||
INSTALL = install
|
INSTALL = install
|
||||||
|
|
||||||
TARGETS = stm32 lpc13xx lm3s
|
TARGETS = stm32f1 stm32f2 lpc13xx lm3s
|
||||||
|
|
||||||
# Be silent per default, but 'make V=1' will show all compiler calls.
|
# Be silent per default, but 'make V=1' will show all compiler calls.
|
||||||
ifneq ($(V),1)
|
ifneq ($(V),1)
|
||||||
|
@ -25,7 +25,7 @@ LD = $(PREFIX)-gcc
|
|||||||
OBJCOPY = $(PREFIX)-objcopy
|
OBJCOPY = $(PREFIX)-objcopy
|
||||||
OBJDUMP = $(PREFIX)-objdump
|
OBJDUMP = $(PREFIX)-objdump
|
||||||
# Uncomment this line if you want to use the installed (not local) library.
|
# Uncomment this line if you want to use the installed (not local) library.
|
||||||
# TOOLCHAIN_DIR = `dirname \`which $(CC)\``/../$(PREFIX)
|
# TOOLCHAIN_DIR := $(shell dirname `which $(CC)`)/../$(PREFIX)
|
||||||
TOOLCHAIN_DIR = ../../../..
|
TOOLCHAIN_DIR = ../../../..
|
||||||
CFLAGS += -O0 -g3 -Wall -Wextra -I$(TOOLCHAIN_DIR)/include -fno-common \
|
CFLAGS += -O0 -g3 -Wall -Wextra -I$(TOOLCHAIN_DIR)/include -fno-common \
|
||||||
-mcpu=cortex-m3 -mthumb -MD
|
-mcpu=cortex-m3 -mthumb -MD
|
||||||
|
@ -25,7 +25,7 @@ LD = $(PREFIX)-gcc
|
|||||||
OBJCOPY = $(PREFIX)-objcopy
|
OBJCOPY = $(PREFIX)-objcopy
|
||||||
OBJDUMP = $(PREFIX)-objdump
|
OBJDUMP = $(PREFIX)-objdump
|
||||||
# Uncomment this line if you want to use the installed (not local) library.
|
# Uncomment this line if you want to use the installed (not local) library.
|
||||||
# TOOLCHAIN_DIR = `dirname \`which $(CC)\``/../$(PREFIX)
|
# TOOLCHAIN_DIR := $(shell dirname `which $(CC)`)/../$(PREFIX)
|
||||||
TOOLCHAIN_DIR = ../../../..
|
TOOLCHAIN_DIR = ../../../..
|
||||||
CFLAGS += -Os -g -Wall -Wextra -I$(TOOLCHAIN_DIR)/include -fno-common \
|
CFLAGS += -Os -g -Wall -Wextra -I$(TOOLCHAIN_DIR)/include -fno-common \
|
||||||
-mcpu=cortex-m3 -mthumb -MD
|
-mcpu=cortex-m3 -mthumb -MD
|
||||||
|
@ -24,14 +24,13 @@ CC = $(PREFIX)-gcc
|
|||||||
LD = $(PREFIX)-gcc
|
LD = $(PREFIX)-gcc
|
||||||
OBJCOPY = $(PREFIX)-objcopy
|
OBJCOPY = $(PREFIX)-objcopy
|
||||||
OBJDUMP = $(PREFIX)-objdump
|
OBJDUMP = $(PREFIX)-objdump
|
||||||
GDB = $(PREFIX)-gdb
|
|
||||||
# Uncomment this line if you want to use the installed (not local) library.
|
# Uncomment this line if you want to use the installed (not local) library.
|
||||||
# TOOLCHAIN_DIR = `dirname \`which $(CC)\``/../$(PREFIX)
|
#TOOLCHAIN_DIR := $(shell dirname `which $(CC)`)/../$(PREFIX)
|
||||||
TOOLCHAIN_DIR = ../../../..
|
TOOLCHAIN_DIR = ../../../..
|
||||||
CFLAGS += -Os -g -Wall -Wextra -I$(TOOLCHAIN_DIR)/include \
|
CFLAGS += -Os -g -Wall -Wextra -I$(TOOLCHAIN_DIR)/include \
|
||||||
-fno-common -mcpu=cortex-m3 -mthumb -msoft-float -MD
|
-fno-common -mcpu=cortex-m3 -mthumb -msoft-float -MD -DSTM32F1
|
||||||
LDSCRIPT = $(BINARY).ld
|
LDSCRIPT = $(BINARY).ld
|
||||||
LDFLAGS += -lc -lnosys -L$(TOOLCHAIN_DIR)/lib -L$(TOOLCHAIN_DIR)/lib/stm32 \
|
LDFLAGS += -lc -lnosys -L$(TOOLCHAIN_DIR)/lib -L$(TOOLCHAIN_DIR)/lib/stm32f1 \
|
||||||
-T$(LDSCRIPT) -nostartfiles -Wl,--gc-sections \
|
-T$(LDSCRIPT) -nostartfiles -Wl,--gc-sections \
|
||||||
-mthumb -march=armv7 -mfix-cortex-m3-ldrd -msoft-float
|
-mthumb -march=armv7 -mfix-cortex-m3-ldrd -msoft-float
|
||||||
OBJS += $(BINARY).o
|
OBJS += $(BINARY).o
|
||||||
@ -39,9 +38,6 @@ OBJS += $(BINARY).o
|
|||||||
OOCD ?= openocd
|
OOCD ?= openocd
|
||||||
OOCD_INTERFACE ?= flossjtag
|
OOCD_INTERFACE ?= flossjtag
|
||||||
OOCD_BOARD ?= olimex_stm32_h103
|
OOCD_BOARD ?= olimex_stm32_h103
|
||||||
# Black magic probe specific variables
|
|
||||||
# Set the BMP_PORT to a serial port and then BMP is used for flashing
|
|
||||||
BMP_PORT ?=
|
|
||||||
|
|
||||||
# Be silent per default, but 'make V=1' will show all compiler calls.
|
# Be silent per default, but 'make V=1' will show all compiler calls.
|
||||||
ifneq ($(V),1)
|
ifneq ($(V),1)
|
||||||
@ -79,9 +75,9 @@ flash: $(BINARY).flash
|
|||||||
@#printf " OBJDUMP $(*).list\n"
|
@#printf " OBJDUMP $(*).list\n"
|
||||||
$(Q)$(OBJDUMP) -S $(*).elf > $(*).list
|
$(Q)$(OBJDUMP) -S $(*).elf > $(*).list
|
||||||
|
|
||||||
%.elf: $(OBJS) $(LDSCRIPT) $(TOOLCHAIN_DIR)/lib/stm32/libopencm3_stm32.a
|
%.elf: $(OBJS) $(LDSCRIPT) $(TOOLCHAIN_DIR)/lib/stm32f1/libopencm3_stm32f1.a
|
||||||
@#printf " LD $(subst $(shell pwd)/,,$(@))\n"
|
@#printf " LD $(subst $(shell pwd)/,,$(@))\n"
|
||||||
$(Q)$(LD) -o $(*).elf $(OBJS) -lopencm3_stm32 $(LDFLAGS)
|
$(Q)$(LD) -o $(*).elf $(OBJS) -lopencm3_stm32f1 $(LDFLAGS)
|
||||||
|
|
||||||
%.o: %.c Makefile
|
%.o: %.c Makefile
|
||||||
@#printf " CC $(subst $(shell pwd)/,,$(@))\n"
|
@#printf " CC $(subst $(shell pwd)/,,$(@))\n"
|
||||||
@ -96,7 +92,6 @@ clean:
|
|||||||
$(Q)rm -f *.srec
|
$(Q)rm -f *.srec
|
||||||
$(Q)rm -f *.list
|
$(Q)rm -f *.list
|
||||||
|
|
||||||
ifeq ($(BMP_PORT),)
|
|
||||||
ifeq ($(OOCD_SERIAL),)
|
ifeq ($(OOCD_SERIAL),)
|
||||||
%.flash: %.hex
|
%.flash: %.hex
|
||||||
@printf " FLASH $<\n"
|
@printf " FLASH $<\n"
|
||||||
@ -121,14 +116,6 @@ else
|
|||||||
-c "reset" \
|
-c "reset" \
|
||||||
-c "shutdown" $(NULL)
|
-c "shutdown" $(NULL)
|
||||||
endif
|
endif
|
||||||
else
|
|
||||||
%.flash: %.elf
|
|
||||||
@echo " GDB $(*).elf (flash)"
|
|
||||||
$(Q)$(GDB) --batch \
|
|
||||||
-ex 'target extended-remote $(BMP_PORT)' \
|
|
||||||
-x $(TOOLCHAIN_DIR)/scripts/black_magic_probe_flash.scr \
|
|
||||||
$(*).elf
|
|
||||||
endif
|
|
||||||
|
|
||||||
.PHONY: images clean
|
.PHONY: images clean
|
||||||
|
|
@ -18,8 +18,8 @@
|
|||||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include <libopencm3/stm32/rcc.h>
|
#include <libopencm3/stm32/f1/rcc.h>
|
||||||
#include <libopencm3/stm32/gpio.h>
|
#include <libopencm3/stm32/f1/gpio.h>
|
||||||
|
|
||||||
/* Set STM32 to 72 MHz. */
|
/* Set STM32 to 72 MHz. */
|
||||||
void clock_setup(void)
|
void clock_setup(void)
|
@ -27,5 +27,5 @@ MEMORY
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* Include the common ld script. */
|
/* Include the common ld script. */
|
||||||
INCLUDE libopencm3_stm32.ld
|
INCLUDE libopencm3_stm32f1.ld
|
||||||
|
|
@ -18,10 +18,10 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
#include <libopencm3/stm32/rcc.h>
|
#include <libopencm3/stm32/f1/rcc.h>
|
||||||
#include <libopencm3/stm32/gpio.h>
|
#include <libopencm3/stm32/f1/gpio.h>
|
||||||
#include <libopencm3/stm32/flash.h>
|
#include <libopencm3/stm32/f1/flash.h>
|
||||||
#include <libopencm3/stm32/scb.h>
|
#include <libopencm3/stm32/f1/scb.h>
|
||||||
#include <libopencm3/usb/usbd.h>
|
#include <libopencm3/usb/usbd.h>
|
||||||
#include <libopencm3/usb/dfu.h>
|
#include <libopencm3/usb/dfu.h>
|
||||||
|
|
@ -25,5 +25,5 @@ MEMORY
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* Include the common ld script. */
|
/* Include the common ld script. */
|
||||||
INCLUDE libopencm3_stm32.ld
|
INCLUDE libopencm3_stm32f1.ld
|
||||||
|
|
@ -19,8 +19,8 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
#include <libopencm3/stm32/rcc.h>
|
#include <libopencm3/stm32/f1/rcc.h>
|
||||||
#include <libopencm3/stm32/gpio.h>
|
#include <libopencm3/stm32/f1/gpio.h>
|
||||||
#include <libopencm3/stm32/systick.h>
|
#include <libopencm3/stm32/systick.h>
|
||||||
#include <libopencm3/stm32/otg_fs.h>
|
#include <libopencm3/stm32/otg_fs.h>
|
||||||
#include <libopencm3/usb/usbd.h>
|
#include <libopencm3/usb/usbd.h>
|
||||||
@ -30,7 +30,7 @@
|
|||||||
#define INCLUDE_DFU_INTERFACE
|
#define INCLUDE_DFU_INTERFACE
|
||||||
|
|
||||||
#ifdef INCLUDE_DFU_INTERFACE
|
#ifdef INCLUDE_DFU_INTERFACE
|
||||||
#include <libopencm3/stm32/scb.h>
|
#include <libopencm3/stm32/f1/scb.h>
|
||||||
#include <libopencm3/usb/dfu.h>
|
#include <libopencm3/usb/dfu.h>
|
||||||
#endif
|
#endif
|
||||||
|
|
@ -27,5 +27,5 @@ MEMORY
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* Include the common ld script. */
|
/* Include the common ld script. */
|
||||||
INCLUDE libopencm3_stm32.ld
|
INCLUDE libopencm3_stm32f1.ld
|
||||||
|
|
@ -18,8 +18,8 @@
|
|||||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include <libopencm3/stm32/rcc.h>
|
#include <libopencm3/stm32/f1/rcc.h>
|
||||||
#include <libopencm3/stm32/gpio.h>
|
#include <libopencm3/stm32/f1/gpio.h>
|
||||||
|
|
||||||
void clock_setup(void)
|
void clock_setup(void)
|
||||||
{
|
{
|
@ -27,5 +27,5 @@ MEMORY
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* Include the common ld script. */
|
/* Include the common ld script. */
|
||||||
INCLUDE libopencm3_stm32.ld
|
INCLUDE libopencm3_stm32f1.ld
|
||||||
|
|
@ -17,8 +17,8 @@
|
|||||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include <libopencm3/stm32/rcc.h>
|
#include <libopencm3/stm32/f1/rcc.h>
|
||||||
#include <libopencm3/stm32/gpio.h>
|
#include <libopencm3/stm32/f1/gpio.h>
|
||||||
#include <libopencm3/stm32/timer.h>
|
#include <libopencm3/stm32/timer.h>
|
||||||
|
|
||||||
// #define COMPARE
|
// #define COMPARE
|
@ -27,5 +27,5 @@ MEMORY
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* Include the common ld script. */
|
/* Include the common ld script. */
|
||||||
INCLUDE libopencm3_stm32.ld
|
INCLUDE libopencm3_stm32f1.ld
|
||||||
|
|
@ -18,9 +18,9 @@
|
|||||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include <libopencm3/stm32/rcc.h>
|
#include <libopencm3/stm32/f1/rcc.h>
|
||||||
#include <libopencm3/stm32/flash.h>
|
#include <libopencm3/stm32/f1/flash.h>
|
||||||
#include <libopencm3/stm32/gpio.h>
|
#include <libopencm3/stm32/f1/gpio.h>
|
||||||
#include <libopencm3/stm32/nvic.h>
|
#include <libopencm3/stm32/nvic.h>
|
||||||
#include <libopencm3/stm32/systick.h>
|
#include <libopencm3/stm32/systick.h>
|
||||||
#include <libopencm3/stm32/can.h>
|
#include <libopencm3/stm32/can.h>
|
@ -27,5 +27,5 @@ MEMORY
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* Include the common ld script. */
|
/* Include the common ld script. */
|
||||||
INCLUDE libopencm3_stm32.ld
|
INCLUDE libopencm3_stm32f1.ld
|
||||||
|
|
@ -18,8 +18,8 @@
|
|||||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include <libopencm3/stm32/rcc.h>
|
#include <libopencm3/stm32/f1/rcc.h>
|
||||||
#include <libopencm3/stm32/gpio.h>
|
#include <libopencm3/stm32/f1/gpio.h>
|
||||||
|
|
||||||
/* Set STM32 to 72 MHz. */
|
/* Set STM32 to 72 MHz. */
|
||||||
void clock_setup(void)
|
void clock_setup(void)
|
@ -27,5 +27,5 @@ MEMORY
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* Include the common ld script. */
|
/* Include the common ld script. */
|
||||||
INCLUDE libopencm3_stm32.ld
|
INCLUDE libopencm3_stm32f1.ld
|
||||||
|
|
@ -17,8 +17,8 @@
|
|||||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include <libopencm3/stm32/rcc.h>
|
#include <libopencm3/stm32/f1/rcc.h>
|
||||||
#include <libopencm3/stm32/gpio.h>
|
#include <libopencm3/stm32/f1/gpio.h>
|
||||||
#include <libopencm3/stm32/timer.h>
|
#include <libopencm3/stm32/timer.h>
|
||||||
|
|
||||||
// #define COMPARE
|
// #define COMPARE
|
@ -27,5 +27,5 @@ MEMORY
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* Include the common ld script. */
|
/* Include the common ld script. */
|
||||||
INCLUDE libopencm3_stm32.ld
|
INCLUDE libopencm3_stm32f1.ld
|
||||||
|
|
@ -18,9 +18,9 @@
|
|||||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include <libopencm3/stm32/rcc.h>
|
#include <libopencm3/stm32/f1/rcc.h>
|
||||||
#include <libopencm3/stm32/flash.h>
|
#include <libopencm3/stm32/f1/flash.h>
|
||||||
#include <libopencm3/stm32/gpio.h>
|
#include <libopencm3/stm32/f1/gpio.h>
|
||||||
#include <libopencm3/stm32/nvic.h>
|
#include <libopencm3/stm32/nvic.h>
|
||||||
#include <libopencm3/stm32/systick.h>
|
#include <libopencm3/stm32/systick.h>
|
||||||
|
|
@ -27,5 +27,5 @@ MEMORY
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* Include the common ld script. */
|
/* Include the common ld script. */
|
||||||
INCLUDE libopencm3_stm32.ld
|
INCLUDE libopencm3_stm32f1.ld
|
||||||
|
|
@ -17,8 +17,8 @@
|
|||||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include <libopencm3/stm32/rcc.h>
|
#include <libopencm3/stm32/f1/rcc.h>
|
||||||
#include <libopencm3/stm32/gpio.h>
|
#include <libopencm3/stm32/f1/gpio.h>
|
||||||
#include <libopencm3/stm32/usart.h>
|
#include <libopencm3/stm32/usart.h>
|
||||||
|
|
||||||
void clock_setup(void)
|
void clock_setup(void)
|
||||||
@ -47,7 +47,7 @@ void usart_setup(void)
|
|||||||
GPIO_CNF_OUTPUT_ALTFN_PUSHPULL, GPIO_USART1_RE_TX);
|
GPIO_CNF_OUTPUT_ALTFN_PUSHPULL, GPIO_USART1_RE_TX);
|
||||||
|
|
||||||
/* Setup UART parameters. */
|
/* Setup UART parameters. */
|
||||||
usart_set_baudrate(USART1, 230400);
|
usart_set_baudrate(USART1, 230400, rcc_ppre2_frequency);
|
||||||
usart_set_databits(USART1, 8);
|
usart_set_databits(USART1, 8);
|
||||||
usart_set_stopbits(USART1, USART_STOPBITS_1);
|
usart_set_stopbits(USART1, USART_STOPBITS_1);
|
||||||
usart_set_mode(USART1, USART_MODE_TX);
|
usart_set_mode(USART1, USART_MODE_TX);
|
@ -27,5 +27,5 @@ MEMORY
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* Include the common ld script. */
|
/* Include the common ld script. */
|
||||||
INCLUDE libopencm3_stm32.ld
|
INCLUDE libopencm3_stm32f1.ld
|
||||||
|
|
@ -17,8 +17,8 @@
|
|||||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include <libopencm3/stm32/rcc.h>
|
#include <libopencm3/stm32/f1/rcc.h>
|
||||||
#include <libopencm3/stm32/gpio.h>
|
#include <libopencm3/stm32/f1/gpio.h>
|
||||||
#include <libopencm3/stm32/usart.h>
|
#include <libopencm3/stm32/usart.h>
|
||||||
#include <libopencm3/stm32/nvic.h>
|
#include <libopencm3/stm32/nvic.h>
|
||||||
|
|
||||||
@ -52,7 +52,7 @@ void usart_setup(void)
|
|||||||
GPIO_CNF_INPUT_FLOAT, GPIO_USART1_RE_RX);
|
GPIO_CNF_INPUT_FLOAT, GPIO_USART1_RE_RX);
|
||||||
|
|
||||||
/* Setup UART parameters. */
|
/* Setup UART parameters. */
|
||||||
usart_set_baudrate(USART1, 230400);
|
usart_set_baudrate(USART1, 230400, rcc_ppre2_frequency);
|
||||||
usart_set_databits(USART1, 8);
|
usart_set_databits(USART1, 8);
|
||||||
usart_set_stopbits(USART1, USART_STOPBITS_1);
|
usart_set_stopbits(USART1, USART_STOPBITS_1);
|
||||||
usart_set_parity(USART1, USART_PARITY_NONE);
|
usart_set_parity(USART1, USART_PARITY_NONE);
|
@ -27,5 +27,5 @@ MEMORY
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* Include the common ld script. */
|
/* Include the common ld script. */
|
||||||
INCLUDE libopencm3_stm32.ld
|
INCLUDE libopencm3_stm32f1.ld
|
||||||
|
|
@ -17,11 +17,11 @@
|
|||||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include <libopencm3/stm32/rcc.h>
|
#include <libopencm3/stm32/f1/rcc.h>
|
||||||
#include <libopencm3/stm32/flash.h>
|
#include <libopencm3/stm32/f1/flash.h>
|
||||||
#include <libopencm3/stm32/gpio.h>
|
#include <libopencm3/stm32/f1/gpio.h>
|
||||||
|
#include <libopencm3/stm32/f1/adc.h>
|
||||||
#include <libopencm3/stm32/usart.h>
|
#include <libopencm3/stm32/usart.h>
|
||||||
#include <libopencm3/stm32/adc.h>
|
|
||||||
|
|
||||||
void usart_setup(void)
|
void usart_setup(void)
|
||||||
{
|
{
|
||||||
@ -34,7 +34,7 @@ void usart_setup(void)
|
|||||||
GPIO_CNF_OUTPUT_ALTFN_PUSHPULL, GPIO_USART1_TX);
|
GPIO_CNF_OUTPUT_ALTFN_PUSHPULL, GPIO_USART1_TX);
|
||||||
|
|
||||||
/* Setup UART parameters. */
|
/* Setup UART parameters. */
|
||||||
usart_set_baudrate(USART1, 115200);
|
usart_set_baudrate(USART1, 115200, rcc_ppre2_frequency);
|
||||||
usart_set_databits(USART1, 8);
|
usart_set_databits(USART1, 8);
|
||||||
usart_set_stopbits(USART1, USART_STOPBITS_1);
|
usart_set_stopbits(USART1, USART_STOPBITS_1);
|
||||||
usart_set_mode(USART1, USART_MODE_TX_RX);
|
usart_set_mode(USART1, USART_MODE_TX_RX);
|
@ -27,5 +27,5 @@ MEMORY
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* Include the common ld script. */
|
/* Include the common ld script. */
|
||||||
INCLUDE libopencm3_stm32.ld
|
INCLUDE libopencm3_stm32f1.ld
|
||||||
|
|
@ -17,11 +17,11 @@
|
|||||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include <libopencm3/stm32/rcc.h>
|
#include <libopencm3/stm32/f1/rcc.h>
|
||||||
#include <libopencm3/stm32/flash.h>
|
#include <libopencm3/stm32/f1/flash.h>
|
||||||
#include <libopencm3/stm32/gpio.h>
|
#include <libopencm3/stm32/f1/gpio.h>
|
||||||
|
#include <libopencm3/stm32/f1/dma.h>
|
||||||
#include <libopencm3/stm32/usart.h>
|
#include <libopencm3/stm32/usart.h>
|
||||||
#include <libopencm3/stm32/dma.h>
|
|
||||||
|
|
||||||
void usart_setup(void)
|
void usart_setup(void)
|
||||||
{
|
{
|
||||||
@ -34,7 +34,7 @@ void usart_setup(void)
|
|||||||
GPIO_CNF_OUTPUT_ALTFN_PUSHPULL, GPIO_USART1_TX);
|
GPIO_CNF_OUTPUT_ALTFN_PUSHPULL, GPIO_USART1_TX);
|
||||||
|
|
||||||
/* Setup UART parameters. */
|
/* Setup UART parameters. */
|
||||||
usart_set_baudrate(USART1, 115200);
|
usart_set_baudrate(USART1, 115200, rcc_ppre2_frequency);
|
||||||
usart_set_databits(USART1, 8);
|
usart_set_databits(USART1, 8);
|
||||||
usart_set_stopbits(USART1, USART_STOPBITS_1);
|
usart_set_stopbits(USART1, USART_STOPBITS_1);
|
||||||
usart_set_mode(USART1, USART_MODE_TX_RX);
|
usart_set_mode(USART1, USART_MODE_TX_RX);
|
@ -27,5 +27,5 @@ MEMORY
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* Include the common ld script. */
|
/* Include the common ld script. */
|
||||||
INCLUDE libopencm3_stm32.ld
|
INCLUDE libopencm3_stm32f1.ld
|
||||||
|
|
@ -21,7 +21,7 @@
|
|||||||
#define DOGM128_H
|
#define DOGM128_H
|
||||||
|
|
||||||
#include <libopencm3/cm3/common.h>
|
#include <libopencm3/cm3/common.h>
|
||||||
#include <libopencm3/stm32/gpio.h>
|
#include <libopencm3/stm32/f1/gpio.h>
|
||||||
#include <libopencm3/stm32/spi.h>
|
#include <libopencm3/stm32/spi.h>
|
||||||
|
|
||||||
/* PB10 GPIO - ~RESET
|
/* PB10 GPIO - ~RESET
|
@ -17,9 +17,9 @@
|
|||||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include <libopencm3/stm32/rcc.h>
|
#include <libopencm3/stm32/f1/rcc.h>
|
||||||
#include <libopencm3/stm32/flash.h>
|
#include <libopencm3/stm32/f1/flash.h>
|
||||||
#include <libopencm3/stm32/gpio.h>
|
#include <libopencm3/stm32/f1/gpio.h>
|
||||||
#include <libopencm3/stm32/usart.h>
|
#include <libopencm3/stm32/usart.h>
|
||||||
#include <libopencm3/stm32/timer.h>
|
#include <libopencm3/stm32/timer.h>
|
||||||
#include <libopencm3/stm32/nvic.h>
|
#include <libopencm3/stm32/nvic.h>
|
@ -27,5 +27,5 @@ MEMORY
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* Include the common ld script. */
|
/* Include the common ld script. */
|
||||||
INCLUDE libopencm3_stm32.ld
|
INCLUDE libopencm3_stm32f1.ld
|
||||||
|
|
@ -17,9 +17,9 @@
|
|||||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include <libopencm3/stm32/rcc.h>
|
#include <libopencm3/stm32/f1/rcc.h>
|
||||||
#include <libopencm3/stm32/flash.h>
|
#include <libopencm3/stm32/f1/flash.h>
|
||||||
#include <libopencm3/stm32/gpio.h>
|
#include <libopencm3/stm32/f1/gpio.h>
|
||||||
#include <libopencm3/stm32/usart.h>
|
#include <libopencm3/stm32/usart.h>
|
||||||
#include <libopencm3/stm32/i2c.h>
|
#include <libopencm3/stm32/i2c.h>
|
||||||
#include "stts75.h"
|
#include "stts75.h"
|
||||||
@ -35,7 +35,7 @@ void usart_setup(void)
|
|||||||
GPIO_CNF_OUTPUT_ALTFN_PUSHPULL, GPIO_USART1_TX);
|
GPIO_CNF_OUTPUT_ALTFN_PUSHPULL, GPIO_USART1_TX);
|
||||||
|
|
||||||
/* Setup UART parameters. */
|
/* Setup UART parameters. */
|
||||||
usart_set_baudrate(USART1, 115200);
|
usart_set_baudrate(USART1, 115200, rcc_ppre2_frequency);
|
||||||
usart_set_databits(USART1, 8);
|
usart_set_databits(USART1, 8);
|
||||||
usart_set_stopbits(USART1, USART_STOPBITS_1);
|
usart_set_stopbits(USART1, USART_STOPBITS_1);
|
||||||
usart_set_mode(USART1, USART_MODE_TX_RX);
|
usart_set_mode(USART1, USART_MODE_TX_RX);
|
@ -27,5 +27,5 @@ MEMORY
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* Include the common ld script. */
|
/* Include the common ld script. */
|
||||||
INCLUDE libopencm3_stm32.ld
|
INCLUDE libopencm3_stm32f1.ld
|
||||||
|
|
@ -17,10 +17,10 @@
|
|||||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include <libopencm3/stm32/rcc.h>
|
#include <libopencm3/stm32/f1/rcc.h>
|
||||||
#include <libopencm3/stm32/gpio.h>
|
#include <libopencm3/stm32/f1/gpio.h>
|
||||||
|
#include <libopencm3/stm32/f1/rtc.h>
|
||||||
#include <libopencm3/stm32/usart.h>
|
#include <libopencm3/stm32/usart.h>
|
||||||
#include <libopencm3/stm32/rtc.h>
|
|
||||||
#include <libopencm3/stm32/pwr.h>
|
#include <libopencm3/stm32/pwr.h>
|
||||||
#include <libopencm3/stm32/nvic.h>
|
#include <libopencm3/stm32/nvic.h>
|
||||||
|
|
||||||
@ -43,7 +43,7 @@ void usart_setup(void)
|
|||||||
GPIO_CNF_OUTPUT_ALTFN_PUSHPULL, GPIO_USART1_TX);
|
GPIO_CNF_OUTPUT_ALTFN_PUSHPULL, GPIO_USART1_TX);
|
||||||
|
|
||||||
/* Setup UART parameters. */
|
/* Setup UART parameters. */
|
||||||
usart_set_baudrate(USART1, 38400);
|
usart_set_baudrate(USART1, 38400, rcc_ppre2_frequency);
|
||||||
usart_set_databits(USART1, 8);
|
usart_set_databits(USART1, 8);
|
||||||
usart_set_stopbits(USART1, USART_STOPBITS_1);
|
usart_set_stopbits(USART1, USART_STOPBITS_1);
|
||||||
usart_set_mode(USART1, USART_MODE_TX);
|
usart_set_mode(USART1, USART_MODE_TX);
|
@ -27,5 +27,5 @@ MEMORY
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* Include the common ld script. */
|
/* Include the common ld script. */
|
||||||
INCLUDE libopencm3_stm32.ld
|
INCLUDE libopencm3_stm32f1.ld
|
||||||
|
|
@ -17,9 +17,9 @@
|
|||||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include <libopencm3/stm32/rcc.h>
|
#include <libopencm3/stm32/f1/rcc.h>
|
||||||
#include <libopencm3/stm32/flash.h>
|
#include <libopencm3/stm32/f1/flash.h>
|
||||||
#include <libopencm3/stm32/gpio.h>
|
#include <libopencm3/stm32/f1/gpio.h>
|
||||||
#include <libopencm3/stm32/nvic.h>
|
#include <libopencm3/stm32/nvic.h>
|
||||||
#include <libopencm3/stm32/systick.h>
|
#include <libopencm3/stm32/systick.h>
|
||||||
|
|
@ -27,5 +27,5 @@ MEMORY
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* Include the common ld script. */
|
/* Include the common ld script. */
|
||||||
INCLUDE libopencm3_stm32.ld
|
INCLUDE libopencm3_stm32f1.ld
|
||||||
|
|
@ -17,9 +17,9 @@
|
|||||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include <libopencm3/stm32/rcc.h>
|
#include <libopencm3/stm32/f1/rcc.h>
|
||||||
#include <libopencm3/stm32/flash.h>
|
#include <libopencm3/stm32/f1/flash.h>
|
||||||
#include <libopencm3/stm32/gpio.h>
|
#include <libopencm3/stm32/f1/gpio.h>
|
||||||
#include <libopencm3/stm32/timer.h>
|
#include <libopencm3/stm32/timer.h>
|
||||||
#include <libopencm3/stm32/nvic.h>
|
#include <libopencm3/stm32/nvic.h>
|
||||||
|
|
@ -27,5 +27,5 @@ MEMORY
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* Include the common ld script. */
|
/* Include the common ld script. */
|
||||||
INCLUDE libopencm3_stm32.ld
|
INCLUDE libopencm3_stm32f1.ld
|
||||||
|
|
@ -18,8 +18,8 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
#include <libopencm3/stm32/rcc.h>
|
#include <libopencm3/stm32/f1/rcc.h>
|
||||||
#include <libopencm3/stm32/gpio.h>
|
#include <libopencm3/stm32/f1/gpio.h>
|
||||||
#include <libopencm3/usb/usbd.h>
|
#include <libopencm3/usb/usbd.h>
|
||||||
#include <libopencm3/usb/cdc.h>
|
#include <libopencm3/usb/cdc.h>
|
||||||
|
|
@ -25,5 +25,5 @@ MEMORY
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* Include the common ld script. */
|
/* Include the common ld script. */
|
||||||
INCLUDE libopencm3_stm32.ld
|
INCLUDE libopencm3_stm32f1.ld
|
||||||
|
|
@ -18,10 +18,10 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
#include <libopencm3/stm32/rcc.h>
|
#include <libopencm3/stm32/f1/rcc.h>
|
||||||
#include <libopencm3/stm32/gpio.h>
|
#include <libopencm3/stm32/f1/gpio.h>
|
||||||
#include <libopencm3/stm32/flash.h>
|
#include <libopencm3/stm32/f1/flash.h>
|
||||||
#include <libopencm3/stm32/scb.h>
|
#include <libopencm3/stm32/f1/scb.h>
|
||||||
#include <libopencm3/usb/usbd.h>
|
#include <libopencm3/usb/usbd.h>
|
||||||
#include <libopencm3/usb/dfu.h>
|
#include <libopencm3/usb/dfu.h>
|
||||||
|
|
@ -25,5 +25,5 @@ MEMORY
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* Include the common ld script. */
|
/* Include the common ld script. */
|
||||||
INCLUDE libopencm3_stm32.ld
|
INCLUDE libopencm3_stm32f1.ld
|
||||||
|
|
@ -18,8 +18,8 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
#include <libopencm3/stm32/rcc.h>
|
#include <libopencm3/stm32/f1/rcc.h>
|
||||||
#include <libopencm3/stm32/gpio.h>
|
#include <libopencm3/stm32/f1/gpio.h>
|
||||||
#include <libopencm3/stm32/systick.h>
|
#include <libopencm3/stm32/systick.h>
|
||||||
#include <libopencm3/usb/usbd.h>
|
#include <libopencm3/usb/usbd.h>
|
||||||
#include <libopencm3/usb/hid.h>
|
#include <libopencm3/usb/hid.h>
|
||||||
@ -28,7 +28,7 @@
|
|||||||
#define INCLUDE_DFU_INTERFACE
|
#define INCLUDE_DFU_INTERFACE
|
||||||
|
|
||||||
#ifdef INCLUDE_DFU_INTERFACE
|
#ifdef INCLUDE_DFU_INTERFACE
|
||||||
#include <libopencm3/stm32/scb.h>
|
#include <libopencm3/stm32/f1/scb.h>
|
||||||
#include <libopencm3/usb/dfu.h>
|
#include <libopencm3/usb/dfu.h>
|
||||||
#endif
|
#endif
|
||||||
|
|
@ -25,5 +25,5 @@ MEMORY
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* Include the common ld script. */
|
/* Include the common ld script. */
|
||||||
INCLUDE libopencm3_stm32.ld
|
INCLUDE libopencm3_stm32f1.ld
|
||||||
|
|
@ -18,8 +18,8 @@
|
|||||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include <libopencm3/stm32/rcc.h>
|
#include <libopencm3/stm32/f1/rcc.h>
|
||||||
#include <libopencm3/stm32/gpio.h>
|
#include <libopencm3/stm32/f1/gpio.h>
|
||||||
|
|
||||||
u16 exti_line_state;
|
u16 exti_line_state;
|
||||||
|
|
@ -27,5 +27,5 @@ MEMORY
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* Include the common ld script. */
|
/* Include the common ld script. */
|
||||||
INCLUDE libopencm3_stm32.ld
|
INCLUDE libopencm3_stm32f1.ld
|
||||||
|
|
@ -19,8 +19,8 @@
|
|||||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include <libopencm3/stm32/rcc.h>
|
#include <libopencm3/stm32/f1/rcc.h>
|
||||||
#include <libopencm3/stm32/gpio.h>
|
#include <libopencm3/stm32/f1/gpio.h>
|
||||||
|
|
||||||
/* Set STM32 to 24 MHz. */
|
/* Set STM32 to 24 MHz. */
|
||||||
void clock_setup(void)
|
void clock_setup(void)
|
@ -27,5 +27,5 @@ MEMORY
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* Include the common ld script. */
|
/* Include the common ld script. */
|
||||||
INCLUDE libopencm3_stm32.ld
|
INCLUDE libopencm3_stm32f1.ld
|
||||||
|
|
@ -17,8 +17,8 @@
|
|||||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include <libopencm3/stm32/rcc.h>
|
#include <libopencm3/stm32/f1/rcc.h>
|
||||||
#include <libopencm3/stm32/gpio.h>
|
#include <libopencm3/stm32/f1/gpio.h>
|
||||||
|
|
||||||
void gpio_setup(void)
|
void gpio_setup(void)
|
||||||
{
|
{
|
@ -27,5 +27,5 @@ MEMORY
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* Include the common ld script. */
|
/* Include the common ld script. */
|
||||||
INCLUDE libopencm3_stm32.ld
|
INCLUDE libopencm3_stm32f1.ld
|
||||||
|
|
@ -18,10 +18,10 @@
|
|||||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include <libopencm3/stm32/rcc.h>
|
#include <libopencm3/stm32/f1/rcc.h>
|
||||||
#include <libopencm3/stm32/gpio.h>
|
#include <libopencm3/stm32/f1/gpio.h>
|
||||||
|
#include <libopencm3/stm32/f1/rtc.h>
|
||||||
#include <libopencm3/stm32/usart.h>
|
#include <libopencm3/stm32/usart.h>
|
||||||
#include <libopencm3/stm32/rtc.h>
|
|
||||||
#include <libopencm3/stm32/pwr.h>
|
#include <libopencm3/stm32/pwr.h>
|
||||||
#include <libopencm3/stm32/nvic.h>
|
#include <libopencm3/stm32/nvic.h>
|
||||||
|
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
x
Reference in New Issue
Block a user