aboutsummaryrefslogtreecommitdiff
path: root/src/stm32
diff options
context:
space:
mode:
authorGareth McMullin2011-10-30 13:39:19 +1300
committerGareth McMullin2011-10-30 13:42:27 +1300
commitd85a39955979e3c59c3cc45146f3fe77519045e9 (patch)
treef004aae3bdf3660319454a5ec55623394c6f3c80 /src/stm32
parentbd779aa618fab9ceb47d432d8f31719618fd75a4 (diff)
Updated to build with new libopenstm32 with f1/f2 split.
Diffstat (limited to 'src/stm32')
-rw-r--r--src/stm32/Makefile.inc6
-rw-r--r--src/stm32/blackmagic.ld2
-rw-r--r--src/stm32/cdcacm.c8
-rw-r--r--src/stm32/jtagtap.c2
-rw-r--r--src/stm32/platform.c8
-rw-r--r--src/stm32/platform.h2
-rw-r--r--src/stm32/swdptap.c2
-rw-r--r--src/stm32/usbdfu.c8
8 files changed, 20 insertions, 18 deletions
diff --git a/src/stm32/Makefile.inc b/src/stm32/Makefile.inc
index 1c38847..f3994e4 100644
--- a/src/stm32/Makefile.inc
+++ b/src/stm32/Makefile.inc
@@ -1,9 +1,9 @@
-CROSS_COMPILE ?= arm-cortexm3-eabi-
+CROSS_COMPILE ?= arm-none-eabi-
CC = $(CROSS_COMPILE)gcc
OBJCOPY = $(CROSS_COMPILE)objcopy
-CFLAGS += -Istm32/include -mcpu=cortex-m3 -mthumb -msoft-float
-LDFLAGS_BOOT = -lopencm3_stm32 -Wl,--defsym,_stack=0x20005000 \
+CFLAGS += -Istm32/include -mcpu=cortex-m3 -mthumb -msoft-float -DSTM32F1
+LDFLAGS_BOOT = -lopencm3_stm32f1 -Wl,--defsym,_stack=0x20005000 \
-Wl,-T,stm32/blackmagic.ld -nostartfiles -lc -lnosys -Wl,-Map=mapfile \
-mthumb -march=armv7 -mfix-cortex-m3-ldrd -msoft-float
LDFLAGS = $(LDFLAGS_BOOT) -Wl,-Ttext=0x8002000
diff --git a/src/stm32/blackmagic.ld b/src/stm32/blackmagic.ld
index 52314c5..9755309 100644
--- a/src/stm32/blackmagic.ld
+++ b/src/stm32/blackmagic.ld
@@ -25,5 +25,5 @@ MEMORY
}
/* Include the common ld script from libopenstm32. */
-INCLUDE libopencm3_stm32.ld
+INCLUDE libopencm3_stm32f1.ld
diff --git a/src/stm32/cdcacm.c b/src/stm32/cdcacm.c
index 9cbd44b..3c9cc56 100644
--- a/src/stm32/cdcacm.c
+++ b/src/stm32/cdcacm.c
@@ -26,11 +26,12 @@
* The device's unique id is used as the USB serial number string.
*/
+#include <libopencm3/stm32/f1/rcc.h>
#include <libopencm3/stm32/nvic.h>
-#include <libopencm3/stm32/gpio.h>
+#include <libopencm3/stm32/f1/gpio.h>
#include <libopencm3/usb/usbd.h>
#include <libopencm3/usb/cdc.h>
-#include <libopencm3/stm32/scb.h>
+#include <libopencm3/stm32/f1/scb.h>
#include <libopencm3/usb/dfu.h>
#include <libopencm3/stm32/usart.h>
#include <stdlib.h>
@@ -359,7 +360,8 @@ static int cdcacm_control_request(struct usb_setup_data *req, uint8_t **buf,
return 0;
struct usb_cdc_line_coding *coding = (void*)*buf;
- usart_set_baudrate(USART1, coding->dwDTERate);
+ usart_set_baudrate(USART1, coding->dwDTERate,
+ rcc_ppre2_frequency);
usart_set_databits(USART1, coding->bDataBits);
switch(coding->bCharFormat) {
case 0:
diff --git a/src/stm32/jtagtap.c b/src/stm32/jtagtap.c
index fa924d0..ee00eef 100644
--- a/src/stm32/jtagtap.c
+++ b/src/stm32/jtagtap.c
@@ -20,7 +20,7 @@
/* This file implements the low-level JTAG TAP interface. */
-#include <libopencm3/stm32/gpio.h>
+#include <libopencm3/stm32/f1/gpio.h>
#include <stdio.h>
#include "general.h"
diff --git a/src/stm32/platform.c b/src/stm32/platform.c
index 71458b1..561498a 100644
--- a/src/stm32/platform.c
+++ b/src/stm32/platform.c
@@ -22,10 +22,10 @@
* implementation.
*/
-#include <libopencm3/stm32/rcc.h>
-#include <libopencm3/stm32/gpio.h>
+#include <libopencm3/stm32/f1/rcc.h>
+#include <libopencm3/stm32/f1/gpio.h>
#include <libopencm3/stm32/systick.h>
-#include <libopencm3/stm32/scb.h>
+#include <libopencm3/stm32/f1/scb.h>
#include <libopencm3/stm32/nvic.h>
#include <libopencm3/stm32/usart.h>
@@ -201,7 +201,7 @@ void uart_init(void)
GPIO_CNF_OUTPUT_ALTFN_PUSHPULL, GPIO9);
/* Setup UART parameters. */
- usart_set_baudrate(USART1, 38400);
+ usart_set_baudrate(USART1, 38400, rcc_ppre2_frequency);
usart_set_databits(USART1, 8);
usart_set_stopbits(USART1, USART_STOPBITS_1);
usart_set_mode(USART1, USART_MODE_TX_RX);
diff --git a/src/stm32/platform.h b/src/stm32/platform.h
index 2925ae8..2b0f0ea 100644
--- a/src/stm32/platform.h
+++ b/src/stm32/platform.h
@@ -24,7 +24,7 @@
#ifndef __PLATFORM_H
#define __PLATFORM_H
-#include <libopencm3/stm32/gpio.h>
+#include <libopencm3/stm32/f1/gpio.h>
#include <setjmp.h>
#include <alloca.h>
diff --git a/src/stm32/swdptap.c b/src/stm32/swdptap.c
index e6799eb..36f3448 100644
--- a/src/stm32/swdptap.c
+++ b/src/stm32/swdptap.c
@@ -20,7 +20,7 @@
/* This file implements the low-level SW-DP interface. */
-#include <libopencm3/stm32/gpio.h>
+#include <libopencm3/stm32/f1/gpio.h>
#include <stdio.h>
#include "general.h"
diff --git a/src/stm32/usbdfu.c b/src/stm32/usbdfu.c
index a6194ee..535ce99 100644
--- a/src/stm32/usbdfu.c
+++ b/src/stm32/usbdfu.c
@@ -19,10 +19,10 @@
#include <string.h>
#include <libopencm3/stm32/systick.h>
-#include <libopencm3/stm32/rcc.h>
-#include <libopencm3/stm32/gpio.h>
-#include <libopencm3/stm32/flash.h>
-#include <libopencm3/stm32/scb.h>
+#include <libopencm3/stm32/f1/rcc.h>
+#include <libopencm3/stm32/f1/gpio.h>
+#include <libopencm3/stm32/f1/flash.h>
+#include <libopencm3/stm32/f1/scb.h>
#include <libopencm3/usb/usbd.h>
#include <libopencm3/usb/dfu.h>