summaryrefslogtreecommitdiff
path: root/boards
diff options
context:
space:
mode:
authorAdam Podogrocki <adam.podogrocki@rndity.com>2016-10-28 10:35:54 +0200
committerKumar Gala <kumar.gala@linaro.org>2017-01-12 09:46:27 -0600
commit7aeea1a124a461f20df9d1cab7f8c071f0b1c2b4 (patch)
treedb5ba77030910f67a7a4391abad534f034382043 /boards
parent72782f542c1eb0c44dac7e539fc7caf9d4350c34 (diff)
boards: add initial support for STM3210C-EVAL board with SoC STM32F107VC
Change-Id: Ib120e0088b009d1e07a756470742fb29a606857e Signed-off-by: Adam Podogrocki <adam.podogrocki@rndity.com>
Diffstat (limited to 'boards')
-rw-r--r--boards/arm/stm3210c_eval/Kconfig.board20
-rw-r--r--boards/arm/stm3210c_eval/Kconfig.defconfig23
-rw-r--r--boards/arm/stm3210c_eval/Makefile2
-rw-r--r--boards/arm/stm3210c_eval/Makefile.board6
-rw-r--r--boards/arm/stm3210c_eval/board.h42
-rw-r--r--boards/arm/stm3210c_eval/stm3210c_eval_defconfig61
-rw-r--r--boards/arm/stm3210c_eval/support/openocd.cfg12
7 files changed, 166 insertions, 0 deletions
diff --git a/boards/arm/stm3210c_eval/Kconfig.board b/boards/arm/stm3210c_eval/Kconfig.board
new file mode 100644
index 000000000..ee8fc10ec
--- /dev/null
+++ b/boards/arm/stm3210c_eval/Kconfig.board
@@ -0,0 +1,20 @@
+# Kconfig - STM3210C-EVAL board configuration
+#
+# Copyright (c) 2016 RnDity Sp. z o.o.
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
+
+config BOARD_STM3210C_EVAL
+ bool "STM3210C-EVAL Evaluation Board"
+ depends on SOC_STM32F107XC
diff --git a/boards/arm/stm3210c_eval/Kconfig.defconfig b/boards/arm/stm3210c_eval/Kconfig.defconfig
new file mode 100644
index 000000000..154c081b1
--- /dev/null
+++ b/boards/arm/stm3210c_eval/Kconfig.defconfig
@@ -0,0 +1,23 @@
+# Kconfig - STM3210C-EVAL board configuration
+#
+# Copyright (c) 2016 RnDity Sp. z o.o.
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
+
+if BOARD_STM3210C_EVAL
+
+config BOARD
+ default stm3210c_eval
+
+endif # BOARD_STM3210C_EVAL
diff --git a/boards/arm/stm3210c_eval/Makefile b/boards/arm/stm3210c_eval/Makefile
new file mode 100644
index 000000000..c925263c4
--- /dev/null
+++ b/boards/arm/stm3210c_eval/Makefile
@@ -0,0 +1,2 @@
+# No C files (yet)
+obj- += dummy.o
diff --git a/boards/arm/stm3210c_eval/Makefile.board b/boards/arm/stm3210c_eval/Makefile.board
new file mode 100644
index 000000000..7d02aa388
--- /dev/null
+++ b/boards/arm/stm3210c_eval/Makefile.board
@@ -0,0 +1,6 @@
+FLASH_SCRIPT = openocd.sh
+
+OPENOCD_LOAD_CMD = "flash write_image erase ${O}/${KERNEL_BIN_NAME} ${CONFIG_FLASH_BASE_ADDRESS}"
+OPENOCD_VERIFY_CMD = "verify_image ${O}/${KERNEL_BIN_NAME} ${CONFIG_FLASH_BASE_ADDRESS}"
+
+export FLASH_SCRIPT OPENOCD_LOAD_CMD OPENOCD_VERIFY_CMD
diff --git a/boards/arm/stm3210c_eval/board.h b/boards/arm/stm3210c_eval/board.h
new file mode 100644
index 000000000..a9529ee4e
--- /dev/null
+++ b/boards/arm/stm3210c_eval/board.h
@@ -0,0 +1,42 @@
+/*
+ * Copyright (c) 2016 RnDity Sp. z o.o.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#ifndef __INC_BOARD_H
+#define __INC_BOARD_H
+
+#include <soc.h>
+
+/* User Button. */
+#define BTN_USER_GPIO_NAME "GPIOB"
+#define BTN_USER_GPIO_PIN 9
+
+/* Push button switch 0. Create an alias to tamper button
+ * to make the basic button sample work.
+ */
+#define SW0_GPIO_NAME BTN_USER_GPIO_NAME
+#define SW0_GPIO_PIN BTN_USER_GPIO_PIN
+
+/* LED 2 */
+#define LED2_GPIO_NAME "GPIOD"
+#define LED2_GPIO_PIN 13
+
+/* LED0. Create an alias to the LED2 to make the basic
+ * blinky sample work.
+ */
+#define LED0_GPIO_PORT LED2_GPIO_NAME
+#define LED0_GPIO_PIN LED2_GPIO_PIN
+
+#endif /* __INC_BOARD_H */
diff --git a/boards/arm/stm3210c_eval/stm3210c_eval_defconfig b/boards/arm/stm3210c_eval/stm3210c_eval_defconfig
new file mode 100644
index 000000000..8b7a87be5
--- /dev/null
+++ b/boards/arm/stm3210c_eval/stm3210c_eval_defconfig
@@ -0,0 +1,61 @@
+# Zephyr Kernel Configuration
+CONFIG_ARM=y
+CONFIG_ARCH="arm"
+CONFIG_SOC_SERIES="stm32f1"
+CONFIG_SOC_FAMILY="st_stm32"
+CONFIG_BOARD="stm3210c_eval"
+CONFIG_SOC_SERIES_STM32F1X=y
+
+# Platform Configuration
+CONFIG_SOC_FAMILY_STM32=y
+CONFIG_SOC_STM32F107XC=y
+CONFIG_SOC_STM32F10X_CONNECTIVITY_LINE_DEVICE=y
+CONFIG_BOARD_STM3210C_EVAL=y
+
+# General Kernel Options
+CONFIG_CORTEX_M_SYSTICK=y
+# 72MHz system clock
+CONFIG_SYS_CLOCK_HW_CYCLES_PER_SEC=72000000
+
+# Serial Drivers
+CONFIG_SERIAL=y
+CONFIG_SERIAL_HAS_DRIVER=y
+CONFIG_UART_INTERRUPT_DRIVEN=y
+CONFIG_UART_STM32=y
+# enable USART2 - passthrough to STLINK v2 connector
+CONFIG_UART_STM32_PORT_2=y
+CONFIG_UART_STM32_PORT_2_BAUD_RATE=115200
+# enable console on this port by default
+CONFIG_CONSOLE=y
+CONFIG_UART_CONSOLE=y
+CONFIG_UART_CONSOLE_ON_DEV_NAME="UART_2"
+
+# Pinmux Driver
+CONFIG_PINMUX=y
+CONFIG_PINMUX_STM32=y
+
+# GPIO Controller
+CONFIG_GPIO=y
+CONFIG_GPIO_STM32=y
+CONFIG_GPIO_STM32_PORTA=y
+CONFIG_GPIO_STM32_PORTB=y
+CONFIG_GPIO_STM32_PORTC=y
+
+# RCC configuration
+CONFIG_CLOCK_CONTROL=y
+CONFIG_CLOCK_CONTROL_STM32F10X=n
+CONFIG_CLOCK_CONTROL_STM32F10X_CONN_LINE=y
+CONFIG_CLOCK_STM32F10X_CONN_LINE_SYSCLK_SRC_PLLCLK=y
+# use PREDIV1 as PLL input
+CONFIG_CLOCK_STM32F10X_CONN_LINE_PLL_SRC_PREDIV1=y
+# however, the board does not have an external oscillator, so just use
+# the 8MHz clock signal coming from integrated STLink
+CONFIG_CLOCK_STM32F10X_CONN_LINE_PREDIV1_SRC_HSE=y
+CONFIG_CLOCK_STM32F10X_CONN_LINE_HSE_BYPASS=y
+# produce 72MHz clock at PLL output
+CONFIG_CLOCK_STM32F10X_CONN_LINE_PREDIV1=0
+CONFIG_CLOCK_STM32F10X_CONN_LINE_PLL_MULTIPLIER=9
+CONFIG_CLOCK_STM32F10X_CONN_LINE_AHB_PRESCALER=0
+# APB1 clock must not to exceed 36MHz limit
+CONFIG_CLOCK_STM32F10X_CONN_LINE_APB1_PRESCALER=2
+CONFIG_CLOCK_STM32F10X_CONN_LINE_APB2_PRESCALER=0
diff --git a/boards/arm/stm3210c_eval/support/openocd.cfg b/boards/arm/stm3210c_eval/support/openocd.cfg
new file mode 100644
index 000000000..bcf95398b
--- /dev/null
+++ b/boards/arm/stm3210c_eval/support/openocd.cfg
@@ -0,0 +1,12 @@
+source [find board/st3210c_eval.cfg]
+
+$_TARGETNAME configure -event gdb-attach {
+ echo "Debugger attaching: halting execution"
+ reset halt
+ gdb_breakpoint_override hard
+}
+
+$_TARGETNAME configure -event gdb-detach {
+ echo "Debugger detaching: resuming execution"
+ resume
+}