boards/nucleo_f103rb: add new board

Add configuration for Nucleo-64 F103RB board. By default, the UART
console is forwarded to USART2, available on STLink V2-1 USB
connector. All GPIO ports available on the connecot headers are
enabled.

Change-Id: I266170d1288ef27f668410c5737c46cdf716e137
Origin: Original
Signed-off-by: Maciek Borzecki <maciek.borzecki@gmail.com>
This commit is contained in:
Maciek Borzecki 2016-03-05 21:49:40 +01:00 committed by Gerrit Code Review
parent 291415a6c4
commit 4ee4a6abad
6 changed files with 151 additions and 0 deletions

View file

@ -0,0 +1,23 @@
# Kconfig - NUCLEO-64 F103RB board configuration
#
# Copyright (c) 2016 Open-RnD 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_NUCLEO_F103RB
config BOARD
default nucleo_f103rb
endif # BOARD_NUCLEO_F103RB

View file

@ -0,0 +1,20 @@
# Kconfig - NUCLEO-64 F103RB board configuration
#
# Copyright (c) 2016 Open-RnD 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_NUCLEO_F103RB
bool "NUCLEO-64 F103RB Development Board"
depends on SOC_STM32F103RB

View file

@ -0,0 +1,5 @@
ccflags-y += -I$(srctree)/include/drivers
ccflags-y += -I$(srctree)/drivers
asflags-y := ${ccflags-y}
obj-y += board.o

View file

@ -0,0 +1,40 @@
/*
* Copyright (c) 2016 Open-RnD 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.
*/
#include <pinmux/pinmux_stm32.h>
/* pin assignments for NUCLEO-F103RB board */
static const struct pin_config pinconf[] = {
#ifdef CONFIG_UART_STM32_PORT_0
{STM32_PIN_PA9, STM32F1_PINMUX_FUNC_PA9_USART1_TX},
{STM32_PIN_PA10, STM32F1_PINMUX_FUNC_PA10_USART1_RX},
#endif /* CONFIG_UART_STM32_PORT_0 */
#ifdef CONFIG_UART_STM32_PORT_1
{STM32_PIN_PA2, STM32F1_PINMUX_FUNC_PA2_USART2_TX},
{STM32_PIN_PA3, STM32F1_PINMUX_FUNC_PA3_USART2_RX},
#endif /* CONFIG_UART_STM32_PORT_1 */
#ifdef CONFIG_UART_STM32_PORT_2
{STM32_PIN_PB10, STM32F1_PINMUX_FUNC_PB10_USART3_TX},
{STM32_PIN_PB11, STM32F1_PINMUX_FUNC_PB11_USART3_RX},
#endif /* CONFIG_UART_STM32_PORT_2 */
};
const struct pin_config *stm32_board_get_pinconf(size_t *pins)
{
*pins = ARRAY_SIZE(pinconf);
return pinconf;
}

View file

@ -0,0 +1,22 @@
/*
* Copyright (c) 2015 Intel Corporation
*
* 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>
#endif /* __INC_BOARD_H */

View file

@ -0,0 +1,41 @@
CONFIG_ARM=y
CONFIG_BOARD_NUCLEO_F103RB=y
CONFIG_SOC_STM32=y
CONFIG_SOC_STM32F1X=y
CONFIG_SOC_STM32F103RB=y
CONFIG_CORTEX_M_SYSTICK=y
# 36MHz system clock
CONFIG_SYS_CLOCK_HW_CYCLES_PER_SEC=36000000
# enable uart driver
CONFIG_SERIAL=y
CONFIG_UART_STM32=y
# enable USART2 - passthrough to STLINK v2 connector
CONFIG_UART_STM32_PORT_1=y
CONFIG_UART_STM32_PORT_1_BAUD_RATE=9600
# enable console on this port by default
CONFIG_CONSOLE=y
CONFIG_UART_CONSOLE=y
CONFIG_UART_CONSOLE_ON_DEV_NAME="UART_1"
# enable pinmux
CONFIG_PINMUX=y
CONFIG_PINMUX_BASE=0
CONFIG_PINMUX_STM32=y
# enable GPIO ports A, B, C
CONFIG_GPIO=y
CONFIG_GPIO_STM32=y
CONFIG_GPIO_STM32_PORTA=y
CONFIG_GPIO_STM32_PORTB=y
CONFIG_GPIO_STM32_PORTC=y
# configure clocks to get 36MHz on APB1 and APB2
CONFIG_CLOCK_CONTROL=y
CONFIG_CLOCK_CONTROL_STM32F10X=y
CONFIG_CLOCK_STM32F10X_SYSCLK_SRC_PLL=y
CONFIG_CLOCK_STM32F10X_PLL_SRC_HSI=y
CONFIG_CLOCK_STM32F10X_PLL_MULTIPLIER=9
CONFIG_CLOCK_STM32F10X_AHB_PRESCALER=0
CONFIG_CLOCK_STM32F10X_APB1_PRESCALER=0
CONFIG_CLOCK_STM32F10X_APB2_PRESCALER=0